extranet/library/Application/Model/CommandesGiants.php

50 lines
1.3 KiB
PHP
Raw Normal View History

<?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);
}
public function getCommandesGiantLoginDateReportType($login, $date, $type, $pays)
{
$sql = $this->select()
->where('login = ?', $login)
->where('typeReport = ?', $type)
->where('date = ?', $date)
2011-08-26 14:02:45 +00:00
->where('pays = ?', $pays);
$result = $this->getAdapter()->fetchRow($sql);
return ($result['id']);
}
}
?>