Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

parm_code Class Reference

Manage the table parm_code which contains the custom parameter for the module accountancy. More...


Public Member Functions

 parm_code ($p_cn, $p_id=-1)
 LoadAll ()
 Load all parmCode return an array of parm_code object.
 Save ()
 update a parm_object into the database p_code is _not_ updatable
 Display ()
 Display an object, with the

tag.

 Input ()
 Display a form to enter info about a parm_code object with the

tag.

 Get ()
 Complete a parm_code object thanks the p_code.

Data Fields

 $db
 $p_code
 $p_value
 $p_comment


Detailed Description

Manage the table parm_code which contains the custom parameter for the module accountancy.

Definition at line 30 of file class_parm_code.php.


Constructor & Destructor Documentation

parm_code::parm_code p_cn,
p_id = -1
 

Definition at line 36 of file class_parm_code.php.

References $p_id, and Get().

Referenced by LoadAll().

00037     {
00038       $this->db=$p_cn;
00039       $this->p_code=$p_id;
00040       if ( $p_id != -1 )
00041         $this->Get();
00042     }


Member Function Documentation

parm_code::Display  ) 
 

Display an object, with the

tag.

Returns:
string

Definition at line 96 of file class_parm_code.php.

References $r.

00097     {
00098       $r="";
00099       $r.= '<TD>'.$this->p_code.'</TD>';
00100       $r.= '<TD>'.$this->p_comment.'</TD>';
00101       $r.= '<TD>'.$this->p_value.'</TD>';
00102 
00103       return $r;
00104     }

parm_code::Get  ) 
 

Complete a parm_code object thanks the p_code.

Returns:
array

Definition at line 141 of file class_parm_code.php.

References $Res, $row, $sql, ExecSql(), p_comment, and p_value.

Referenced by parm_code().

00141                  {
00142     if ( $this->p_code == -1 ) return "p_code non initialisé";
00143     $sql=sprintf("select * from parm_code where p_code='%s' ",
00144                  $this->p_code);
00145     $Res=ExecSql($this->db,$sql);
00146 
00147     if ( pg_NumRows($Res) == 0 ) return 'INCONNU';
00148     $row= pg_fetch_array($Res,0);
00149     $this->p_value=$row['p_value'];
00150     $this->p_comment=$row['p_comment'];
00151 
00152   }

parm_code::Input  ) 
 

Display a form to enter info about a parm_code object with the

tag.

Returns:
string

Definition at line 112 of file class_parm_code.php.

References $comment, $poste, $r, p_comment, and p_value.

00113     {
00114       $comment=new widget("text");
00115       $comment->name='p_comment';
00116       $comment->value=$this->p_comment;
00117       $value=new widget("text");
00118       $value->name='p_value';
00119       $value->value=$this->p_value;
00120       $poste=new widget("text");
00121       $poste->SetReadOnly(true);
00122       $poste->name='p_code';
00123       $poste->value=$this->p_code;
00124       $r="";
00125       $r.= '<TD>'.$poste->IOValue().'</TD>';
00126       $r.= '<TD>'.$comment->IOValue().'</TD>';
00127       $r.= '<TD>'.$value->IOValue().'</TD>';
00128 
00129       return $r;
00130       
00131     }

parm_code::LoadAll  ) 
 

Load all parmCode return an array of parm_code object.

Returns:
array

Definition at line 52 of file class_parm_code.php.

References $array, $idx, $o, $r, $Res, $sql, ExecSql(), and parm_code().

00052                      {
00053     $sql="select * from parm_code order by p_code";
00054     $Res=ExecSql($this->db,$sql);
00055     $r= pg_fetch_all($Res);
00056     $idx=0;
00057     $array=array();
00058 
00059     if ( $r === false ) return null;
00060     foreach ($r as $row )
00061       {
00062         $o=new parm_code($this->db,$row['p_code']);
00063         $array[$idx]=$o;
00064         $idx++;
00065       }
00066     
00067     return $array;
00068   }

parm_code::Save  ) 
 

update a parm_object into the database p_code is _not_ updatable

Returns:
nothing

Definition at line 76 of file class_parm_code.php.

References $Res, $sql, ExecSql(), FormatString(), p_comment, and p_value.

00077     {
00078       // if p_code=="" nothing to save
00079       if ( $this->p_code== -1) return;
00080       $this->p_comment=FormatString($this->p_comment);
00081       $this->p_value=FormatString($this->p_value);
00082       $this->p_code=FormatString($this->p_code);
00083       $sql="update parm_code set ".
00084         "p_comment='".$this->p_comment."'  ".
00085         ",p_value='".$this->p_value."'  ".
00086         "where p_code='".$this->p_code."'";
00087       $Res=ExecSql($this->db,$sql);
00088     }


Field Documentation

parm_code::$db
 

database connection

Definition at line 31 of file class_parm_code.php.

parm_code::$p_code
 

parm_code.p_code primary key

Definition at line 32 of file class_parm_code.php.

parm_code::$p_comment
 

parm_code.p_comment

Definition at line 34 of file class_parm_code.php.

parm_code::$p_value
 

parm_code.p_value

Definition at line 33 of file class_parm_code.php.


The documentation for this class was generated from the following file: