extranet/library/Giant/Commandes.php

58 lines
1.8 KiB
PHP
Raw Normal View History

<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
Class Commandes
{
protected $db = null;
public function __construct()
{
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH.'/configs/databases.ini');
$this->db = Zend_Db::factory($dbConfig->db->sdv1);
}
public function setCommandes($parametres)
{
$commandes = new Application_Model_CommandesGiants($this->db);
$data = array( 'login' => $parametres->login,
'date' => $parametres->date,
'typeReport' => $parametres->typeReport,
'price' => $parametres->price,
'rapportId' => $parametres->rapportId,
'pays' => $parametres->pays
);
$commandes->insert($data);
}
public function getCommandesByLogin($login)
{
$commandes = new Application_Model_CommandesGiants($this->db);
return ($commandes->getCommandesGiantByLogin($login));
}
public function getCommandesByDate($date)
{
$commandes = new Application_Model_CommandesGiants($this->db);
return ($commandes->getCommandesGiantByDate($date));
}
public function getCommandesByLoginAndDate($login, $date)
{
$commandes = new Application_Model_CommandesGiants($this->db);
return ($commandes->getCommandesGiantByLoginAndDate($login, $date));
}
2011-08-26 14:02:45 +00:00
public function getCommandeExistToday($login, $date, $rapportId, $type, $pays)
{
$commande = new Application_Model_CommandesGiants($this->db);
2011-08-26 14:02:45 +00:00
$result = $commande->getCommandesGiantLoginDateReportType($login, $date, $rapportId, $type, $pays);
if(!empty($result))
return (true);
return (false);
}
}
?>