extranet/library/Giant/Rapports.php

39 lines
1.2 KiB
PHP

<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
Class Rapports
{
protected $db = null;
protected $enumerations = array('Full' => 'FU', 'Compact' => 'CO', 'CreditRecommendation' => 'CR');
public function __construct($countryCode, $TestIndication)
{
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH.'/configs/databases.ini');
$this->db = Zend_Db::factory($dbConfig->db->sdv1);
}
public function setReport($companyId, $type, $pays, $reportSerial)
{
$report = new Application_Model_RapportsGiants($this->db);
$datas = array('companyId' => $companyId,
'date' => date('Y-m-d'),
'pays' => $pays,
'type' => 'FU',
'report' => $reportSerial
);
$report->insert($datas);
return ($reportSerial);
}
public function getRapportExist($companyId, $type)
{
$rapports = new Application_Model_RapportsGiants($this->db);
$id = $rapports->getReportByIdAndType($companyId, $this->enumerations[$type]);
return ($id);
}
}
?>