function Main()
 {
     $this->tpl->set_block("rptsTemplate", "MunicipalityCityList", "MunicipalityCityListBlock");
     $MunicipalityCityList = new SoapObject(NCCBIZ . "MunicipalityCityList.php", "urn:Object");
     if (!($xmlStr = $MunicipalityCityList->getMunicipalityCityList(0, " WHERE " . MUNICIPALITYCITY_TABLE . ".status='active'"))) {
         $this->tpl->set_var("municipalityCityID", "");
         $this->tpl->set_var("description", "empty list");
         $this->tpl->parse("MunicipalityCityListBlock", "MunicipalityCityList", true);
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var("municipalityCityID", "");
             $this->tpl->set_var("description", "empty list");
             $this->tpl->parse("MunicipalityCityListBlock", "MunicipalityCityList", true);
         } else {
             $municipalityCityRecords = new MunicipalityCityRecords();
             $municipalityCityRecords->parseDomDocument($domDoc);
             $list = $municipalityCityRecords->getArrayList();
             foreach ($list as $municipalityCity) {
                 $this->tpl->set_var("municipalityCityID", $municipalityCity->getMunicipalityCityID());
                 $this->tpl->set_var("description", $municipalityCity->getDescription());
                 $this->tpl->parse("MunicipalityCityListBlock", "MunicipalityCityList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->setPageDetailPerms();
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Exemplo n.º 2
0
 function searchMunicipalityCity($searchKey, $page = 0)
 {
     if ($page > 0) {
         $page = ($page - 1) * PAGE_BY;
         $limit = "LIMIT {$page}," . PAGE_BY;
     }
     $fields = array("code", "description", "status");
     $municipalityCityRecords = new MunicipalityCityRecords();
     if ($municipalityCityRecords->searchRecords($searchKey, $fields, $limit)) {
         if (!($domDoc = $municipalityCityRecords->getDomDocument())) {
             return false;
         } else {
             $xmlStr = $domDoc->dump_mem(true);
             return $xmlStr;
         }
     } else {
         return false;
     }
 }
Exemplo n.º 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();
         }
     }
     $MunicipalityCityList = new SoapObject(NCCBIZ . "MunicipalityCityList.php", "urn:Object");
     $condition = " WHERE " . MUNICIPALITYCITY_TABLE . ".status='active' ";
     $this->tpl->set_var("activeInactive", "(active ONLY)");
     $condition .= $this->sortBlocks();
     if (!($xmlStr = $MunicipalityCityList->getMunicipalityCityList(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 {
             $municipalityCityRecords = new MunicipalityCityRecords();
             $municipalityCityRecords->parseDomDocument($domDoc);
             $list = $municipalityCityRecords->getArrayList();
             $this->tpl->set_var("totalRecords", count($list));
             $this->tpl->set_block("rptsTemplate", "MunicipalityCityList", "MunicipalityCityListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("municipalityCityID", $value->getMunicipalityCityID());
                 $this->tpl->set_var("code", $value->getCode());
                 $this->tpl->set_var("province", $this->getProvince($value->getProvinceID()));
                 $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("MunicipalityCityListBlock", "MunicipalityCityList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Exemplo n.º 4
0
 function codeAlreadyExists()
 {
     $MunicipalityCityList = new SoapObject(NCCBIZ . "MunicipalityCityList.php", "urn:Object");
     if (!($xmlStr = $MunicipalityCityList->getMunicipalityCityList())) {
         return false;
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             return false;
         } else {
             $municipalityCityRecords = new MunicipalityCityRecords();
             $municipalityCityRecords->parseDomDocument($domDoc);
             $list = $municipalityCityRecords->getArrayList();
             foreach ($list as $key => $municipalityCity) {
                 if (strtoupper($this->formArray["code"]) == strtoupper($municipalityCity->getCode())) {
                     if ($this->formArray["municipalityCityID"] != $municipalityCity->getMunicipalityCityID()) {
                         return true;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 5
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "delete":
             if (count($this->formArray["municipalityCityID"]) > 0) {
                 $MunicipalityCityList = new SoapObject(NCCBIZ . "MunicipalityCityList.php", "urn:Object");
                 if (!($deletedRows = $MunicipalityCityList->deleteMunicipalityCity($this->formArray["municipalityCityID"]))) {
                     $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":
             $MunicipalityCityList = new SoapObject(NCCBIZ . "MunicipalityCityList.php", "urn:Object");
             if (!($activeRows = $MunicipalityCityList->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: MunicipalityCityList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $MunicipalityCityList = new SoapObject(NCCBIZ . "MunicipalityCityList.php", "urn:Object");
     $condition = $this->showHideInactive();
     $condition .= $this->sortBlocks();
     if (!($xmlStr = $MunicipalityCityList->getMunicipalityCityList(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 {
             $municipalityCityRecords = new MunicipalityCityRecords();
             $municipalityCityRecords->parseDomDocument($domDoc);
             $list = $municipalityCityRecords->getArrayList();
             $this->tpl->set_block("rptsTemplate", "MunicipalityCityList", "MunicipalityCityListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("municipalityCityID", $value->getMunicipalityCityID());
                 $this->tpl->set_var("code", $value->getCode());
                 $this->tpl->set_var("province", $this->getProvince($value->getProvinceID()));
                 $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("MunicipalityCityListBlock", "MunicipalityCityList", 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");
 }