c=$c->c; $this->DB=$c->db; $this->dpSet = false; } function Save(){ if ($this->status==1){ $sql = "insert into deptref values( '$this->drId', '$this->deptId', '$this->deptrefId')"; }else { $sql = "update deptref set deptId='$this->deptId', deptrefId='$this->deptrefId' where drId='$this->drId'"; } echo "sql = ".$sql."
"; return $this->Dml($sql); } function GetNextCode(){ $this->SetQuery("select max(drId) as num from deptref"); if ($result=$this->GetResult()) { return $result['num']+1; }else{ return 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; } } //****************** You can add new functions below **********************// function SearchBydeptIddeptrefId($xKey,$yKey){ if ($this->SetQuery("select * from deptref where deptId='$xKey' and deptrefId='$yKey' ")){ return 1; }else { return 0; } } function searchBydeptRefId($xKey){ if ($this->SetQuery("select * from deptref where deptrefId='$xKey'")){ return 1; }else { return 0; } } function searchBydeptId($xKey){ if ($this->SetQuery("select * from deptref where deptId='$xKey'")){ return 1; }else { return 0; } } function deleteDept($xKey){ if ($this->SetQuery("delete from deptref where deptId='$xKey'")){ return 1; }else { return 0; } } } //--End class Person-- ?>