34 require_once NOALYSS_INCLUDE.
'/lib/class_html_input.php';
50 $this->
value=$p_value;
69 public function input($p_name=null,$p_value=null)
71 foreach (array(
'type',
'cn') as
$a)
73 if ( ! isset ($this->$a) )
throw new Exception(
'Variable non définie [ '.$a.
']');
75 $this->
name=($p_name==null)?$this->
name:$p_name;
76 $this->
value=($p_value==null)?$this->
value:$p_value;
82 $sql_closed=
"where p_closed=true and p_central = false ";
85 $sql_closed=
"where p_closed=false";
88 $sql_closed=
"where p_closed=true and p_central = false ";
94 throw new Exception(
"invalide p_type in ".__FILE__.
':'.__LINE__);
96 $sql=
"select p_id,to_char(p_start,'DD.MM.YYYY') as p_start_string,
97 to_char(p_end,'DD.MM.YYYY') as p_end_string
107 if ( $this->exercice==
'')
109 if (! isset($this->
user) )
throw new Exception (__FILE__.
':'.__LINE__.
' user is not set');
110 $this->exercice=$this->
user->get_exercice();
114 if ( $sql_closed==
"") $and=
" where " ;
else $and=
" and ";
115 if ($this->
type ==
'all' ) $cond=$and.
' true ';
116 $cond.=
" $and p_exercice='".sql_string($this->exercice).
"'";
119 $sql.=$cond.
" order by p_start,p_end";
123 if (
$Max == 0 )
throw new Exception(_(
'Aucune periode trouvée'),1);
125 for ( $i = 0; $i <
$Max;$i++)
127 $l_line=$this->
cn->fetch($i);
128 if ( $this->
value==$l_line[
'p_id'] )
135 $ret.=sprintf(
'<OPTION VALUE="%s" %s>%s - %s',$l_line[
'p_id']
137 ,$l_line[
'p_start_string']
138 ,$l_line[
'p_end_string']);
142 $ret.=sprintf(
'<OPTION VALUE="%s" %s>%s ',$l_line[
'p_id']
144 ,$l_line[
'p_start_string']
149 $ret.=sprintf(
'<OPTION VALUE="%s" %s>%s ',$l_line[
'p_id']
151 ,$l_line[
'p_end_string']
164 $r=
"not implemented ".__FILE__.
":".__LINE__;
Generate the form for the periode Data Members.
__construct($p_name="", $p_value="", $p_exercice='')
input($p_name=null, $p_value=null)
show the input html for a periode
display()
print in html the readonly value of the widget
for($e=0;$e< count($array);$e++) $desc readOnly
$input_from show_end_date
$input_to show_start_date