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