Viewing file: clsDocReceiveSend.php (5.37 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//--Class docreceivesend--------------------------
//--PK of docreceivesend ::
// 1. DrsID
class DocReceiveSend extends clsDB{
var $result;
var $DrsID;
var $DocID;
var $DlcID;
var $DsID;
var $personId;
var $PtID;
var $DrsDocTypeNo;
var $DrsReceiveDate;
var $DrsReceivePersonId;
var $DrsSendDate;
var $DrsSendPersonId;
var $DrsSendDlcID;
var $DrsDocDueDate;
var $DrsDlcIDCreate;
var $DrsPsIDCreate;
var $DrsPropose;
var $DrsSign;
var $DrsFromDrsID;
var $DocGroup;
var $DrsflagRead;
var $DrsByPass;
var $DrsSend;
var $DrsSendToPs;
var $DrsDelete;
var $DrsMainPs;
var $AnID;
var $DrsDocReceiveDate;
var $DocRefAnsDate;
var $DrsSendDocNew;
var $DrsInboxID;
var $DrsstartDatePost;
var $DrsendDatePost;
var $DrsSendBack;
var $DrsSendBackDlcID;
var $DrsfSendBack;
function DocReceiveSend(&$c){
$this->c=$c->c;
$this->DB=$c->db;
}
function Save(){
if ($this->status==1){
$sql = "insert into DocReceiveSend values(
'".th2a($this->DrsID)."',
'".th2a($this->DocID)."',
'".th2a($this->DlcID)."',
'".th2a($this->DsID)."',
'".th2a($this->personId)."',
'".th2a($this->PtID)."',
'".th2a($this->DrsDocTypeNo)."',
'".th2a($this->DrsReceiveDate)."',
'".th2a($this->DrsReceivePersonId)."',
'".th2a($this->DrsSendDate)."',
'".th2a($this->DrsSendPersonId)."',
'".th2a($this->DrsSendDlcID)."',
'".th2a($this->DrsDocDueDate)."',
'".th2a($this->DrsDlcIDCreate)."',
'".th2a($this->DrsPsIDCreate)."',
'".th2a($this->DrsPropose)."',
'".th2a($this->DrsSign)."',
'".th2a($this->DrsFromDrsID)."',
'".th2a($this->DocGroup)."',
'".th2a($this->DrsflagRead)."',
'".th2a($this->DrsByPass)."',
'".th2a($this->DrsSend)."',
'".th2a($this->DrsSendToPs)."',
'".th2a($this->DrsDelete)."',
'".th2a($this->DrsMainPs)."',
'".th2a($this->AnID)."',
'".th2a($this->DrsDocReceiveDate)."',
'".th2a($this->DocRefAnsDate)."',
'".th2a($this->DrsSendDocNew)."',
'".th2a($this->DrsInboxID)."',
'".th2a($this->DrsstartDatePost)."',
'".th2a($this->DrsendDatePost)."',
'".th2a($this->DrsSendBack)."',
'".th2a($this->DrsSendBackDlcID)."',
'".th2a($this->DrsfSendBack)."'
)";
}else {
$sql = "update DocReceiveSend set
DocID='".th2a($this->DocID)."',
DlcID='".th2a($this->DlcID)."',
DsID='".th2a($this->DsID)."',
personId='".th2a($this->personId)."',
PtID='".th2a($this->PtID)."',
DrsDocTypeNo='".th2a($this->DrsDocTypeNo)."',
DrsReceiveDate='".th2a($this->DrsReceiveDate)."',
DrsReceivePersonId='".th2a($this->DrsReceivePersonId)."',
DrsSendDate='".th2a($this->DrsSendDate)."',
DrsSendPersonId='".th2a($this->DrsSendPersonId)."',
DrsSendDlcID='".th2a($this->DrsSendDlcID)."',
DrsDocDueDate='".th2a($this->DrsDocDueDate)."',
DrsDlcIDCreate='".th2a($this->DrsDlcIDCreate)."',
DrsPsIDCreate='".th2a($this->DrsPsIDCreate)."',
DrsPropose='".th2a($this->DrsPropose)."',
DrsSign='".th2a($this->DrsSign)."',
DrsFromDrsID='".th2a($this->DrsFromDrsID)."',
DocGroup='".th2a($this->DocGroup)."',
DrsflagRead='".th2a($this->DrsflagRead)."',
DrsByPass='".th2a($this->DrsByPass)."',
DrsSend='".th2a($this->DrsSend)."',
DrsSendToPs='".th2a($this->DrsSendToPs)."',
DrsDelete='".th2a($this->DrsDelete)."',
DrsMainPs='".th2a($this->DrsMainPs)."',
AnID='".th2a($this->AnID)."',
DrsDocReceiveDate='".th2a($this->DrsDocReceiveDate)."',
DocRefAnsDate='".th2a($this->DocRefAnsDate)."',
DrsSendDocNew='".th2a($this->DrsSendDocNew)."',
DrsInboxID='".th2a($this->DrsInboxID)."',
DrsstartDatePost='".th2a($this->DrsstartDatePost)."',
DrsendDatePost='".th2a($this->DrsendDatePost)."',
DrsSendBack='".th2a($this->DrsSendBack)."',
DrsSendBackDlcID='".th2a($this->DrsSendBackDlcID)."',
DrsfSendBack='".th2a($this->DrsfSendBack)."'
where DrsID='".th2a($this->DrsID)."'";
//echo "----------".$sql.'<br>';
}
return $this->Dml($sql);
}
function Delete(){
return $this->Dml("delete from DocReceiveSend where DrsID='$this->DrsID'");
}
function NumRow(){
return $this->GetRowSelected();
}
function GetNextCode(){
$this->SetQuery("select max(DrsID) as num from DocReceiveSend");
if ($result=$this->GetResult()) {
return $result['num']+1;
}
}
function RSDocReceiveSend(){
$this->SetQuery("select * from DocReceiveSend order by DrsID");
}
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->DrsPropose=a2th($this->DrsPropose);
$this->DrsSign=a2th($this->DrsSign);
$this->DrsSendBack=a2th($this->DrsSendBack);
}
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 DocReceiveSend where DrsID= '$xKey'")){
return 1;
}else {
return 0;
}
}
//****************** You can add new functions below **********************//
function SearchCountPsDoc($xKey){
$this->SetQuery("select count(personId) as num from DocReceiveSend where personId='$xKey'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
} //--End class docreceivesend--
?>
|