Viewing file: clsPerson.php (8.67 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //--Class Person-------------------------- //--PK of Person :: // 1. personId
class Person extends clsDB{
var $result;
var $personId; var $prefixId; var $fName; var $lName; var $receiveDate; var $pId; var $adlineId; var $adminposId; var $hireId; var $majortypeId; var $levelposId; var $stepSal; var $salary; var $partyId; var $deptId; var $majorId; var $assignId; var $promoteDate; var $educDate; var $posDate; var $fullsalDate; var $typemoveId; var $fyDecor; var $lastDecor; var $fRetire; var $adminId; var $done; var $accountNo; var $useSalary; var $personCode; var $oldpersonCode; var $admidYear; var $partyAtId; var $partypracticeId; var $firstadmidDate; var $posDegree; var $posEducmajor; var $enterType; var $fStatus; var $salary2; var $fullStep; var $levelposId2; var $stepSal2; var $useSalary2;
function Person(&$c){ $this->c=$c->c; $this->DB=$c->db; $this->dpSet = false; $this->departmentId = 0; } function Save(){ if ($this->status==1){ $sql = "insert into Person values( '$this->personId', '$this->prefixId', '$this->fName', '$this->lName', '$this->receiveDate', '$this->pId', '$this->adlineId', '$this->adminposId', '$this->hireId', '$this->majortypeId', '$this->levelposId', '$this->stepSal', '$this->salary', '$this->partyId', '$this->deptId', '$this->majorId', '$this->assignId', '$this->promoteDate', '$this->educDate', '$this->posDate', '$this->fullsalDate', '$this->typemoveId', '$this->fyDecor', '$this->lastDecor', '$this->fRetire', '$this->adminId', '$this->done', '$this->accountNo', '$this->useSalary', '$this->personCode', '$this->oldpersonCode', '$this->admidYear', '$this->partyAtId', '$this->partypracticeId', '$this->firstadmidDate', '$this->posDegree', '$this->posEducmajor', '$this->enterType', '$this->fStatus', '$this->salary2', '$this->fullStep', '$this->levelposId2', '$this->stepSal2', '$this->useSalary2' )"; }else { $sql = "update Person set prefixId='$this->prefixId', fName='$this->fName', lName='$this->lName', receiveDate='$this->receiveDate', pId='$this->pId', adlineId='$this->adlineId', adminposId='$this->adminposId', hireId='$this->hireId', majortypeId='$this->majortypeId', levelposId='$this->levelposId', stepSal='$this->stepSal', salary='$this->salary', partyId='$this->partyId', deptId='$this->deptId', majorId='$this->majorId', assignId='$this->assignId', promoteDate='$this->promoteDate', educDate='$this->educDate', posDate='$this->posDate', fullsalDate='$this->fullsalDate', typemoveId='$this->typemoveId', fyDecor='$this->fyDecor', lastDecor='$this->lastDecor', fRetire='$this->fRetire', adminId='$this->adminId', done='$this->done', accountNo='$this->accountNo', useSalary='$this->useSalary', personCode='$this->personCode', oldpersonCode='$this->oldpersonCode', admidYear='$this->admidYear', partyAtId='$this->partyAtId', partypracticeId='$this->partypracticeId', firstadmidDate='$this->firstadmidDate', posDegree='$this->posDegree', posEducmajor='$this->posEducmajor', enterType='$this->enterType', fStatus='$this->fStatus', salary2='$this->salary2', fullStep='$this->fullStep', levelposId2='$this->levelposId2', stepSal2='$this->stepSal2', useSalary2='$this->useSalary2' where personId='$this->personId'"; } //echo "sql = ".$sql."<br>"; return $this->Dml($sql); } function RSPerson(){ $this->dpSet = false; $this->SetQuery("select * from Person order by personId"); }
function RSDPPerson($Pdb, $Edb){ $this->dpSet = true; $this->SetQuery("select Person.*, department.departmentId from $Pdb.Person, $Edb.department where department.departmentMapId = Person.deptId and Person.fStatus = '1' order by Person.personId"); } function RSPersonf1(){ // $this->dpSet = false; $this->SetQuery("select * from Person where fStatus = 1 order by personId asc"); }
function GetRecord(){ if ($this->result = $this->GetResult()) { $this->personId = $this->result['personId']; $this->prefixId = $this->result['prefixId']; $this->fName = $this->result['fName']; $this->lName = $this->result['lName']; $this->receiveDate = $this->result['receiveDate']; $this->pId = $this->result['pId']; $this->adlineId = $this->result['adlineId']; $this->adminposId = $this->result['adminposId']; $this->hireId = $this->result['hireId']; $this->majortypeId = $this->result['majortypeId']; $this->levelposId = $this->result['levelposId']; $this->stepSal = $this->result['stepSal']; $this->salary = $this->result['salary']; $this->partyId = $this->result['partyId']; $this->deptId = $this->result['deptId']; $this->majorId = $this->result['majorId']; $this->assignId = $this->result['assignId']; $this->promoteDate = $this->result['promoteDate']; $this->educDate = $this->result['educDate']; $this->posDate = $this->result['posDate']; $this->fullsalDate = $this->result['fullsalDate']; $this->typemoveId = $this->result['typemoveId']; $this->fyDecor = $this->result['fyDecor']; $this->lastDecor = $this->result['lastDecor']; $this->fRetire = $this->result['fRetire']; $this->adminId = $this->result['adminId']; $this->done = $this->result['done']; $this->accountNo = $this->result['accountNo']; $this->useSalary = $this->result['useSalary']; $this->personCode = $this->result['personCode']; $this->oldpersonCode = $this->result['oldpersonCode']; $this->admidYear = $this->result['admidYear']; $this->partyAtId = $this->result['partyAtId']; $this->partypracticeId = $this->result['partypracticeId']; $this->firstadmidDate = $this->result['firstadmidDate']; $this->posDegree = $this->result['posDegree']; $this->posEducmajor = $this->result['posEducmajor']; $this->enterType = $this->result['enterType']; $this->fStatus = $this->result['fStatus']; $this->salary2 = $this->result['salary2']; $this->fullStep = $this->result['fullStep']; $this->levelposId2 = $this->result['levelposId2']; $this->stepSal2 = $this->result['stepSal2']; $this->useSalary2 = $this->result['useSalary2']; if ($this->dpSet) $this->departmentId = $this->result['departmentId']; return 1; }else { return 0; } }
function SearchByKey($xKey){ if ($this->SetQuery("select * from Person where personId= '$xKey' order by personId asc")){ return 1; }else { return 0; } } function Deleteps($xKey){ return $this->Dml("delete from Person where personId= '$xKey'"); } function RSAllperson(){ $this->SetQuery("select * from Person order by personId asc"); } function GetNextCode(){ $this->SetQuery("select max(personId) as num from Person"); if ($result=$this->GetResult()) { return $result['num']+1; }else{ return 1; } } function SearchfNamelName($xKey,$yKey){ if ($this->SetQuery("select * from Person where (fName ='$xKey' and lName = '$yKey') order by personId asc")){ return 1; }else { return 0; } } function SearchByName($xKey){ if ($this->SetQuery("select * from Person where (fName like '%$xKey%' or lName like '%$xKey%') order by personId asc")){ return 1; }else { return 0; } } function RSPersonf1dept($xKey){ $this->dpSet = false; $this->SetQuery("select * from Person where fStatus = 1 and deptId='$xKey' order by adminId asc, fName asc"); } function SearchByNodeptNamedocGroup($xKey){ if ($this->SetQuery("SELECT fName, lName, personId, prefixId, adminId, hireId FROM Person WHERE deptId NOT IN ( SELECT deptId FROM Department WHERE deptDate IN ( SELECT max( deptDate ) FROM Department ) ) ")){ return 1; }else { return 0; } } function SearchCountByNodeptNamedocGroup($xKey){ $this->SetQuery("SELECT count(personId) as num FROM Person WHERE deptId NOT IN ( SELECT deptId FROM Department WHERE deptDate IN ( SELECT max( deptDate ) FROM Department ) )"); if ($result=$this->GetResult()) { return $result['num']; } } function SearchCountByNodeptNamedocGroup2($xKey){ echo "select count(b.personId) as num from Department a inner join Person b on ((b.deptId=a.deptId and a.deptDate!='$xKey' and b.deptId!='0') || (b.deptId='0' and b.deptId!=a.deptId)) and b.fStatus='1'"; $this->SetQuery("select count(b.personId) as num from Department a inner join Person b on ((b.deptId=a.deptId and a.deptDate!='$xKey' and b.deptId!='0') || (b.deptId='0' and b.deptId!=a.deptId)) and b.fStatus='1'"); if ($result=$this->GetResult()) { return $result['num']; } } //****************** You can add new functions below **********************//
} //--End class Person--
?>
|