Viewing file: clsCorrespondenceletter_Department.php (2.42 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //--Class correspondenceletter_department-------------------------- //--PK of correspondenceletter_department :: // 1. dm_ID include_once "../link/keyThai.php"; class correspondenceletter_department extends clsDB{
var $result;
var $dm_ID; var $dm_department; var $dmUse;
function correspondenceletter_department(&$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_department values( '".$this->dm_ID."', '".$this->dm_department."', '".$this->dmUse."' )"; }else { $sql = "update correspondenceletter_department set dm_department='".$this->dm_department."', dmUse='".$this->dmUse."' where dm_ID='".$this->dm_ID."'"; } return $this->Dml($sql); } function RScorrespondenceletter_department_Y(){ $this->SetQuery("select * from correspondenceletter_department where dmUse='Y' order by dm_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_department where dm_ID= '$xKey'")){ return 1; }else { return 0; } } /* function Delete(){ return $this->Dml("delete from correspondenceletter_department where dm_ID='$this->dm_ID'"); }
function GetNextCode(){ $this->SetQuery("select max(dm_ID) as num from correspondenceletter_department"); if ($result=$this->GetResult()) { return $result['num']+1; } }
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_department where dm_ID= '$xKey'")){ return 1; }else { return 0; } }*/ } //--End class DocType--
?>
|