Example #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");
 }
Example #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");
 }
 public static function populateDetailObject($row)
 {
     $exemptionDetail = new ExemptionDetail();
     $exemptionDetail->setSeq($row['seq']);
     $exemptionDetail->setExemptionSeq($row['exemptionseq']);
     $exemptionDetail->setChannelNumber($row['channelno']);
     $exemptionDetail->setChannelName($row['channelname']);
     return $exemptionDetail;
 }