noalyss
Version-6.7.2
|
Concerns the Analytic plan (table plan_analytique) More...
Public Member Functions | |
add () | |
Anc_Plan ($p_cn, $p_id=0) | |
count () | |
delete () | |
exist () | |
form () | |
get () | |
get_list ($p_order=" order by pa_name") | |
get the list of all existing PA | |
get_poste_analytique ($p_order="") | |
get all the poste related to the current Analytic plan | |
header () | |
show the header for a table for PA | |
isAppend () | |
update () | |
Static Public Member Functions | |
static | hidden ($p_array) |
return an HTML string containing hidden input type to hold the differant PA_ID | |
static | test_me () |
Data Fields | |
$db | |
$description | |
$id | |
$name |
Concerns the Analytic plan (table plan_analytique)
Definition at line 36 of file class_anc_plan.php.
Anc_Plan::add | ( | ) |
Definition at line 99 of file class_anc_plan.php.
References $description, $name, db, isAppend(), name, and sql_string().
{ $name=sql_string($this->name); if ( strlen($name) == 0) return; if ( $this->isAppend() == false) return; $description=sql_string($this->description); $this->db->exec_sql("insert into plan_analytique(pa_name,pa_description)". " values (". "'".$name."',". "'".$description."')"); $this->id=$this->db->get_current_seq('plan_analytique_pa_id_seq'); }
Anc_Plan::Anc_Plan | ( | $ | p_cn, |
$ | p_id = 0 |
||
) |
Anc_Plan::count | ( | ) |
Anc_Plan::delete | ( | ) |
Definition at line 81 of file class_anc_plan.php.
References db.
{ if ( $this->id == 0 ) return; $this->db->exec_sql("delete from plan_analytique where pa_id=".$this->id); }
Anc_Plan::exist | ( | ) |
Definition at line 178 of file class_anc_plan.php.
References $a, db, and Database\escape_string().
{ $a=$this->db->count_sql("select pa_id from plan_analytique where pa_id=". Database::escape_string($this->pa_id)); return ($a==0)?false:true; }
Anc_Plan::form | ( | ) |
Definition at line 113 of file class_anc_plan.php.
{ $wName=new IText('pa_name',$this->name); $wName->table=1; $wDescription=new IText('pa_description',$this->description); $wDescription->table=1; $wId=new IHidden("pa_id",$this->id); $ret="<TABLE>"; $ret.='<tr>'.td(_('Nom')).$wName->input().'</tr>'; $ret.="<tr>".td(_('Description')).$wDescription->input()."</tr>"; $ret.="</table>"; $ret.=$wId->input(); return $ret; }
Anc_Plan::get | ( | ) |
Definition at line 65 of file class_anc_plan.php.
References $a, $ret, $sql, db, Database\fetch_array(), name, and Database\num_row().
Anc_Plan::get_list | ( | $ | p_order = " order by pa_name" | ) |
get the list of all existing PA
Definition at line 55 of file class_anc_plan.php.
References $array, $ret, $sql, db, and Database\fetch_all().
Referenced by header().
Anc_Plan::get_poste_analytique | ( | $ | p_order = "" | ) |
get all the poste related to the current Analytic plan
Definition at line 142 of file class_anc_plan.php.
References $all, $line, $obj, $r, $ret, $sql, db, Database\fetch_all(), and Database\num_row().
{ $sql="select po_id,po_name from poste_analytique where pa_id=".$this->id." $p_order"; $r=$this->db->exec_sql($sql); $ret=array(); if ( Database::num_row($r) == 0 ) return $ret; $all=Database::fetch_all($r); foreach ($all as $line) { $obj=new Anc_Account($this->db,$line['po_id']); $obj->get_by_id(); $ret[]=clone $obj; } return $ret; }
Anc_Plan::header | ( | ) |
show the header for a table for PA
name...
Definition at line 162 of file class_anc_plan.php.
References $res, and get_list().
static Anc_Plan::hidden | ( | $ | p_array | ) | [static] |
return an HTML string containing hidden input type to hold the differant PA_ID
$p_array | contains a array, it is the result of the fct Anc_Plan::get_list |
Definition at line 194 of file class_anc_plan.php.
References $p_array, $r, and count().
Referenced by Acc_Ledger_Fin\confirm(), Acc_Ledger_Sold\confirm(), Acc_Ledger_Purchase\confirm(), and Acc_Ledger\confirm().
static Anc_Plan::test_me | ( | ) | [static] |
Definition at line 203 of file class_anc_plan.php.
References $a, $cn, Anc_Plan(), echo, and id.
{ $cn=new Database(dossier::id()); echo "<h1>Plan analytique : test</h1>"; echo "clean"; $cn->exec_sql("delete from plan_analytique"); $p=new Anc_Plan($cn); echo "<h2>Add</h2>"; $p->name="Nouveau 1"; $p->description="C'est un test"; echo "Add<hr>"; $p->add(); $p->name="Nouveau 2"; $p->add(); $pa_id=$p->id; echo $p->id."/"; $p->name="Nouveau 3"; $p->add(); echo $p->id."/"; $p->name="Nouveau 4"; $p->add(); echo $p->id; echo "<h2>get</h2>"; $p->get(); var_dump($p); echo "<h2>Update</h2> "; $p->name="Update "; $p->description="c'est change"; $p->update(); $p->get(); var_dump($p); echo "<h2>get_list</h2>"; $a=$p->get_list(); var_dump($a); echo "<h2>delete </h2>"; $p->delete(); }
Anc_Plan::update | ( | ) |
Definition at line 87 of file class_anc_plan.php.
References $description, $name, db, name, and sql_string().
{ if ( $this->id==0) return; $name=sql_string($this->name); if ( strlen($name) == 0) return; $description=sql_string($this->description); $this->db->exec_sql("update plan_analytique set pa_name=$1, pa_description=$2 where pa_id=$3",array($name,$description,$this->id)); }
Anc_Plan::$db |
database connection
Definition at line 38 of file class_anc_plan.php.
Anc_Plan::$description |
description of the PA plan_analytique.pa_description
Definition at line 40 of file class_anc_plan.php.
Anc_Plan::$id |
id = plan_analytique.pa_id
Definition at line 41 of file class_anc_plan.php.
Anc_Plan::$name |
name plan_analytique.pa_name
Definition at line 39 of file class_anc_plan.php.