Viewing file: clsQuarterCollege.php (1.87 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include_once "../link/keyThai.php"; class quarterCollege extends clsDB{
var $result; var $qCID; var $quarterName; var $orderID;
function quarterCollege(&$c){ $this->c=$c->c; $this->DB=$c->db; } function AddNew(){ $this->status = 1; }
function Edit(){ $this->status = 2; }
function Save(){ if ($this->status==1){ $sql = "insert into quartercollege values( '".th2a($this->qCID)."', '".th2a($this->quarterName)."', '".th2a($this->orderID)."' )"; }else { $sql = "update quartercollege set quarterName='".th2a($this->quarterName)."', orderID='".th2a($this->orderID)."' where qCID='".th2a($this->qCID)."'"; } return $this->Dml($sql); }
function Delete(){ return $this->Dml("delete from quartercollege where qCID='$this->qCID'"); }
function GetNextCode(){ $this->SetQuery("select max(qCID) as num from quartercollege"); if ($result=$this->GetResult()) { return $result['num']+1; } }
function RSquarterCollege(){ $this->SetQuery("select * from quartercollege order by orderID 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)."'];"); $this->collegeUnderName=a2th($this->collegeUnderName); } 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 quartercollege where qCID= '$xKey'")){ return 1; }else { return 0; } } function SearchByKeylimit(){ if ($this->SetQuery("select * from quartercollege order by qCID asc limit 1")){ return 1; }else { return 0; } } //****************** You can add new functions below **********************// } //--End class base_DocSpeedLevel-- ?>
|