예제 #1
0
 /**
  *
  */
 public function testFetchChildren()
 {
     $hspPaymentRequest = new HspPaymentRequest();
     $empId = 11;
     $children = $hspPaymentRequest->fetchChildren($empId);
     $this->assertTrue(is_array($children));
     $this->assertEquals(2, count($children));
     $this->assertEquals("saman", $children[0]);
     $this->assertEquals("saman2", $children[1]);
     $empId = 12;
     $children = $hspPaymentRequest->fetchChildren($empId);
     $this->assertFalse(isset($children));
 }
예제 #2
0
 public static function addHspRequestView()
 {
     $year = date('Y');
     $authorizeObj = new authorize($_SESSION['empID'], $_SESSION['isAdmin']);
     $path = "/templates/benefits/editHspPaymentRequest.php";
     $header = "requestHeader.php";
     $empID = $_SESSION['empID'];
     $empName = self::_getEmployeeName($empID);
     $hspPaymentRequest = new HspPaymentRequest();
     $children = $hspPaymentRequest->fetchChildren($empID);
     $dependent = $hspPaymentRequest->fetchDependants($empID);
     $planId = DefineHsp::fetchHsp();
     $planName = DefineHsp::getHspPlanName($planId);
     if (strstr($planName, '+')) {
         $plans = explode('+', $planName);
     } else {
         $plans = $planName;
     }
     $tmpOb[0] = $year;
     $tmpOb[1] = null;
     $tmpOb[2] = 0;
     $tmpOb[3] = null;
     $tmpOb[4] = $authorizeObj;
     $tmpOb[5] = $_SESSION['empID'];
     $tmpOb[6] = $empName;
     $tmpOb[7] = $dependent;
     $tmpOb[8] = $children;
     $tmpOb[9] = $plans;
     $template = new TemplateMerger($tmpOb, $path, $header);
     $template->display();
 }