Viewing file: clsCorrespondenceletter_Ministry.php (3.26 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //--Class correspondenceletter_ministry-------------------------- //--PK of correspondenceletter_ministry :: // 1. mt_ID include_once "../link/keyThai.php"; class correspondenceletter_ministry extends clsDB{
var $result;
var $mt_ID; var $mt_ministry;
function correspondenceletter_ministry(&$c){ $this->c=$c->c; $this->DB=$c->db; }
function Save(){ if ($this->status==1){ //uncomment a line below if your table use ID as running number //$this->DtID=$this->GetNextCode(); $sql = "insert into correspondenceletter_ministry values( '".$this->mt_ID."', '".$this->mt_ministry."' )"; }else { $sql = "update correspondenceletter_ministry set mt_ministry='".$this->mt_ministry."' where mt_ID='".$this->mt_ID."'"; } return $this->Dml($sql); }
function Delete(){ return $this->Dml("delete from correspondenceletter_ministry where mt_ID='$this->mt_ID'"); }
function GetNextCode(){ $this->SetQuery("select max(mt_ID) as num from correspondenceletter_ministry"); if ($result=$this->GetResult()) { return $result['num']+1; } }
function RSdoctype(){ $this->SetQuery("select * from correspondenceletter_ministry order by mt_ID asc"); }
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)."'];"); } 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 correspondenceletter_ministry where mt_ID= '$xKey'")){ return 1; }else { return 0; } } //****************** You can add new functions below **********************// /* function RSdoctypeDtP(){ $this->SetQuery("select * from DocType where DtP!='1' order by DtID asc"); } function RSdoctypeDtRunAll(){ $this->SetQuery("select * from DocType where DtRunAll='Y' order by DtID asc"); } function RSdoctypeDtNoRunAll(){ $this->SetQuery("select * from DocType where DtRunAll='N' order by DtID asc"); } function RSdoctypeDtAll(){ $this->SetQuery("select * from DocType order by DtID asc"); } function RSdoctypeDtAllNoforRegisY(){ $this->SetQuery("select * from DocType where forRegis!='Y' and DtP!=1 order by DtID asc"); } function SearchRepRegisDoc(){ if ($this->SetQuery("select * from DocType where forRegis='Y'")){ return 1; }else { return 0; } } function SearchRepReceiveDoc(){ if ($this->SetQuery("select * from DocType where DtP='0' and DtRunAll='Y' and forRegis!='Y'")){ return 1; }else { return 0; } } function SearchRepReceiveDocName(){ if ($this->SetQuery("select DtID,DtName from DocType where DtP='0' and DtRunAll='Y' and forRegis!='Y'")){ return 1; }else { return 0; } } function SearchRepRegisDocName(){ if ($this->SetQuery("select DtID,DtName from DocType where forRegis='Y'")){ return 1; }else { return 0; } } function RSdoctypeDtNoRunAllName(){ $this->SetQuery("select DtID,DtName from DocType where DtRunAll='N' order by DtID asc"); } function GetDtNameByDtID($DtID){ $this->SetQuery("select DtName as num from DocType where DtID='$DtID'"); if ($result=$this->GetResult()) { return $result['num']; } } */ } //--End class DocType--
?>
|