Viewing file: clsDocNoRequest.php (2.93 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include_once "../link/keyThai.php"; class DocNoRequest extends clsDB{
var $result;
var $DnID; var $DocID; var $RegisterID; var $RegisterYear; var $RegisterName; var $DocNo; var $RegisterNo; var $CorrespondenceDate; var $Subject; var $RegisterDate; var $DlcID; var $personId;
function DocNoRequest(&$c){ $this->c=$c->c; $this->DB=$c->db; }
function Save(){ if($this->RegisterDate==''){ $this->RegisterDate='0000-00-00 00:00:00'; }
if ($this->status==1){ $sql = "insert into docnorequest values( '".th2a($this->DnID)."', '".th2a($this->DocID)."', '".th2a($this->RegisterID)."', '".th2a($this->RegisterYear)."', '".th2a($this->RegisterName)."', '".th2a($this->DocNo)."', '".th2a($this->RegisterNo)."', '".th2a($this->CorrespondenceDate)."', '".th2a($this->Subject)."', '".th2a($this->RegisterDate)."', '".th2a($this->DlcID)."', '".th2a($this->personId)."' )"; }else { $sql = "update docnorequest set DocID='".th2a($this->DocID)."', RegisterID='".th2a($this->RegisterID)."', RegisterYear='".th2a($this->RegisterYear)."', RegisterName='".th2a($this->RegisterName)."', DocNo='".th2a($this->DocNo)."', RegisterNo='".th2a($this->RegisterNo)."', CorrespondenceDate='".th2a($this->CorrespondenceDate)."', Subject='".th2a($this->Subject)."', RegisterDate='".th2a($this->RegisterDate)."', DlcID='".th2a($this->DlcID)."', personId='".th2a($this->personId)."' where DnID='".th2a($this->DnID)."'"; } return $this->Dml($sql); }
function Delete(){ return $this->Dml("delete from docnorequest where DnID='$this->DnID'"); } function NumRow(){ return $this->GetRowSelected(); } function GetNextCode(){ $this->SetQuery("select max(DnID) as num from docnorequest"); if ($result=$this->GetResult()) { return $result['num']+1; } }
function RSDocuments(){ $this->SetQuery("select * from docnorequest order by DnID"); }
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->DnID=a2th($this->DnID); $this->DocID=a2th($this->DocID); $this->RegisterID=a2th($this->RegisterID); $this->RegisterYear=a2th($this->RegisterYear); $this->RegisterName=a2th($this->RegisterName); $this->DocNo=a2th($this->DocNo); $this->RegisterNo=a2th($this->RegisterNo); $this->CorrespondenceDate=a2th($this->CorrespondenceDate); $this->Subject=a2th($this->Subject); $this->RegisterDate=a2th($this->RegisterDate); $this->DlcID=a2th($this->DlcID); $this->personId=a2th($this->personId); } 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 docnorequest where DnID= '$xKey'")){ return 1; }else { return 0; } }
}
?>
|