Exemplo n.º 1
0
 function initMasterAddressList($TempVar, $tempVar)
 {
     $getList = "get" . $TempVar . "List";
     $getID = "get" . $TempVar . "ID";
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     $TempVarList = new SoapObject(NCCBIZ . $TempVar . "List.php", "urn:Object");
     if (!($xmlStr = $TempVarList->{$getList}("", " ORDER BY description"))) {
         $this->tpl->set_var($tempVar . "ID", "");
         $this->tpl->set_var($tempVar, "empty " . $tempVar . " list");
         $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var($tempVar . "ID", "");
             $this->tpl->set_var($tempVar, "empty " . $tempVar . " list");
             $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
         } else {
             switch ($tempVar) {
                 case "barangay":
                     $tempVarRecords = new BarangayRecords();
                     $tempVarID = $getID;
                     break;
                 case "district":
                     $tempVarRecords = new DistrictRecords();
                     $tempVarID = $getID;
                     break;
                 case "municipalityCity":
                     $tempVarRecords = new MunicipalityCityRecords();
                     $tempVarID = $getID;
                     break;
                 case "province":
                     $tempVarRecords = new ProvinceRecords();
                     $tempVarID = $getID;
                     break;
             }
             $tempVarRecords->parseDomDocument($domDoc);
             $list = $tempVarRecords->getArrayList();
             foreach ($list as $key => $value) {
                 $this->tpl->set_var($tempVar . "ID", $value->{$tempVarID}());
                 $this->tpl->set_var($tempVar, $value->getDescription());
                 $this->initSelected($tempVar . "ID", $value->{$tempVarID}(), "selected");
                 $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
             }
         }
     }
 }
Exemplo n.º 2
0
 function searchProvince($searchKey, $page = 0)
 {
     if ($page > 0) {
         $page = ($page - 1) * PAGE_BY;
         $limit = "LIMIT {$page}," . PAGE_BY;
     }
     $fields = array("code", "description", "status");
     $provinceRecords = new ProvinceRecords();
     if ($provinceRecords->searchRecords($searchKey, $fields, $limit)) {
         if (!($domDoc = $provinceRecords->getDomDocument())) {
             return false;
         } else {
             $xmlStr = $domDoc->dump_mem(true);
             return $xmlStr;
         }
     } else {
         return false;
     }
 }
