Viewing file: clsSysConfig.php (2.36 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//--Class sysconfig--------------------------
//--PK of sysconfig ::
include_once "../link/keyThai.php";
class sysConfig extends clsDB{
var $result;
var $sysYear;
var $sysDocNo;
var $editRunningPsId;
var $OutputThai;
var $InputThai;
var $filesizebyte;
var $pbriHost;
function sysConfig(&$c){
$this->c=$c->c;
$this->DB=$c->db;
}
function Save(){
if ($this->status==1){
$sql = "insert into SysConfig values(
'".th2a($this->sysYear)."',
'".th2a($this->sysDocNo)."',
'".th2a($this->editRunningPsId)."',
'".th2a($this->OutputThai)."',
'".th2a($this->InputThai)."',
'".$this->filesizebyte."',
'".$this->pbriHost."'
)";
}else {
$sql = "update SysConfig set
sysYear='".th2a($this->sysYear)."',
sysDocNo='".th2a($this->sysDocNo)."',
editRunningPsId='".th2a($this->editRunningPsId)."',
OutputThai='".th2a($this->OutputThai)."',
InputThai='".th2a($this->InputThai)."',
filesizebyte='".$this->filesizebyte."',
pbriHost='".$this->pbriHost."'";
}
return $this->Dml($sql);
}
function Delete(){
return $this->Dml("delete from SysConfig");
}
function RSsysConfig(){
$this->SetQuery("select * from SysConfig");
}
function GetRecord(){
$numFields = $this->NumField();
$row = $this->GetResult();
if ($row){
for ($i=0; $i<$numFields; $i++){
eval("\$this->".mysql_field_name($this->rs, $i)."=\$row['".mysql_field_name($this->rs, $i)."'];");
$this->sysDocNo=a2th($this->sysDocNo);
}
return true;
}else{ // clear value of Member;
for ($i=0; $i<$numFields; $i++){
eval("\$this->".mysql_field_name($this->rs, $i)."='';");
}
return false;
}
}
function SearchByKey($xKey){
if ($this->SetQuery("select * from SysConfig")){
return 1;
}else {
return 0;
}
}
//****************** You can add new functions below **********************//
function SearchBysysYear(){
$this->SetQuery("select sysYear as num from SysConfig");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function SearchByeditRunningPsId(){
$this->SetQuery("select editRunningPsId as num from SysConfig");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function SearchByInputThai(){
$this->SetQuery("select InputThai as num from SysConfig");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
} //--End class person--
?>
|