Пример #1
0
 function codeAlreadyExists()
 {
     // allow duplicates if LGU type is Province
     $lguType = $this->getLGUType();
     if ($lguType == "Province") {
         return false;
     }
     $DistrictList = new SoapObject(NCCBIZ . "DistrictList.php", "urn:Object");
     if (!($xmlStr = $DistrictList->getDistrictList())) {
         return false;
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             return false;
         } else {
             $districtRecords = new DistrictRecords();
             $districtRecords->parseDomDocument($domDoc);
             $list = $districtRecords->getArrayList();
             foreach ($list as $key => $district) {
                 if (strtoupper($this->formArray["code"]) == strtoupper($district->getCode())) {
                     if ($this->formArray["districtID"] != $district->getDistrictID()) {
                         return true;
                     }
                 }
             }
         }
     }
 }
Пример #2
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "delete":
             if (count($this->formArray["districtID"]) > 0) {
                 $DistrictList = new SoapObject(NCCBIZ . "DistrictList.php", "urn:Object");
                 if (!($deletedRows = $DistrictList->deleteDistrict($this->formArray["districtID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             break;
         case "activate":
             $DistrictList = new SoapObject(NCCBIZ . "DistrictList.php", "urn:Object");
             if (!($activeRows = $DistrictList->updateStatus($this->formArray["status"]))) {
                 $this->tpl->set_var("msg", "All records have status made <i>inactive</i>");
             } else {
                 $this->tpl->set_var("msg", $activeRows . " records have status made <i>active</i>");
             }
             break;
         case "cancel":
             header("location: DistrictList.php?" . $this->sess->name . "=" . $this->sess->id);
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $DistrictList = new SoapObject(NCCBIZ . "DistrictList.php", "urn:Object");
     $condition = $this->showHideInactive();
     $condition .= $this->sortBlocks();
     if (!($xmlStr = $DistrictList->getDistrictList(0, $condition))) {
         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
         $this->tpl->set_var("TableBlock", "database is empty");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
             $this->tpl->set_var("TableBlock", "error xmlDoc");
         } else {
             $districtRecords = new DistrictRecords();
             $districtRecords->parseDomDocument($domDoc);
             $list = $districtRecords->getArrayList();
             $this->tpl->set_block("rptsTemplate", "DistrictList", "DistrictListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("districtID", $value->getDistrictID());
                 $this->tpl->set_var("code", $value->getCode());
                 $this->tpl->set_var("municipalityCity", $this->getMunicipalityCity($value->getMunicipalityCityID()));
                 $this->tpl->set_var("description", $value->getDescription());
                 $this->tpl->set_var("status", $value->getStatus());
                 $this->tpl->set_var("statusCheck", $this->getStatusCheck($value->getStatus()));
                 $this->tpl->parse("DistrictListBlock", "DistrictList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Пример #3
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         default:
             $this->tpl->set_var("msg", "");
     }
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
         $this->tpl->set_var("TableBlock", "record not found");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
             $this->tpl->set_var("TableBlock", "error xmlDoc");
         } else {
             $erptsSettings = new eRPTSSettings();
             $erptsSettings->parseDomDocument($domDoc);
             $this->formArray["eRPTSSettingsID"] = $erptsSettings->getERPTSSettingsID();
             $this->formArray["lguName"] = $erptsSettings->getLguName();
             $this->formArray["lguType"] = $erptsSettings->getLguType();
             $this->formArray["chiefExecutiveDesignation"] = $erptsSettings->getChiefExecutiveDesignation();
             $this->formArray["chiefExecutiveFirstName"] = $erptsSettings->getChiefExecutiveFirstName();
             $this->formArray["chiefExecutiveMiddleName"] = $erptsSettings->getChiefExecutiveMiddleName();
             $this->formArray["chiefExecutiveLastName"] = $erptsSettings->getChiefExecutiveLastName();
             $this->formArray["assessorDesignation"] = $erptsSettings->getAssessorDesignation();
             $this->formArray["assessorFirstName"] = $erptsSettings->getAssessorFirstName();
             $this->formArray["assessorMiddleName"] = $erptsSettings->getAssessorMiddleName();
             $this->formArray["assessorLastName"] = $erptsSettings->getAssessorLastName();
             $this->formArray["treasurerDesignation"] = $erptsSettings->getTreasurerDesignation();
             $this->formArray["treasurerFirstName"] = $erptsSettings->getTreasurerFirstName();
             $this->formArray["treasurerMiddleName"] = $erptsSettings->getTreasurerMiddleName();
             $this->formArray["treasurerLastName"] = $erptsSettings->getTreasurerLastName();
         }
     }
     $DistrictList = new SoapObject(NCCBIZ . "DistrictList.php", "urn:Object");
     $condition = " WHERE " . DISTRICT_TABLE . ".status='active' ";
     $this->tpl->set_var("activeInactive", "(active ONLY)");
     $condition .= $this->sortBlocks();
     if (!($xmlStr = $DistrictList->getDistrictList(0, $condition))) {
         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
         $this->tpl->set_var("TableBlock", "database is empty");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
             $this->tpl->set_var("TableBlock", "error xmlDoc");
         } else {
             $districtRecords = new DistrictRecords();
             $districtRecords->parseDomDocument($domDoc);
             $list = $districtRecords->getArrayList();
             $this->tpl->set_var("totalRecords", count($list));
             $this->tpl->set_block("rptsTemplate", "DistrictList", "DistrictListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("districtID", $value->getDistrictID());
                 $this->tpl->set_var("code", $value->getCode());
                 $this->tpl->set_var("municipalityCity", $this->getMunicipalityCity($value->getMunicipalityCityID()));
                 $this->tpl->set_var("description", $value->getDescription());
                 $this->tpl->set_var("status", $value->getStatus());
                 $this->tpl->set_var("statusCheck", $this->getStatusCheck($value->getStatus()));
                 $this->tpl->parse("DistrictListBlock", "DistrictList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }