Viewing file: clsOfficer.php (2.57 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//--Class Officer--------------------------
include_once "clsbase_Officer.php";
class Officer extends base_Officer{
function RSOfficerLimit($start, $pageSize){
$this->SetQuery("select * from Officer order by officerName limit $start, $pageSize");
}
function SearchByOfficerCode($xKey){
if ($this->SetQuery("select * from rg_Person where prsUsId='$xKey'")){
return 1;
}else {
return 0;
}
}
function RSOfficerByOfCodeAndNmAndSn($xKey, $yKey, $zKey){
$this->SetQuery("select * from Officer where officerCode like '%$xKey%' and officerName like '%$yKey%' and officerSurname like '%$zKey%' order by officerName");
}
function SearchByOfCodeOfNOfSn($OfC, $OfN, $OfSn){
$this->SetQuery("select * from Officer where officerCode='$OfC' or officerName='$OfN' or officerSurname='$OfSn'");
}
function RSOfficerByOgIdAndDebtUDAuthorityIsY($xKey){
$this->SetQuery("select * from Officer where organId='$xKey' and debtUDAuthority='Y'");
}
// ***** Start TIMETABLE *****
function RSOfficerOrderNmAndSn(){
$this->SetQuery("select * from ".$GLOBALS["PPC_DBNAME"].".Person, ".$GLOBALS["EREGIS_DBNAME"].".rg_Person, ".$GLOBALS["EREGIS_DBNAME"].".rg_FStatusInPs where fipPsId=1 and fipFStatus=fStatus and personId=prsUsId order by fName, lName");
}
// ***** End TIMETABLE *****
function RSOfficerOrderNmAndSnLimit($start, $pageSize){
$this->SetQuery("select * from Officer where officerStatus=1 order by officerName, officerSurname
limit $start, $pageSize");
}
function qryPrsJoinRG($prsId) {
$sql = "SELECT * FROM (
SELECT prs.*,
'' AS psoutId,
ps.personId AS personId,
ps.personCode AS personCode,
pf.prefixName AS prefixName,
ps.fName AS fName,
ps.lName AS lName
FROM ".$GLOBALS["PPC_DBNAME"].".Person ps
INNER JOIN ".$GLOBALS["PPC_DBNAME"].".Prefix pf ON ps.prefixId = pf.prefixId
LEFT JOIN ".$GLOBALS["EREGIS_DBNAME"].".rg_Person prs ON ps.personId = prsUsId
WHERE prsItId = 1
UNION
SELECT prs.*,
pso.psoutId AS psoutId,
'' AS personId,
'' AS personCode,
pfo.prefixName AS prefixName,
pso.fName AS fName,
pso.lName AS lName
FROM ".$GLOBALS["PPC_DBNAME"].".Personout pso
INNER JOIN ".$GLOBALS["PPC_DBNAME"].".Prefix pfo ON pso.prefixId = pfo.prefixId
LEFT JOIN ".$GLOBALS["EREGIS_DBNAME"].".rg_Person prs ON pso.psoutId = prsUsId
WHERE prsItId = 2
) AS tb
WHERE prsId ='$prsId' ";
$this->SetQuery($sql);
}
} //--End class Officer--
?>
|