2011-08-25 08:57:37 +00:00
|
|
|
<?php
|
2013-03-11 13:41:59 +00:00
|
|
|
/*
|
2011-10-13 10:22:44 +00:00
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
2011-08-25 08:57:37 +00:00
|
|
|
Class Commandes
|
|
|
|
{
|
2011-09-06 12:40:31 +00:00
|
|
|
protected $enumerations = array('Full' => 'FU', 'Compact' => 'CO', 'CreditRecommendation' => 'CR');
|
2011-08-25 08:57:37 +00:00
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setCommandes($parametres)
|
|
|
|
{
|
2011-09-27 15:33:24 +00:00
|
|
|
$commandes = new Application_Model_CommandesGiants();
|
2011-08-25 08:57:37 +00:00
|
|
|
$data = array( 'login' => $parametres->login,
|
|
|
|
'date' => $parametres->date,
|
|
|
|
'typeReport' => $parametres->typeReport,
|
|
|
|
'price' => $parametres->price,
|
2013-03-11 13:41:59 +00:00
|
|
|
'pays' => $parametres->pays,
|
|
|
|
'rapportId' => $parametres->rapportId
|
2011-08-25 08:57:37 +00:00
|
|
|
);
|
|
|
|
$commandes->insert($data);
|
|
|
|
}
|
|
|
|
public function getCommandesByLogin($login)
|
|
|
|
{
|
2011-09-27 15:33:24 +00:00
|
|
|
$commandes = new Application_Model_CommandesGiants();
|
2011-08-25 08:57:37 +00:00
|
|
|
return ($commandes->getCommandesGiantByLogin($login));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCommandesByDate($date)
|
|
|
|
{
|
2011-09-27 15:33:24 +00:00
|
|
|
$commandes = new Application_Model_CommandesGiants();
|
2011-08-25 08:57:37 +00:00
|
|
|
return ($commandes->getCommandesGiantByDate($date));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCommandesByLoginAndDate($login, $date)
|
|
|
|
{
|
2011-09-27 15:33:24 +00:00
|
|
|
$commandes = new Application_Model_CommandesGiants();
|
2011-08-25 08:57:37 +00:00
|
|
|
return ($commandes->getCommandesGiantByLoginAndDate($login, $date));
|
|
|
|
}
|
|
|
|
|
2011-09-06 12:40:31 +00:00
|
|
|
public function getCommandeExistToday($login, $date, $type, $pays)
|
2011-08-25 08:57:37 +00:00
|
|
|
{
|
2011-09-27 15:33:24 +00:00
|
|
|
$commande = new Application_Model_CommandesGiants();
|
2011-09-06 12:40:31 +00:00
|
|
|
$result = $commande->getCommandesGiantLoginDateReportType($login, $date, $type, $pays);
|
2011-08-25 08:57:37 +00:00
|
|
|
if(!empty($result))
|
|
|
|
return (true);
|
|
|
|
return (false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-13 10:22:44 +00:00
|
|
|
Class Rapports
|
|
|
|
{
|
|
|
|
protected $enumerations = array('Full' => 'FU', 'Compact' => 'CO', 'CreditRecommendation' => 'CR');
|
|
|
|
|
|
|
|
public function __construct($countryCode, $TestIndication)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setReport($companyId, $type, $pays, $reportSerial)
|
|
|
|
{
|
|
|
|
$report = new Application_Model_RapportsGiants();
|
|
|
|
$datas = array('companyId' => $companyId,
|
|
|
|
'date' => date('Y-m-d'),
|
|
|
|
'pays' => $pays,
|
|
|
|
'type' => $this->enumerations[$type],
|
|
|
|
'report' => $reportSerial
|
|
|
|
);
|
|
|
|
$report->insert($datas);
|
|
|
|
return ($reportSerial);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRapportExist($companyId, $type)
|
|
|
|
{
|
|
|
|
$rapports = new Application_Model_RapportsGiants();
|
|
|
|
$id = $rapports->getReportByIdAndType($companyId, $this->enumerations[$type]);
|
|
|
|
return ($id);
|
|
|
|
}
|
2013-03-11 13:41:59 +00:00
|
|
|
|
|
|
|
public function getRapportExistId($companyId, $type)
|
|
|
|
{
|
|
|
|
$rapports = new Application_Model_RapportsGiants();
|
|
|
|
$id = $rapports->getReportById($companyId);
|
|
|
|
return ($id);
|
|
|
|
}
|
2011-10-13 10:22:44 +00:00
|
|
|
}
|
|
|
|
?>
|