|
noalyss
Version-6.7.2
|
Class to manage the company parameter (address, name...) More...
Public Member Functions | |
| check (&$p_value) | |
| Own ($p_cn) | |
| save ($p_attr) | |
| save the parameter into the database by inserting or updating | |
| update () | |
| save data | |
Data Fields | |
| $db | |
Class to manage the company parameter (address, name...)
Definition at line 27 of file class_own.php.
| Own::check | ( | &$ | p_value | ) |
Definition at line 45 of file class_own.php.
Referenced by save().
{
if ($p_value == 'MY_STRICT'
&& $this->MY_STRICT != 'Y'
&& $this->MY_STRICT != 'N')
$p_value='N';
$p_value=htmlspecialchars($p_value);
}
| Own::Own | ( | $ | p_cn | ) |
Definition at line 31 of file class_own.php.
References $Res, $row, db, Database\fetch_array(), and Database\num_row().
{
$this->db=$p_cn;
$Res=$p_cn->exec_sql("select * from parameter where pr_id like 'MY_%'");
for ($i = 0;$i < Database::num_row($Res);$i++)
{
$row=Database::fetch_array($Res,$i);
$key=$row['pr_id'];
$elt=$row['pr_value'];
// store value here
$this->{"$key"}=$elt;
}
}
| Own::save | ( | $ | p_attr | ) |
save the parameter into the database by inserting or updating
| $p_attr | give the attribut name |
Definition at line 61 of file class_own.php.
References $Res, $value, check(), and db.
Referenced by update().
{
$this->check($p_attr);
$value=$this->$p_attr;
// check if the parameter does exist
if ( $this->db->get_value('select count(*) from parameter where pr_id=$1',array($p_attr)) != 0 )
{
$Res=$this->db->exec_sql("update parameter set pr_value=$1 where pr_id=$2",
array($value,$p_attr));
}
else
{
$Res=$this->db->exec_sql("insert into parameter (pr_id,pr_value) values( $1,$2)",
array($p_attr,$value));
}
}
| Own::update | ( | ) |
save data
Definition at line 87 of file class_own.php.
References save().
{
$this->save('MY_NAME');
$this->save('MY_TVA');
$this->save('MY_STREET');
$this->save('MY_NUMBER');
$this->save('MY_CP');
$this->save('MY_TEL');
$this->save('MY_PAYS');
$this->save('MY_COMMUNE');
$this->save('MY_FAX');
$this->save('MY_ANALYTIC');
$this->save('MY_STRICT');
$this->save('MY_TVA_USE');
$this->save('MY_PJ_SUGGEST');
$this->save('MY_CHECK_PERIODE');
$this->save('MY_DATE_SUGGEST');
$this->save('MY_ALPHANUM');
$this->save('MY_UPDLAB');
$this->save('MY_STOCK');
}
| Own::$db |
Definition at line 29 of file class_own.php.