29 require_once NOALYSS_INCLUDE.
'/lib/class_itext.php';
30 require_once NOALYSS_INCLUDE.
'/lib/class_ihidden.php';
31 require_once NOALYSS_INCLUDE.
'/constant.php';
32 require_once NOALYSS_INCLUDE.
'/lib/class_database.php';
33 require_once NOALYSS_INCLUDE.
'/class/class_anc_account.php';
34 require_once NOALYSS_INCLUDE.
'/class/class_dossier.php';
48 $this->description=
"";
58 $sql=
"select pa_id as id,pa_name as name,".
59 "pa_description as description from plan_analytique $p_order";
67 if ( $this->
id==0)
return;
69 $sql=
"select pa_name,pa_description from plan_analytique where pa_id=".$this->id;
77 $this->description=
$a[
'pa_description'];
83 if ( $this->
id == 0 )
return;
84 $this->
db->exec_sql(
"delete from plan_analytique where pa_id=".$this->
id);
89 if ( $this->
id==0)
return;
91 if ( strlen(
$name) == 0)
95 $this->
db->exec_sql(
"update plan_analytique set pa_name=$1,
102 if ( strlen(
$name) == 0)
104 if ( $this->
isAppend() ==
false)
return;
106 $this->
db->exec_sql(
"insert into plan_analytique(pa_name,pa_description)".
109 "'".$description.
"')");
110 $this->
id=$this->
db->get_current_seq(
'plan_analytique_pa_id_seq');
119 $wDescription=
new IText(
'pa_description',$this->description);
120 $wDescription->table=1;
121 $wId=
new IHidden(
"pa_id",$this->
id);
123 $ret.=
'<tr>'.td(_(
'Nom')).$wName->input().
'</tr>';
124 $ret.=
"<tr>".td(_(
'Description')).$wDescription->input().
"</tr>";
131 $count=$this->
db->get_value(
"select count(pa_id) from plan_analytique");
144 $sql=
"select po_id,po_name from poste_analytique where pa_id=".$this->id.
" $p_order";
165 $a_plan=$this->
get_list(
" order by pa_id");
166 if ( empty($a_plan))
return "";
167 foreach ($a_plan as $r_plan)
169 $res.=
"<th>".h($r_plan[
'name']).
"</th>";
175 $a=$this->
db->count_sql(
"select pa_id from plan_analytique");
180 $a=$this->
db->count_sql(
"select pa_id from plan_analytique where pa_id=".
183 return (
$a==0)?
false:
true;
206 echo
"<h1>Plan analytique : test</h1>";
208 $cn->exec_sql(
"delete from plan_analytique");
212 $p->name=
"Nouveau 1";
213 $p->description=
"C'est un test";
216 $p->name=
"Nouveau 2";
220 $p->name=
"Nouveau 3";
225 $p->name=
"Nouveau 4";
232 echo
"<h2>Update</h2> ";
234 $p->description=
"c'est change";
238 echo
"<h2>get_list</h2>";
241 echo
"<h2>delete </h2>";
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.
static num_row($ret)
wrapper for the function pg_NumRows
get_poste_analytique($p_order="")
get all the poste related to the current Analytic plan
get_list($p_order=" order by pa_name")
get the list of all existing PA
static hidden($p_array)
return an HTML string containing hidden input type to hold the differant PA_ID
header()
show the header for a table for PA
Concerns the Analytic plan (table plan_analytique)
static escape_string($p_string)
wrapper for the function pg_escape_string
static fetch_array($ret, $p_indice=0)
wrapper for the function pg_fetch_array
contains the object for the poste_analytique (table poste_analytique)
__construct($p_cn, $p_id=0)