/** * This function get a database resource as the input and creates a HSP objects array * containing the data of the resource. */ private static function _buildSummaryObjects($result) { $dbConnection = new DMLFunctions(); $hspObjArr = null; while ($row = $dbConnection->dbObject->getArray($result)) { $hspObj = new Hsp(); $empName = EmpInfo::getFullName($row[1]); if (isset($empName)) { // For excluding deleted employees $hspObj->setSummaryId($row[0]); $hspObj->setEmployeeId($row[1]); $hspObj->setHspPlanId($row[2]); $hspObj->setHspPlanName(DefineHsp::getHspPlanName($row[2])); $hspObj->setEmployeeName($empName); $hspObj->setHspPlanYear($row[3]); $hspObj->setHspPlanStatus($row[4]); $hspObj->setAnnualLimit($row[5]); $hspObj->setEmployerAmount($row[6]); $hspObj->setEmployeeAmount($row[7]); $hspObj->setTotalAccrued($row[8]); $hspObj->setTotalUsed($row[9]); $currentHspPlan = Config::getHspCurrentPlan(); if ($currentHspPlan == 3 || $currentHspPlan == 4 || $currentHspPlan == 5) { // If FSA is avaialbe in current plan if ($row[2] == 3) { $hspObj->setFsaBalance(self::_fetchLastYearFsaBalance($row[1], $row[3] - 1)); } else { $hspObj->setFsaBalance("NA"); } } $hspObjArr[] = $hspObj; } } return $hspObjArr; }
public static function viewHspRequestView($id, $edit = false) { $year = date('Y'); $authorizeObj = new authorize($_SESSION['empID'], $_SESSION['isAdmin']); $path = "/templates/benefits/editHspPaymentRequest.php"; $request = HspPaymentRequest::getHspRequest($id); $empID = $_SESSION['empID']; $planId = $request->getHspId(); $planName = DefineHsp::getHspPlanName($planId); $tmpOb[0] = $year; $tmpOb[1] = null; if ($edit) { $tmpOb[2] = 1; } else { $tmpOb[2] = 2; } $tmpOb[3] = $request; $tmpOb[4] = $authorizeObj; $tmpOb[5] = $_SESSION['empID']; $tmpOb[6] = $id; $tmpOb[9] = $planName; $template = new TemplateMerger($tmpOb, $path); $template->display(); }