Exemplo n.º 3
0
 function codeAlreadyExists()
 {
     $ProvinceList = new SoapObject(NCCBIZ . "ProvinceList.php", "urn:Object");
     if (!($xmlStr = $ProvinceList->getProvinceList())) {
         return false;
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             return false;
         } else {
             $provinceRecords = new ProvinceRecords();
             $provinceRecords->parseDomDocument($domDoc);
             $list = $provinceRecords->getArrayList();
             foreach ($list as $key => $province) {
                 if (strtoupper($this->formArray["code"]) == strtoupper($province->getCode())) {
                     if ($this->formArray["provinceID"] != $province->getProvinceID()) {
                         return true;
                     }
                 }
             }
         }
     }
 }
 function setLguDetails()
 {
     $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["lguName"] = strtoupper($erptsSettings->getLguName());
             $this->formArray["lguType"] = strtoupper($erptsSettings->getLguType());
             $this->tpl->set_var("lguName", $this->formArray["lguName"]);
             $this->tpl->set_var("lguType", $this->formArray["lguType"]);
             if (strtolower($this->formArray["lguType"]) == "municipality") {
                 $provinceRecords = new ProvinceRecords();
                 $condition = "WHERE status='active' ORDER BY provinceID ASC LIMIT 1";
                 if ($provinceRecords->selectRecords($condition)) {
                     if (is_array($provinceRecords->arrayList)) {
                         $province = $provinceRecords->arrayList[0];
                         $this->formArray["provinceName"] = strtoupper($province->getDescription());
                         $this->tpl->set_var("provinceName", strtoupper($this->formArray["provinceName"]));
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 5
0
 function initMasterAddressList($TempVar, $tempVar)
 {
     $getList = "get" . $TempVar . "List";
     $getID = "get" . $TempVar . "ID";
     switch ($tempVar) {
         case "barangay":
             $propertyTable = BARANGAY_TABLE;
             break;
         case "district":
             $propertyTable = DISTRICT_TABLE;
             break;
         case "municipalityCity":
             $propertyTable = MUNICIPALITYCITY_TABLE;
             break;
         case "province":
             $propertyTable = PROVINCE_TABLE;
             break;
     }
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     $TempVarList = new SoapObject(NCCBIZ . $TempVar . "List.php", "urn:Object");
     if (!($xmlStr = $TempVarList->{$getList}(0, " WHERE " . $propertyTable . ".status='active' ORDER BY description"))) {
         switch ($tempVar) {
             case "barangay":
             case "district":
             case "municipalityCity":
                 $this->tpl->set_block("rptsTemplate", "JS" . $TempVar . "List", "JS" . $TempVar . "ListBlock");
                 $this->tpl->set_var("JS" . $TempVar . "ListBlock", "");
                 break;
         }
         $this->tpl->set_var($tempVar . "ID", "");
         $this->tpl->set_var($tempVar, "empty " . $tempVar . " list");
         $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             switch ($tempVar) {
                 case "barangay":
                 case "district":
                 case "municipalityCity":
                     $this->tpl->set_block("rptsTemplate", "JS" . $TempVar . "List", "JS" . $TempVar . "ListBlock");
                     $this->tpl->set_var("JS" . $TempVar . "ListBlock", "");
                     break;
             }
             $this->tpl->set_var($tempVar . "ID", "");
             $this->tpl->set_var($tempVar, "empty " . $tempVar . " list");
             $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
         } else {
             switch ($tempVar) {
                 case "barangay":
                     $this->tpl->set_block("rptsTemplate", "JS" . $TempVar . "List", "JS" . $TempVar . "ListBlock");
                     $tempVarRecords = new BarangayRecords();
                     $tempVarID = $getID;
                     break;
                 case "district":
                     $this->tpl->set_block("rptsTemplate", "JS" . $TempVar . "List", "JS" . $TempVar . "ListBlock");
                     $tempVarRecords = new DistrictRecords();
                     $tempVarID = $getID;
                     break;
                 case "municipalityCity":
                     $this->tpl->set_block("rptsTemplate", "JS" . $TempVar . "List", "JS" . $TempVar . "ListBlock");
                     $tempVarRecords = new MunicipalityCityRecords();
                     $tempVarID = $getID;
                     break;
                 case "province":
                     $tempVarRecords = new ProvinceRecords();
                     $tempVarID = $getID;
                     break;
             }
             $tempVarRecords->parseDomDocument($domDoc);
             $list = $tempVarRecords->getArrayList();
             $i = 0;
             foreach ($list as $key => $value) {
                 $this->tpl->set_var($tempVar . "ID", $value->{$tempVarID}());
                 $this->tpl->set_var($tempVar, $value->getDescription());
                 $this->initSelected($tempVar, $value->getDescription());
                 $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
                 switch ($tempVar) {
                     case "barangay":
                         $this->tpl->set_var("i", $i);
                         $this->tpl->set_var("districtID", $value->getDistrictID());
                         $this->tpl->parse("JS" . $TempVar . "ListBlock", "JS" . $TempVar . "List", true);
                         $i++;
                         break;
                     case "district":
                         $this->tpl->set_var("i", $i);
                         $this->tpl->set_var("municipalityCityID", $value->getMunicipalityCityID());
                         $this->tpl->parse("JS" . $TempVar . "ListBlock", "JS" . $TempVar . "List", true);
                         $i++;
                         break;
                     case "municipalityCity":
                         $this->tpl->set_var("i", $i);
                         $this->tpl->set_var("provinceID", $value->getProvinceID());
                         $this->tpl->parse("JS" . $TempVar . "ListBlock", "JS" . $TempVar . "List", true);
                         $i++;
                         break;
                 }
             }
         }
     }
 }
Exemplo n.º 6
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();
         }
     }
     $ProvinceList = new SoapObject(NCCBIZ . "ProvinceList.php", "urn:Object");
     $condition = " WHERE status='active' ";
     $this->tpl->set_var("activeInactive", "(active ONLY)");
     $condition .= $this->sortBlocks();
     if (!($xmlStr = $ProvinceList->getProvinceList(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 {
             $provinceRecords = new ProvinceRecords();
             $provinceRecords->parseDomDocument($domDoc);
             $list = $provinceRecords->getArrayList();
             $this->tpl->set_var("totalRecords", count($list));
             $this->tpl->set_block("rptsTemplate", "ProvinceList", "ProvinceListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("provinceID", $value->getProvinceID());
                 $this->tpl->set_var("code", $value->getCode());
                 $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("ProvinceListBlock", "ProvinceList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Exemplo n.º 7
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "delete":
             if (count($this->formArray["provinceID"]) > 0) {
                 $ProvinceList = new SoapObject(NCCBIZ . "ProvinceList.php", "urn:Object");
                 if (!($deletedRows = $ProvinceList->deleteProvince($this->formArray["provinceID"]))) {
                     $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":
             $ProvinceList = new SoapObject(NCCBIZ . "ProvinceList.php", "urn:Object");
             if (!($activeRows = $ProvinceList->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: ProvinceList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $ProvinceList = new SoapObject(NCCBIZ . "ProvinceList.php", "urn:Object");
     $condition = $this->showHideInactive();
     $condition .= $this->sortBlocks();
     if (!($xmlStr = $ProvinceList->getProvinceList(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 {
             $provinceRecords = new ProvinceRecords();
             $provinceRecords->parseDomDocument($domDoc);
             $list = $provinceRecords->getArrayList();
             $this->tpl->set_block("rptsTemplate", "ProvinceList", "ProvinceListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("provinceID", $value->getProvinceID());
                 $this->tpl->set_var("code", $value->getCode());
                 $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("ProvinceListBlock", "ProvinceList", 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");
 }