extranet/library/Giant/RequestDatabase.lib.php
2013-05-23 13:42:00 +00:00

92 lines
2.4 KiB
PHP

<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
Class Commandes
{
protected $enumerations = array('Full' => 'FU', 'Compact' => 'CO', 'CreditRecommendation' => 'CR');
public function __construct()
{
}
public function setCommandes($parametres)
{
$commandes = new Application_Model_CommandesGiants();
$data = array( 'login' => $parametres->login,
'date' => $parametres->date,
'typeReport' => $parametres->typeReport,
'price' => $parametres->price,
'pays' => $parametres->pays,
'rapportId' => $parametres->rapportId,
//'lang' => $parametres->lang
);
$commandes->insert($data);
}
public function getCommandesByLogin($login)
{
$commandes = new Application_Model_CommandesGiants();
return ($commandes->getCommandesGiantByLogin($login));
}
public function getCommandesByDate($date)
{
$commandes = new Application_Model_CommandesGiants();
return ($commandes->getCommandesGiantByDate($date));
}
public function getCommandesByLoginAndDate($login, $date)
{
$commandes = new Application_Model_CommandesGiants();
return ($commandes->getCommandesGiantByLoginAndDate($login, $date));
}
public function getCommandeExistToday($login, $date, $type, $pays)
{
$commande = new Application_Model_CommandesGiants();
$result = $commande->getCommandesGiantLoginDateReportType($login, $date, $type, $pays);
if(!empty($result))
return (true);
return (false);
}
}
Class Rapports
{
protected $enumerations = array('Full' => 'FU', 'Compact' => 'CO', 'CreditRecommendation' => 'CR');
public function __construct($countryCode, $TestIndication)
{
}
public function setReport($companyId, $type, $pays, $reportSerial, $Language)
{
$report = new Application_Model_RapportsGiants();
$datas = array('companyId' => $companyId,
'date' => date('Y-m-d'),
'pays' => $pays,
'type' => $this->enumerations[$type],
'report' => $reportSerial,
'lang' => $Language
);
$report->insert($datas);
return ($reportSerial);
}
public function getRapportExist($companyId, $type, $Language)
{
$rapports = new Application_Model_RapportsGiants();
$id = $rapports->getReportByIdAndType($companyId, $this->enumerations[$type], $Language);
return ($id);
}
public function getRapportExistId($companyId, $Language)
{
$rapports = new Application_Model_RapportsGiants();
$id = $rapports->getReportById($companyId, $Language);
return ($id);
}
}
?>