37 private static $variable=array (
"id"=>
"fi_id",
"text"=>
"fi_text",
"account"=>
"fi_account",
38 "card"=>
"fi_card",
"order"=>
"fi_order",
"cat_id"=>
"fc_id",
"amount"=>
"fi_amount",
"debit"=>
"fi_debit",
"periode"=>
"fi_pid");
51 if ( array_key_exists($p_string,self::$variable) )
53 $idx=self::$variable[$p_string];
57 throw new Exception(
"Attribut inexistant $p_string");
61 if ( array_key_exists($p_string,self::$variable) )
63 $idx=self::$variable[$p_string];
67 throw new Exception(
"Attribut inexistant $p_string");
73 return var_export(self::$variable,
true);
77 $this->fi_account= str_replace(
" ",
"", $this->fi_account);
93 if ( $this->
verify() != 0 )
return;
95 $sql=
"INSERT INTO forecast_item(
96 fi_text, fi_account, fi_card, fi_order, fc_id, fi_amount,
98 VALUES ($1, $2, $3, $4, $5, $6, $7,$8) returning fi_id;";
101 array($this->fi_text,$this->fi_account,$this->fi_card,$this->fi_order,$this->fc_id,$this->fi_amount,$this->fi_debit,$this->fi_pid)
108 if ( $this->
verify() != 0 )
return;
110 $sql=
"UPDATE forecast_item
111 SET fi_text=$1, fi_account=$2, fi_card=$3, fi_order=$4, fc_id=$5,
112 fi_amount=$6, fi_debit=$7,fi_pid=$8
115 array($this->fi_text,
131 $sql=
"SELECT fi_id, fi_text, fi_account, fi_card, fi_order, fc_id, fi_amount,
133 FROM forecast_item where fi_id=$1";
152 public function delete()
154 $sql=
"delete from forecast_item where fi_id=$1";
155 $res=$this->
cn->exec_sql(
$sql,array($this->fi_id));