Plugins  LAST
 All Data Structures Files Functions Variables Pages
Public Member Functions | Static Public Member Functions | Static Private Attributes
Tva_Parameter Class Reference
Collaboration diagram for Tva_Parameter:
Collaboration graph

Public Member Functions

 __construct ($p_init)
 
 get_parameter ($p_string)
 
 set_parameter ($p_string, $p_value)
 
 get_info ()
 
 verify ()
 
 seek ($cond, $p_array=null)
 retrieve * row thanks a condition More...
 
 insert ()
 
 update ()
 
 load ()
 
 exist_pcmn ($p_code)
 check that this accounting does exist in the accounting plan More...
 
 display ()
 show the content of the table tva_belge.parameter More...
 

Static Public Member Functions

static test_me ()
 

Static Private Attributes

static $variable =array("code"=>"pcode","value"=>"pvalue","account"=>'paccount')
 

Detailed Description

Definition at line 32 of file class_tva_parameter.php.

Constructor & Destructor Documentation

Tva_Parameter::__construct (   $p_init)

Definition at line 35 of file class_tva_parameter.php.

35  {
36  $this->cn=$p_init;
37  }

Member Function Documentation

Tva_Parameter::display ( )

show the content of the table tva_belge.parameter

Definition at line 123 of file class_tva_parameter.php.

References $cn, $r, and $res.

123  {
124  global $cn;$cn=$this->cn;
125 
126  $res=$this->cn->get_array("select pcode from tva_belge.parameter");
127 
128  ob_start();
129  require_once('form_parameter.php');
130  $r=ob_get_contents();
131  ob_end_clean();
132  return $r;
133  }
$r
$res
global $cn
Tva_Parameter::exist_pcmn (   $p_code)

check that this accounting does exist in the accounting plan

Parameters
$p_codecode to check
Returns
the number of row found (0 if none)

Definition at line 116 of file class_tva_parameter.php.

116  {
117  $count=$this->cn->get_value('select count(*) from tmp_pcmn where pcm_val::text like $1',array($p_code));
118  return $count;
119  }
Tva_Parameter::get_info ( )

Definition at line 56 of file class_tva_parameter.php.

56 { return var_export(self::$variable,true); }
Tva_Parameter::get_parameter (   $p_string)

Definition at line 38 of file class_tva_parameter.php.

38  {
39  if ( array_key_exists($p_string,self::$variable) ) {
40  $idx=self::$variable[$p_string];
41  return $this->$idx;
42  }
43  else
44  throw new Exception("Attribut inexistant $p_string");
45  }
Tva_Parameter::insert ( )

Definition at line 70 of file class_tva_parameter.php.

References $sql, and verify().

70  {
71  if ( $this->verify() != 0 ) return;
72 
73  $sql="insert into tva_belge.parameter (pcode,pvalue,paccount) ".
74  " values ($1,$2) ";
75  $this->tva_id=$this->cn->exec_sql(
76  $sql,
77  array($this->pcode,
78  $this->pvalue,
79  $this->paccount)
80  );
81 
82  }
$sql
Tva_Parameter::load ( )

Definition at line 98 of file class_tva_parameter.php.

References $res, and $sql.

98  {
99 
100  $sql="select pcode from tva_belge.parameter where pcode=$1";
101 
102  $res=$this->cn->get_array(
103  $sql,
104  array($this->pcode)
105  );
106 
107  if ( count($res) == 0 ) return -1;
108  for ($i=0;$i<count($res);$i++) { $this->pcode=$res[$i]['pcode'];$this->pvalue=$res[$i]['pvalue'];$this->paccount=$res[$i]['paccount']; }
109  return 0;
110  }
$res
$sql
Tva_Parameter::seek (   $cond,
  $p_array = null 
)

retrieve * row thanks a condition

Definition at line 63 of file class_tva_parameter.php.

64  {
65  /*
66  $sql="select * from * where $cond";
67  return $this->cn->get_array($cond,$p_array)
68  */
69  }
Tva_Parameter::set_parameter (   $p_string,
  $p_value 
)

Definition at line 46 of file class_tva_parameter.php.

46  {
47  if ( array_key_exists($p_string,self::$variable) ) {
48  $idx=self::$variable[$p_string];
49  $this->$idx=$p_value;
50  }
51  else
52  throw new Exception("Attribut inexistant $p_string");
53 
54 
55  }
static Tva_Parameter::test_me ( )
static
Parameters
\return
Note
See Also
Todo:

Definition at line 141 of file class_tva_parameter.php.

141  {
142  }
Tva_Parameter::update ( )

Definition at line 84 of file class_tva_parameter.php.

References $res, $sql, and verify().

84  {
85  if ( $this->verify() != 0 ) return;
86 
87  $sql="update tva_belge.parameter set pvalue=$1,paccount=$2 ".
88  " where pcode = $3";
89  $res=$this->cn->exec_sql(
90  $sql,
91  array($this->pvalue,
92  $this->paccount,
93  $this->pcode)
94  );
95 
96  }
$res
$sql
Tva_Parameter::verify ( )

Definition at line 57 of file class_tva_parameter.php.

Referenced by insert(), and update().

57  {
58  // Verify that the elt we want to add is correct
59  }

Field Documentation

Tva_Parameter::$variable =array("code"=>"pcode","value"=>"pvalue","account"=>'paccount')
staticprivate

Definition at line 34 of file class_tva_parameter.php.


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