Viewing file: clsbackupDoc.php (1.6 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //--Class base_ProposeType-------------------------- //--PK of base_ProposeType :: // 1. PtID
include_once "../link/keyThai.php"; class backupDoc extends clsDB{
var $result;
var $expireDate; var $yearDoc;
function backupDoc(&$c){ $this->c=$c->c; $this->DB=$c->db; }
function Save(){ if ($this->status==1){ $sql = "insert into backupDoc values('".th2a($this->expireDate)."', '".th2a($this->yearDoc)."')"; }else { $sql = "update backupDoc set yearDoc='".th2a($this->yearDoc)."', expireDate='".th2a($this->expireDate)."'"; } return $this->Dml($sql); }
function Delete(){ return $this->Dml("delete from backupDoc where expireDate='$this->expireDate'"); }
function GetNextCode(){ $this->SetQuery("select max(expireDate) as num from backupDoc"); if ($result=$this->GetResult()) { return $result['num']+1; } }
function RSbackupDoc(){ $this->SetQuery("select * from backupDoc order by expireDate"); }
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->yearDoc=a2th($this->yearDoc); } 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 backupDoc where expireDate= '$xKey'")){ return 1; }else { return 0; } } //****************** You can add new functions below **********************// } //--End class base_DocSpeedLevel-- ?>
|