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->DlpId=$this->GetNextCode(); $sql = "insert into docforsign values( '".th2a($this->dfID)."', '".th2a($this->DocID)."', '".th2a($this->DlcID)."', '".th2a($this->DocGroup)."', '".th2a($this->statusGet)."', '".th2a($this->getDate)."', '".th2a($this->DlcIDsign)."', '".th2a($this->DeptSign)."' )"; }else { $sql = "update docforsign set DocID='".th2a($this->DocID)."', DlcID='".th2a($this->DlcID)."', DocGroup='".th2a($this->DocGroup)."', statusGet='".th2a($this->statusGet)."', getDate='".th2a($this->getDate)."', DlcIDsign='".th2a($this->DlcIDsign)."', DeptSign='".th2a($this->DeptSign)."' where dfID='".th2a($this->dfID)."'"; } return $this->Dml($sql); } function Delete(){ return $this->Dml("delete from docforsign where dfID='$this->dfID'"); } function GetNextCode(){ $this->SetQuery("select max(dfID) as num from docforsign"); if ($result=$this->GetResult()) { return $result['num']+1; } } function RSdocforsign(){ $this->SetQuery("select * from docforsign order by dfID"); } 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 docforsign where dfID= '$xKey'")){ return 1; }else { return 0; } } function NumRow(){ return $this->GetRowSelected(); } //****************** You can add new functions below **********************// function SearchDlcIDstatusNoGet($xKey,$yKey,$zKey){ if ($this->SetQuery("select * from docforsign where (DlcID= '$xKey' || DlcID='$zKey') and statusGet='' and DocGroup ='$yKey'")){ return 1; }else { return 0; } } function SearchDlcIDstatusNoGetNum($xKey,$yKey,$zKey){ $this->SetQuery("select count(dfID) as num from docforsign where (DlcID= '$xKey' || DlcID='$zKey') and statusGet='' and DocGroup ='$yKey'"); if ($result=$this->GetResult()) { return $result['num']; } } } //--End class person-- ?>