30 require_once NOALYSS_INCLUDE.
'/lib/class_database.php';
31 require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
42 protected $variable=array(
"ha_id"=>
"ha_id",
"a_id"=>
"a_id"
43 ,
"h_amount"=>
"h_amount"
44 ,
"jr_internal"=>
"jr_internal"
56 foreach ($this->variable as
$key=>$value) $this->$value=
'';
68 if ( array_key_exists($p_string,$this->variable) )
70 $idx=$this->variable[$p_string];
74 throw new Exception (__FILE__.
":".__LINE__.$p_string.
'Erreur attribut inexistant');
78 if ( array_key_exists($p_string,$this->variable) )
80 $idx=$this->variable[$p_string];
84 throw new Exception (__FILE__.
":".__LINE__.$p_string.
'Erreur attribut inexistant');
88 return var_export($this,
true);
94 if ( settype($this->
a_id,
'float') ==
false )
95 throw new Exception(
'DATATYPE a_id $this->a_id non numerique');
96 if ( settype($this->h_amount,
'float') ==
false )
97 throw new Exception(
'DATATYPE h_amount $this->h_amount non numerique');
98 if ( settype($this->h_year,
'float') ==
false )
99 throw new Exception(
'DATATYPE h_year $this->h_year non numerique');
106 if ( $this->
ha_id == -1 )
119 public function seek($cond=
'',$p_array=null)
121 $sql=
"select * from amortissement.amortissement_histo $cond";
125 $size=$this->cn->count();
126 if ( $size == 0 )
return $aobj;
127 for ($i=0; $i<$size; $i++)
130 foreach (
$array[$i] as $idx=>$value)
140 if ( $this->
verify() != 0 )
return;
141 if ( $this->
ha_id==-1 )
144 $sql=
"insert into amortissement.amortissement_histo(a_id
156 $this->
ha_id=$this->cn->get_value(
168 $sql=
"insert into amortissement.amortissement_histo(a_id
181 $this->
ha_id=$this->cn->get_value(
197 if ( $this->
verify() != 0 )
return;
199 $sql=
" update amortissement.amortissement_histo set a_id = $1
205 $res=$this->cn->exec_sql(
228 from amortissement.amortissement_histo where ha_id=$1";
230 $res=$this->cn->get_array(
235 if ( count(
$res) == 0 )
238 foreach ($this->variable as
$key=>$value) $this->
$key=
'';
242 foreach (
$res[0] as $idx=>$value)
249 public function delete()
251 $sql=
"delete from amortissement.amortissement_histo where ha_id=$1";
if($p_number->value==0) l les annuités seront recalculées et l pct[] ad_year[] select h_pj
static test_me()
Unit test for the class.
__construct(&$p_cn, $p_id=-1)
if(isset($_POST['remove'])) $array
Manage the table amortissement.amortissement_histo.
set_parameter($p_string, $p_value)
seek($cond='', $p_array=null)
retrieve array of object thanks a condition
if($p_number->value==0) l les annuités seront recalculées et l pct[] ad_year[] select ha_id
if($p_number->value==0) l les annuités seront recalculées et l pct[] ad_year[] select h_amount from amortissement amortissement_histo where a_id
if($p_number->value==0) l les annuités seront recalculées et l pct[] ad_year[] select jr_internal