2011-07-12 15:13:03 +00:00
|
|
|
<?php
|
|
|
|
class Application_Model_BilanSaisie extends Zend_Db_Table_Abstract
|
|
|
|
{
|
|
|
|
protected $_name = 'bilansaisie';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enregistre les informations nécessaire pour la saisie
|
|
|
|
* @param unknown_type $email
|
|
|
|
* @param unknown_type $method
|
|
|
|
* @param unknown_type $confidentiel
|
|
|
|
* @param unknown_type $siren
|
|
|
|
* @param unknown_type $bilanCloture
|
|
|
|
* @param unknown_type $format
|
|
|
|
* @param unknown_type $bilanDuree
|
|
|
|
*/
|
|
|
|
public function setInformations($cliendId, $utilisateurId, $utilisateurLogin, $email, $method, $confidentiel, $siren, $bilanCloture, $format, $bilanDuree)
|
|
|
|
{
|
2011-08-29 15:44:29 +00:00
|
|
|
$env = 'PRD';
|
2011-07-12 15:13:03 +00:00
|
|
|
$data = array(
|
|
|
|
'clientId' => $cliendId,
|
|
|
|
'utilisateurId' => $utilisateurId,
|
|
|
|
'utilisateurLogin' => $utilisateurLogin,
|
|
|
|
'utilisateurEmail' => $email,
|
|
|
|
'method' => $method,
|
|
|
|
'confidentiel' => $confidentiel,
|
|
|
|
'siren' => $siren,
|
2011-08-29 15:44:29 +00:00
|
|
|
'env' => $env,
|
2011-07-12 15:13:03 +00:00
|
|
|
'fichier' => '',
|
|
|
|
'bilanCloture' => $bilanCloture,
|
|
|
|
'format' => $format,
|
|
|
|
'bilanDuree' => $bilanDuree,
|
|
|
|
'dateInsert' => date('Y-m-d H:i:s'),
|
|
|
|
);
|
|
|
|
return $this->insert($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retourne les informations
|
|
|
|
* @param string $ref
|
|
|
|
*/
|
|
|
|
public function getInfosBilan($ref)
|
|
|
|
{
|
|
|
|
$sql = $this->select()->where(" ref='$ref'");
|
|
|
|
$result = $this->fetchAll($sql)->toArray();
|
|
|
|
return $result[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enregistre le nom du fichier
|
|
|
|
* @param string $ref
|
|
|
|
* @param string $name
|
|
|
|
*/
|
|
|
|
public function setFilename($ref, $name)
|
|
|
|
{
|
|
|
|
$data = array( 'fichier' => $name );
|
|
|
|
$this->update($data, "ref='$ref'");
|
|
|
|
}
|
|
|
|
|
2011-08-29 15:44:29 +00:00
|
|
|
public function listBilans()
|
|
|
|
{
|
|
|
|
$sql = $this->select()
|
2012-01-25 10:17:03 +00:00
|
|
|
->from($this, array('ref','utilisateurId','confidentiel','siren','bilanCloture','bilanDuree','fichier','env'))
|
2011-08-29 15:44:29 +00:00
|
|
|
->where("dateEnvoi='0000-00-00 00:00:00' AND fichier!=''");
|
|
|
|
$result = $this->fetchAll($sql)->toArray();
|
|
|
|
return $result;
|
|
|
|
}
|
2011-07-12 15:13:03 +00:00
|
|
|
|
2011-08-29 15:44:29 +00:00
|
|
|
public function setDateEnvoi($ref)
|
|
|
|
{
|
|
|
|
$data = array( 'dateEnvoi' => date('Y-m-d H:m:s') );
|
|
|
|
return $this->update($data, "ref='$ref'");
|
|
|
|
}
|
2011-07-12 15:13:03 +00:00
|
|
|
|
|
|
|
}
|