2011-08-25 08:57:37 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Application_Model_CommandesGiants extends Zend_Db_Table_Abstract
|
|
|
|
{
|
|
|
|
protected $_name = 'commandes_giants';
|
|
|
|
|
|
|
|
public function getCommandesGiantByLogin($login)
|
|
|
|
{
|
|
|
|
$sql = $this->select()
|
|
|
|
->where('login = ?', $login);
|
|
|
|
$result = $this->getAdapter()->fetchAll($sql);
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCommandesGiantByDate($date)
|
|
|
|
{
|
|
|
|
$sql = $this->select()
|
|
|
|
->where('date = ?', $date);
|
|
|
|
$result = $this->getAdapter()->fetchAll($sql);
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCommandesGiantByLoginAndDate($login, $date)
|
|
|
|
{
|
|
|
|
$sql = $this->select()
|
|
|
|
->where('login = ?', $login)
|
|
|
|
->where('date = ?', $date);
|
|
|
|
$result = $this->getAdapter()->fetchAll($sql);
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
2011-09-06 12:40:31 +00:00
|
|
|
public function getCommandesGiantLoginDateReportType($login, $date, $type, $pays)
|
2011-08-25 08:57:37 +00:00
|
|
|
{
|
|
|
|
$sql = $this->select()
|
|
|
|
->where('login = ?', $login)
|
2011-09-06 12:40:31 +00:00
|
|
|
->where('typeReport = ?', $type)
|
2011-08-25 08:57:37 +00:00
|
|
|
->where('date = ?', $date)
|
2011-08-26 14:02:45 +00:00
|
|
|
->where('pays = ?', $pays);
|
2011-08-25 08:57:37 +00:00
|
|
|
$result = $this->getAdapter()->fetchRow($sql);
|
|
|
|
return ($result['id']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|