35 lines
1.2 KiB
PHP

<?php
require_once 'commons/dates.php';
Class Zend_View_Helper_Interval extends Zend_View_Helper_Abstract
{
protected function getValueSession($name)
{
$session = new Zend_Session_Namespace('ciblage');
if(!empty($session->ciblage[$name]))
return ($session->ciblage[$name]);
}
public function Interval($name, $libelle, $date = false)
{
$session = $this->getValueSession($name);
$champ = '<div>';
$champ .= '<div style="float:left;text-align:left;">
<label>'.$libelle.'</label>
</div>';
$champ .= '<div style="text-align:right;">
<input style="border:1px inset silver;" type="text" name="'.$name.'1" '.
(($date == 'date')?'class="datepicker"':null)
.' value="'.$session[0].'" /> <b>à</b>
<input style="border:1px inset silver;" value="'.$session[1].'" type="text" name="'.$name.'2" '.
(($date == 'date')?'class="datepicker"':null)
.' /> <a class="interval" id="'.$name.'" href=""><img width="10%" src="/themes/default/images/valider.png" /></a>
</div>';
$champ .= '<div style="padding-top:5px;padding-bottom:5px">
<hr />
</div>';
$champ .= '</div>';
return ($champ);
}
}