29 require_once NOALYSS_INCLUDE.
'/lib/class_ihidden.php';
30 require_once NOALYSS_INCLUDE.
'/lib/class_itext.php';
31 require_once NOALYSS_INCLUDE.
'/lib/class_iselect.php';
32 require_once NOALYSS_INCLUDE.
'/lib/class_ispan.php';
33 require_once NOALYSS_INCLUDE.
'/lib/class_database.php';
34 require_once NOALYSS_INCLUDE.
'/class/class_anc_plan.php';
71 $this->
id=
$line[
'po_id'];
73 $this->pa_id=
$line[
'pa_id'];
74 $this->amount=
$line[
'po_amount'];
75 $this->description=
$line[
'po_description'];
76 $this->ga_id=
$line[
'ga_id'];
92 if ( $p_name == null )
96 echo
"id = ".$this->id;
101 if ( strlen($this->
name) == 0)
103 if ( $this->ga_id == null || strlen(
trim($this->ga_id)) == 0 )
107 $sql=
"insert into poste_analytique (
113 ) values ($1,$2,$3,$4,$5)";
117 $this->
db->exec_sql(
$sql,array($this->
name,$this->pa_id,$this->amount,$this->description,
$ga_id));
122 if ( DEBUG ) print_r($e);
123 echo
"<p class=\"notice\">Doublon : l'enregistrement n'est pas sauve</p>";
129 $a=
$cn->make_array(
"select po_name,po_name from poste_analytique ".
131 " pa_id = $1 order by po_name ",0,array(
$pa_id));
137 if ( strlen($this->
name) == 0)
139 $sql=
"update poste_analytique ".
143 " ,po_description=$4".
148 $this->
db->exec_sql(
$sql,array($this->
name,$this->pa_id,$this->amount,
149 $this->description,$this->ga_id,$this->
id));
153 echo
"<p class=\"notice\">Doublon : l'enregistrement n'est pas sauve</p>";
163 if (strlen($this->amount) == 0 )
172 $sql=
"delete from poste_analytique where po_id=".$this->id;
173 $this->
db->exec_sql(
$sql);
187 from poste_analytique ".
201 $object->name=$line[
'po_name'];
203 $object->amount=$line[
'po_amount'];
204 $object->description=$line[
'po_description'];
221 echo $line->id.
" / ".$line->name.
" / ".$line->description.
"/".
222 $line->amount.
" / ".$line->pa_id.
"/".$line->ga_id.
"<br>";
227 echo
"id ".$this->id.
"<br>";
228 echo
"name ".$this->name.
"<br>";
229 echo
"pa_id ".$this->pa_id.
"<br>";
230 echo
"amount ".$this->amount.
"<br>";
231 echo
"description ".$this->description.
"<br>";
232 echo
"ga_id ".$this->ga_id.
"<br>";
238 $wAmount=
new INum(
"po_amount",$this->amount);
239 $wDescription=
new IText(
"po_description",$this->description);
240 $aGroup_analytic=$this->
db->make_array(
"select ga_id,ga_id from groupe_analytique where pa_id=".$this->pa_id,1);
241 if ( count($aGroup_analytic) > 1 )
244 $wGa_id->value=$aGroup_analytic;
256 $wPaName->readOnly=
true;
260 $wDescription->table=1;
272 $r.=
td(_(
'Montant'));
273 $r.=$wAmount->input();
278 $r.=
td(_(
'Description'));
279 $r.=$wDescription->input();
283 $r.=
td(_(
'Plan Analytique'));
284 $r.=$wPaName->input();
289 $r.=$wGa_id->input();
299 $this->description=(isset (
$p_array[
'po_description']))?
$p_array[
'po_description']:
"";
309 $pa_id=
$cn->get_value(
"select max(pa_id) from plan_analytique");
311 echo
"<h1>Poste_Analytique</h1>";
312 echo
"<h2>get_list</h2>";
317 echo
"<h2>Add some </h2>";
335 echo
"<h2> remove test1</h2>";
336 $o->get_by_name(
"test1");
340 $o->get_by_name(
"test4");
341 echo
"<hr>".$o->id.
"<hr>";
342 $o->name=
"Test Four";
if(isset($_POST['confirm_mod'])) $object
static fetch_all($ret)
wrapper for the function pg_fetch_all
sql_string($p_string)
Fix the problem with the quote char for the database.
td($p_string='', $p_extra='')
surround the string with td
static num_row($ret)
wrapper for the function pg_NumRows
get_by_name($p_name)
retrieve data thanks the name
Concerns the Analytic plan (table plan_analytique)
static fetch_array($ret, $p_indice=0)
wrapper for the function pg_fetch_array
contains the object for the poste_analytique (table poste_analytique)
get_list()
return an array of object Poste_Analytique
function trim(s)
remove trailing and heading space
__construct($p_db, $p_id=0)
fetch_from_db($p_where)
retrieve data from the database and fill the object
static make_array_name($cn, $pa_id)
This class handles only the numeric input, the input will call a javascript to change comma to period...