function searchLandSubclasses($searchKey, $page = 0) { if ($page > 0) { $page = ($page - 1) * PAGE_BY; $limit = "LIMIT {$page}," . PAGE_BY; } $fields = array("code", "description", "status", "value"); $landSubclassesRecords = new LandSubclassesRecords(); if ($landSubclassesRecords->searchRecords($searchKey, $fields, $limit)) { if (!($domDoc = $landSubclassesRecords->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } } else { return false; } }
function codeAlreadyExists() { $LandSubclassesList = new SoapObject(NCCBIZ . "LandSubclassesList.php", "urn:Object"); if (!($xmlStr = $LandSubclassesList->getLandSubclassesList())) { return false; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } else { $landSubclassesRecords = new LandSubclassesRecords(); $landSubclassesRecords->parseDomDocument($domDoc); $list = $landSubclassesRecords->getArrayList(); foreach ($list as $key => $landSubclasses) { if (strtoupper($this->formArray["code"]) == strtoupper($landSubclasses->getCode())) { if ($this->formArray["landSubclassesID"] != $landSubclasses->getLandSubclassesID()) { return true; } } } } } }
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(); } } $LandSubclassesList = new SoapObject(NCCBIZ . "LandSubclassesList.php", "urn:Object"); $condition = " WHERE status='active' "; $condition .= $this->sortBlocks(); $this->tpl->set_var("activeInactive", "(active ONLY)"); if (!($xmlStr = $LandSubclassesList->getLandSubclassesList(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 { $landSubclassesRecords = new LandSubclassesRecords(); $landSubclassesRecords->parseDomDocument($domDoc); $list = $landSubclassesRecords->getArrayList(); $this->tpl->set_var("totalRecords", count($list)); $this->tpl->set_block("rptsTemplate", "LandSubclassesList", "LandSubclassesListBlock"); foreach ($list as $key => $listValue) { $this->tpl->set_var("landSubclassesID", $listValue->getLandSubclassesID()); $this->tpl->set_var("code", $listValue->getCode()); $this->tpl->set_var("description", $listValue->getDescription()); $this->tpl->set_var("value", $listValue->getValue()); $this->tpl->set_var("status", $listValue->getStatus()); $this->tpl->set_var("statusCheck", $this->getStatusCheck($listValue->getStatus())); $this->tpl->parse("LandSubclassesListBlock", "LandSubclassesList", true); } } } $this->setForm(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function initMasterPropertyList($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}(0, "WHERE status='active' ORDER BY description"))) { // empty list } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // empty list } else { switch ($tempVar) { case "landClasses": $tempVarRecords = new LandClassesRecords(); $tempVarID = "getLandClassesID"; break; case "landActualUses": $tempVarRecords = new LandActualUsesRecords(); $tempVarID = "getLandActualUsesID"; $this->tpl->set_block("rptsTemplate", "JS" . $TempVar . "List", "JS" . $TempVar . "ListBlock"); break; case "landSubclasses": $tempVarRecords = new LandSubclassesRecords(); $tempVarID = "getLandSubclassesID"; $this->tpl->set_block("rptsTemplate", "JS" . $TempVar . "List", "JS" . $TempVar . "ListBlock"); break; } $tempVarRecords->parseDomDocument($domDoc); $list = $tempVarRecords->getArrayList(); $i = 0; $j = 0; foreach ($list as $key => $value) { $this->tpl->set_var($tempVar . "ID", $value->{$tempVarID}()); $this->tpl->set_var($tempVar, $value->getDescription()); if ($tempVar == "landSubclasses") { $this->tpl->set_var($tempVar, $value->getDescription() . " (" . $value->getCode() . ")"); } $this->initSelected($tempVar, $value->{$tempVarID}()); $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true); switch ($tempVar) { case "landSubclasses": $this->tpl->set_var("i", $i); $this->tpl->set_var("landSubclassesID", $value->getLandSubclassesID()); $this->tpl->set_var("code", addslashes($value->getCode())); $this->tpl->set_var("description", addslashes($value->getDescription())); $this->tpl->set_var("value", addslashes($value->getValue())); $this->tpl->parse("JS" . $TempVar . "ListBlock", "JS" . $TempVar . "List", true); $i++; if ($landSubclasses_selected == "") { if ($this->formArray["landSubclasses"] == $value->{$tempVarID}()) { $recommendedUnitValue = $value->getValue(); $landSubclasses = $value->getDescription(); $landSubclasses_selected = true; } } $this->tpl->set_var("recommendedUnitValue", addslashes($recommendedUnitValue)); $this->tpl->set_var("landSubclasses", addslashes($landSubclasses)); break; case "landActualUses": $this->tpl->set_var("i", $j); $this->tpl->set_var("landActualUsesID", $value->getLandActualUsesID()); $this->tpl->set_var("code", addslashes($value->getCode())); $this->tpl->set_var("description", addslashes($value->getDescription())); $this->tpl->set_var("value", addslashes($value->getValue())); $this->tpl->parse("JS" . $TempVar . "ListBlock", "JS" . $TempVar . "List", true); $j++; if ($landActualUses_selected == "") { if ($this->formArray["landActualUses"] == $value->{$tempVarID}()) { $recommendedAssessmentLevel = $value->getValue(); $landActualUses = $value->getDescription(); $landActualUses_selected = true; } $this->tpl->set_var("recommendedAssessmentLevel", addslashes($recommendedAssessmentLevel)); $this->tpl->set_var("landActualUses", addslashes($landActualUses)); } else { $this->tpl->set_var("recommendedAssessmentLevel", addslashes($recommendedAssessmentLevel)); $this->tpl->set_var("landActualUses", addslashes($landActualUses)); } break; } } } } }
function Main() { switch ($this->formArray["formAction"]) { case "delete": if (count($this->formArray["landSubclassesID"]) > 0) { $LandSubclassesList = new SoapObject(NCCBIZ . "LandSubclassesList.php", "urn:Object"); if (!($deletedRows = $LandSubclassesList->deleteLandSubclasses($this->formArray["landSubclassesID"]))) { $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": $LandSubclassesList = new SoapObject(NCCBIZ . "LandSubclassesList.php", "urn:Object"); if (!($activeRows = $LandSubclassesList->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: LandSubclassesList.php"); exit; break; default: $this->tpl->set_var("msg", ""); } $LandSubclassesList = new SoapObject(NCCBIZ . "LandSubclassesList.php", "urn:Object"); $condition = $this->showHideInactive(); $condition .= $this->sortBlocks(); if (!($xmlStr = $LandSubclassesList->getLandSubclassesList(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 { $landSubclassesRecords = new LandSubclassesRecords(); $landSubclassesRecords->parseDomDocument($domDoc); $list = $landSubclassesRecords->getArrayList(); $this->tpl->set_block("rptsTemplate", "LandSubclassesList", "LandSubclassesListBlock"); foreach ($list as $key => $listValue) { $this->tpl->set_var("landSubclassesID", $listValue->getLandSubclassesID()); $this->tpl->set_var("code", $listValue->getCode()); $this->tpl->set_var("description", $listValue->getDescription()); $this->tpl->set_var("value", $listValue->getValue()); $this->tpl->set_var("status", $listValue->getStatus()); $this->tpl->set_var("statusCheck", $this->getStatusCheck($listValue->getStatus())); $this->tpl->parse("LandSubclassesListBlock", "LandSubclassesList", 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"); }