Viewing file: clsumfileupdate.php (5.33 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //--Class Person-------------------------- //--PK of Person :: // 1. personId
class umfileupdate extends clsDB{
var $result;
var $fileId; var $updateDate; var $filename1; var $filename2; var $flagfile; var $flagupdate; var $path; var $detail; var $sysId; var $updatetime; var $flagselect; var $flagrestore; var $flaguse;
function umfileupdate(&$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 umfileupdate values( '$this->fileId', '$this->updateDate', '$this->filename1', '$this->filename2', '$this->flagfile', '$this->flagupdate', '$this->path', '$this->detail', '$this->sysId', '$this->updatetime', '$this->flagselect', '$this->flagrestore', '$this->flaguse' )"; }else { $sql = "update umfileupdate set updateDate='$this->updateDate', filename1='$this->filename1', filename2='$this->filename2', flagfile='$this->flagfile', flagupdate='$this->flagupdate', path='$this->path', detail='$this->detail', sysId='$this->sysId', updatetime='$this->updatetime', flagselect='$this->flagselect', flagrestore='$this->flagrestore', flaguse='$this->flaguse' where fileId='$this->fileId'"; } $this->SetQuery($sql); }
function Delete(){ $this->SetQuery("delete from umfileupdate where fileId='$this->fileId'"); }
function GetNextCode(){ $this->SetQuery("select max(fileId) as num from umfileupdate"); if ($result=$this->GetResult()) { return $result['num']+1; } }
function RSfileupdate(){ $this->SetQuery("select * from umfileupdate order by fileId desc,updateDate desc,updatetime desc"); } function RSfileupdatenotuse(){ $this->SetQuery("select * from umfileupdate where flaguse='N' order by fileId desc,updateDate desc,updatetime desc"); } function RSfileupdatenotuseordertext(){ $this->SetQuery("select * from umfileupdate where flaguse='N' order by filename1"); } function RSfileupdate2(){ $this->SetQuery("select * from umfileupdate where (flaguse='Y' and (flagupdate='U' or flagupdate='D')) order by fileId desc,updateDate desc,updatetime desc"); } function RSfileupdate2path($xKey){ $this->SetQuery("select * from umfileupdate where (flaguse='Y' and (flagupdate='U' or flagupdate='D')) and path='$xKey'order by fileId desc,updateDate desc,updatetime desc"); } function RSfileupdate2pathordertext($xKey){ $this->SetQuery("select * from umfileupdate where (flaguse='Y' and (flagupdate='U' or flagupdate='D')) and path='$xKey'order by filename1"); } function RSfileupdatepath(){ $this->SetQuery("select * from umfileupdate where flaguse='Y' group by path"); } function RSfileupdategroupname(){ $this->SetQuery("SELECT * FROM `umfileupdate` group by filename1,path order by updatetime desc,updateDate desc"); } function RSfileupdategroupname2(){ $this->SetQuery("SELECT * FROM `umfileupdate` group by filename1,path order by fileId"); } function RSfileupdategroupnameordertext(){ $this->SetQuery("SELECT * FROM `umfileupdate` group by filename1,path order by filename1"); } function RSfileupdategroupnameordertext2(){ $this->SetQuery("SELECT * FROM `umfileupdate` group by filename1,path order by fileId"); } function GetRecord(){ if ($this->result = $this->GetResult()) { $this->fileId = $this->result['fileId']; $this->updateDate = $this->result['updateDate']; $this->filename1 = $this->result['filename1']; $this->filename2 = $this->result['filename2']; $this->flagfile = $this->result['flagfile']; $this->flagupdate = $this->result['flagupdate']; $this->path = $this->result['path']; $this->detail = $this->result['detail']; $this->sysId = $this->result['sysId']; $this->updatetime = $this->result['updatetime']; $this->flagselect = $this->result['flagselect']; $this->flagrestore = $this->result['flagrestore']; $this->flaguse = $this->result['flaguse']; return 1; }else { return 0; } }
function SearchByKey($xKey){ if ($this->SetQuery("select * from umfileupdate where fileId= '$xKey'")){ return 1; }else { return 0; } }
function SearchByfileId($xKey){ if ($this->SetQuery("select * from umfileupdate where fileId= '$xKey'")){ return 1; }else { return 0; } } function SearchBynotfileId($xKey,$yKey,$zKey){ if ($this->SetQuery("select * from umfileupdate where fileId!= '$xKey' and path='$zKey' and filename1='$yKey' order by updatetime desc,updateDate desc")){ return 1; }else { return 0; } } function SearchByfilename1anduse($xKey,$zKey){ if ($this->SetQuery("select * from umfileupdate where filename1= '$xKey' and flaguse='Y' and path='$zKey'")){ return 1; }else { return 0; } } function countnodir(){ $this->SetQuery("select count(flagupdate) as num from umfileupdate where flagupdate ='D'"); $result = $this->GetResult(); return $result['num']; }
function NumRow(){ return $this->GetRowSelected(); }
function Destroy(){ return $this->DestroyDb(); } function SearchByflagupdateD(){ if ($this->SetQuery("select * from umfileupdate where flagupdate ='D' order by updatetime desc,updateDate desc")){ return 1; }else { return 0; } } function SearchByflagupdateD2(){ if ($this->SetQuery("select * from umfileupdate where flagupdate ='D' order by fileId")){ return 1; }else { return 0; } } //****************** You can add new functions below **********************//
} //--End class base_Room--
?>
|