36 private static $variable=array (
"id"=>
"fc_id",
"order"=>
"fc_order",
"desc"=>
"fc_desc",
"forecast"=>
"f_id");
49 if ( array_key_exists($p_string,self::$variable) )
51 $idx=self::$variable[$p_string];
55 throw new Exception(
"Attribut inexistant $p_string");
59 if ( array_key_exists($p_string,self::$variable) )
61 $idx=self::$variable[$p_string];
65 throw new Exception(
"Attribut inexistant $p_string");
71 return var_export(self::$variable,
true);
75 if (strlen(trim($this->fc_order))==0)
93 if ( $this->
verify() != 0 )
return;
95 $sql=
"insert into forecast_cat (fc_desc,fc_order,f_id) ".
96 " values ($1,$2,$3) returning fc_id";
99 array($this->fc_desc,$this->fc_order,$this->f_id)
106 if ( $this->
verify() != 0 )
return;
108 $sql=
"update forecast_cat set fc_desc=$1,f_id=$2,fc_order=$3 ".
112 array($this->fc_desc,$this->f_id, $this->fc_order,$this->fc_id)
123 $sql=
"select fc_id,fc_desc,fc_order from forecast_cat where f_id=$1";
132 $sql=
"select fc_desc, f_id,fc_order from forecast_cat where fc_id=$1";
155 $sql=
"select fc_id,fc_desc from forecast_cat where f_id=$id";
159 public function delete()
161 $sql=
"delete from forecast_cat where fc_id=$1";
162 $res=$this->
cn->exec_sql(
$sql,array($this->fc_id));