Пример #1
0
 public function saveExemptionMaster($GET)
 {
     $fromDate = new DateTime($GET['fromDate']);
     $toDate = new DateTime($GET['toDate']);
     $exemption = new Exemption();
     $exemption->setDated(date('Y-m-d H:i:s'));
     $exemption->setFromDateRange($fromDate->format('Y-m-d H:i:s'));
     $exemption->setToDateRange($toDate->format('Y-m-d H:i:s'));
     $exemption->setFolderSeq($GET['stationsSelect']);
     $exemption->setComments($GET['comments']);
     $exemption->setIsExemption(false);
     if ($GET['isExemption'] == "on") {
         $exemption->setIsExemption(true);
     }
     $EDS = ExemptionDataStore::getInstance();
     $lastId = $EDS->SaveExemptionMaster($exemption);
     $chNosArr = $GET['channelNos'];
     if ($chNosArr != null) {
         foreach ($chNosArr as $key => $val) {
             $exemptionDetail = new ExemptionDetail();
             $exemptionDetail->setExemptionSeq($lastId);
             $exemptionDetail->setChannelNumber($val);
             $EDS->SaveExemptionDetail($exemptionDetail);
         }
     }
     return array("RESPONSE" => "SUCCESS");
 }
Пример #2
0
 private static function saveExemption($GET)
 {
     $fromDate = new DateTime($GET['fromDate']);
     $toDate = new DateTime($GET['toDate']);
     $exemption = new Exemption();
     $exemption->setDated(date('Y-m-d H:i:s'));
     $exemption->setFromDateRange($fromDate->format('Y-m-d H:i:s'));
     $exemption->setToDateRange($toDate->format('Y-m-d H:i:s'));
     $exemption->setFolderSeq($GET['stationsSelect']);
     $exemption->setIsExemption(true);
     $EDS = ExemptionDataStore::getInstance();
     $lastId = $EDS->SaveExemptionMaster($exemption);
     $chNo = $GET['pollutantSelect'];
     $exemptionDetail = new ExemptionDetail();
     $exemptionDetail->setExemptionSeq($lastId);
     $exemptionDetail->setChannelNumber($chNo);
     $EDS->SaveExemptionDetail($exemptionDetail);
     return array("RESPONSE" => "SUCCESS");
 }
Пример #3
0
 public static function populateObject($row)
 {
     $exemption = new Exemption();
     $exemption->setSeq($row['seq']);
     $exemption->setFolderSeq($row['folderseq']);
     $exemption->setFolderName($row['foldername']);
     $exemption->setDated($row['dated']);
     $exemption->setFromDateRange($row['fromdate']);
     $exemption->setToDateRange($row['todate']);
     $exemption->setUserSeq($row['userseq']);
     $approved = "pending";
     if ($row['isapproved'] == '1') {
         $approved = "Yes";
     } else {
         if ($row['isapproved'] == '0') {
             $approved = "No";
         }
     }
     $exemption->setIsApproved($approved);
     $exemption->setApprovedOn($row['approvedon']);
     $exemption->setComments($row['comments']);
     $exemption->setApprovalComments($row['approvalcomments']);
     $exemption->setLocationName($row['locationname']);
     return $exemption;
 }