function Main() { switch ($this->formArray["formAction"]) { case "view": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $condition = ""; if ($this->formArray["filterByLocation"] == "true") { if ($condition == "") { $condition = " WHERE "; } $condition .= $this->filterLocationAddress(); } else { $this->tpl->set_block("rptsTemplate", "FilterLocationDetails", "FilterLocationDetailsBlock"); $this->tpl->set_var("FilterLocationDetailsBlock", ""); } if ($this->formArray["filterByDate"] == "true") { if ($condition == "") { $condition = " WHERE "; } else { $condition .= " AND "; } $condition .= $this->filterDate(); } else { $this->tpl->set_block("rptsTemplate", "FilterDateDetails", "FilterDateDetailsBlock"); $this->tpl->set_var("FilterDateDetailsBlock", ""); } $condition .= $this->filterArchives(); $odRecords = new ODRecords(); // paging if (!($count = $odRecords->countRecords($condition))) { $this->tpl->set_block("rptsTemplate", "PageNavigationOne", "PageNavigationOneBlock"); $this->tpl->set_var("PageNavigationOneBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); $this->tpl->set_var("currentPage", $this->formArray["page"]); $this->tpl->set_var("numOfPages", $numOfPages); $this->tpl->set_block("rptsTemplate", "PageListOne", "PageListOneBlock"); for ($p = 1; $p <= $numOfPages; $p++) { $this->tpl->set_var("page", $p); $this->initSelected("page", $p); $this->tpl->parse("PageListOneBlock", "PageListOne", true); } } if ($this->formArray["page"] > 0) { $initialLimit = ($this->formArray["page"] - 1) * PAGE_BY; $condition .= " LIMIT " . $initialLimit . "," . PAGE_BY; } // listing if (!$odRecords->selectRecords($condition)) { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("message", "properties not found"); $this->tpl->parse("NotFoundBlock", "NotFound", true); $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock"); $this->tpl->set_var("ReportBlock", ""); } else { $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $this->tpl->set_block("rptsTemplate", "ReportList", "ReportListBlock"); foreach ($list as $key => $value) { $this->formArray["odID"] = $value->getOdID(); $this->tpl->set_var("odID", $value->getOdID()); $afs = $this->getAFSDetails($value->getOdID()); if (is_object($afs)) { $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber()); $this->tpl->set_var("arpNumber", $afs->getArpNumber()); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); $landList = $afs->getLandArray(); $plantsTreesList = $afs->getPlantsTreesArray(); $improvementsBuildingsList = $afs->getImprovementsBuildingsArray(); $machineriesList = $afs->getMachineriesArray(); $this->tpl->set_var("taxability", $afs->getTaxability()); $this->tpl->set_var("effectivity", $afs->getEffectivity()); $kind = ""; $class = ""; if (count($landList)) { $kind = "Land"; $land = $landList[0]; $class = $land->getClassification(); $landClasses = new LandClasses(); $landClasses->selectRecord($class); $class = $landClasses->getDescription(); } else { if (count($plantsTreesList)) { $kind = "Land"; $plantsTrees = $plantsTreesList[0]; $class = $plantsTrees->getProductClass(); $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord($class); $class = $plantsTreesClasses->getDescription(); } else { if (count($improvementsBuildingsList)) { $kind = "Improvements/Buildings"; $improvementsBuildings = $improvementsBuildingsList[0]; $class = $improvementsBuildings->getBuildingClassification(); $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); $improvementsBuildingsClasses->selectRecord($class); $class = $improvementsBuildingsClasses->getDescription(); } else { if (count($machineriesList)) { $kind = "Machineries"; $machineries = $machineriesList[0]; $class = $machineries->getKind(); } } } } $this->tpl->set_var("kind", $kind); $this->tpl->set_var("class", $class); $oValue = $value->owner; if (is_array($oValue->personArray)) { foreach ($oValue->personArray as $person) { $ownerNamesArray[] = $person->getName(); } } if (is_array($oValue->companyArray)) { foreach ($oValue->companyArray as $company) { $ownerNamesArray[] = $company->getCompanyName(); } } if (is_array($ownerNamesArray)) { $this->tpl->set_var("ownerNames", implode(",<br>", $ownerNamesArray)); } else { $this->tpl->set_var("ownerNames", ""); } unset($ownerNamesArray); if (count($oValue->personArray)) { $firstOwner = $oValue->personArray[0]->getLastName(); $firstOwner .= ", "; $firstOwner .= $oValue->personArray[0]->getFirstName(); $firstOwner .= " "; $firstOwner .= substr($oValue->personArray[0]->getMiddleName(), 0, 1) . "."; $pAddress = $oValue->personArray[0]->addressArray ? $oValue->personArray[0]->addressArray[0]->getFullAddress() : "no address"; $firstOwnerAddress = $pAddress; $firstOwnerTelephone = $oValue->personArray[0]->getTelephone(); $this->tpl->set_var("firstOwner", $firstOwner); $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress); $this->tpl->set_var("firstOwnerTelephone", $firstOwnerTelephone); } if (count($oValue->companyArray)) { if ($firstOwner == "") { $firstOwner = $oValue->companyArray[0]->getCompanyName(); $cAddress = $oValue->companyArray[0]->addressArray ? $oValue->companyArray[0]->addressArray[0]->getFullAddress() : "no address"; $firstOwnerAddress = $cAddress; $firstOwnerTelephone = $oValue->companyArray[0]->getTelephone(); $this->tpl->set_var("firstOwner", $firstOwner); $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress); $this->tpl->set_var("firstOwnerTelephone", $firstOwnerTelephone); } } if ($firstOwner != "") { $this->tpl->set_var("none", ""); if (count($oValue->personArray) + count($oValue->companyArray) > 1) { $this->tpl->set_var("andOthers", "(and others)"); } else { $this->tpl->set_var("andOthers", ""); } } else { $this->tpl->set_var("none", "none"); $this->tpl->set_var("firstOwner", ""); $this->tpl->set_var("andOthers", ""); $this->tpl->set_var("firstOwnerAddress", ""); $this->tpl->set_var("firstOwnerTelephone", ""); } $locationAddress = $value->locationAddress->getFullAddress(); $this->tpl->set_var("locationAddress", $locationAddress); $this->displayPrecedingOD(); $this->displaySucceedingOD(); $this->tpl->parse("ReportListBlock", "ReportList", true); } } } } break; default: $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("message", "select a location to view report"); $this->tpl->parse("NotFoundBlock", "NotFound", true); $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock"); $this->tpl->set_var("ReportBlock", ""); break; } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->set_var("rpts_Session", $this->sess->id); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function getODCount($condition = "") { $odRecords = new ODRecords(); return $odRecords->countRecords($condition); }
function Main() { switch ($this->formArray["formAction"]) { case "view": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $condition = ""; if ($this->formArray["filterByLocation"] == "true") { if ($condition == "") { $condition = " WHERE "; } $condition .= $this->filterLocationAddress(); } else { $this->tpl->set_block("rptsTemplate", "FilterLocationDetails", "FilterLocationDetailsBlock"); $this->tpl->set_var("FilterLocationDetailsBlock", ""); } if ($this->formArray["filterByDate"] == "true") { if ($condition == "") { $condition = " WHERE "; } else { $condition .= " AND "; } $condition .= $this->filterDate(); } else { $this->tpl->set_block("rptsTemplate", "FilterDateDetails", "FilterDateDetailsBlock"); $this->tpl->set_var("FilterDateDetailsBlock", ""); } $condition .= $this->filterArchives(); $odRecords = new ODRecords(); if ($this->formArray["filterByClassification"] == "true") { $odIDArray = $this->filterByClassification($condition); if (is_array($odIDArray)) { $count = count($odIDArray); $numOfPages = ceil($count / PAGE_BY); $pLowerLimit = ($this->formArray["page"] - 1) * PAGE_BY; $pUpperLimit = $pLowerLimit + PAGE_BY; $this->tpl->set_var("currentPage", $this->formArray["page"]); $this->tpl->set_var("numOfPages", $numOfPages); $this->tpl->set_block("rptsTemplate", "PageListOne", "PageListOneBlock"); for ($p = 1; $p <= $numOfPages; $p++) { $this->tpl->set_var("page", $p); $this->initSelected("page", $p); $this->tpl->parse("PageListOneBlock", "PageListOne", true); } for ($p = $pLowerLimit; $p < $pUpperLimit; $p++) { if ($p < count($odIDArray)) { $od = new OD(); $od->selectRecord($odIDArray[$p]); $odRecords->arrayList[] = $od; } } } else { $this->tpl->set_block("rptsTemplate", "PageNavigationOne", "PageNavigationOneBlock"); $this->tpl->set_var("PageNavigationOneBlock", ""); } } else { if (!($count = $odRecords->countRecords($condition))) { $this->tpl->set_block("rptsTemplate", "PageNavigationOne", "PageNavigationOneBlock"); $this->tpl->set_var("PageNavigationOneBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); $this->tpl->set_var("currentPage", $this->formArray["page"]); $this->tpl->set_var("numOfPages", $numOfPages); $this->tpl->set_block("rptsTemplate", "PageListOne", "PageListOneBlock"); for ($p = 1; $p <= $numOfPages; $p++) { $this->tpl->set_var("page", $p); $this->initSelected("page", $p); $this->tpl->parse("PageListOneBlock", "PageListOne", true); } } $condition .= " LIMIT 0, 10"; $odRecords->selectRecords($condition); } if (!is_array($odRecords->getArrayList())) { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("message", "properties not found"); $this->tpl->parse("NotFoundBlock", "NotFound", true); $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock"); $this->tpl->set_var("ReportBlock", ""); } else { $list = $odRecords->getArrayList(); $count = 0; if (count($list)) { $this->tpl->set_block("rptsTemplate", "ReportList", "ReportListBlock"); $noneFound = true; foreach ($list as $key => $value) { $afs = $this->getAFSDetails($value->getOdID()); if (is_object($afs)) { $landList = $afs->getLandArray(); $plantsTreesList = $afs->getPlantsTreesArray(); $improvementsBuildingsList = $afs->getImprovementsBuildingsArray(); $machineriesList = $afs->getMachineriesArray(); $kind = ""; $class = ""; $remarks = ""; $actualUse = ""; $actualUseReportCode = ""; if (is_array($landList)) { $kind = "Land"; $land = $landList[0]; $actualUse = $land->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $actualUse = $landActualUses->getDescription(); $actualUseReportCode = $landActualUses->getReportCode(); $remarks = $land->getMemoranda(); } else { if (is_array($plantsTreesList)) { $kind = "Land"; $plantsTrees = $plantsTreesList[0]; $actualUse = $plantsTrees->getActualUse(); $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord($actualUse); $actualUse = $plantsTreesActualUses->getDescription(); $actualUseReportCode = $plantsTreesActualUses->getReportCode(); $remarks = $plantsTrees->getMemoranda(); } else { if (is_array($improvementsBuildingsList)) { $kind = "Improvements/Buildings"; $improvementsBuildings = $improvementsBuildingsList[0]; $actualUse = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $actualUse = $improvementsBuildingsActualUses->getDescription(); $actualUseReportCode = $improvementsBuildingsActualUses->getReportCode(); $remarks = $improvementsBuildings->getMemoranda(); } else { if (is_array($machineriesList)) { $kind = "Machineries"; $machineries = $machineriesList[0]; $actualUse = $machineries->getActualUse(); $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord($actualUse); $actualUse = $machineriesActualUses->getDescription(); $actualUseReportCode = $machineriesActualUses->getReportCode(); $remarks = $machineries->getMemoranda(); } } } } $this->tpl->set_var("kind", $kind); $this->tpl->set_var("actualUse", $actualUse); $this->tpl->set_var("actualUseReportCode", $actualUseReportCode); $this->tpl->set_var("remarks", $remarks); $this->tpl->set_var("taxability", $afs->getTaxability()); $this->formArray["odID"] = $value->getOdID(); $this->formArray["afsID"] = $afs->getAfsID(); $td = new TD(); if ($td->selectRecord("", $this->formArray["afsID"])) { $this->tpl->set_var("taxDeclarationNumber", $td->getTaxDeclarationNumber()); } else { $this->tpl->set_var("taxDeclarationNumber", ""); } $this->tpl->set_var("area", $value->getLandArea()); $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber()); $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue())); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); $oValue = $value->owner; if (count($oValue->personArray)) { $firstOwner = $oValue->personArray[0]->getLastName(); $firstOwner .= ", "; $firstOwner .= $oValue->personArray[0]->getFirstName(); $firstOwner .= " "; $firstOwner .= substr($oValue->personArray[0]->getMiddleName(), 0, 1) . "."; $pAddress = $oValue->personArray[0]->addressArray ? $oValue->personArray[0]->addressArray[0]->getFullAddress() : "no address"; $firstOwnerAddress = $pAddress; $firstOwnerTelephone = $oValue->personArray[0]->getTelephone(); $this->tpl->set_var("firstOwner", $firstOwner); $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress); } if (count($oValue->companyArray)) { if ($firstOwner == "") { $firstOwner = $oValue->companyArray[0]->getCompanyName(); $cAddress = $oValue->companyArray[0]->addressArray ? $oValue->companyArray[0]->addressArray[0]->getFullAddress() : "no \taddress"; $firstOwnerAddress = $cAddress; $firstOwnerTelephone = $oValue->companyArray[0]->getTelephone(); $this->tpl->set_var("firstOwner", $firstOwner); $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress); } } if ($firstOwner != "") { $this->tpl->set_var("none", ""); if (count($oValue->personArray) + count($oValue->companyArray) > 1) { $this->tpl->set_var("andOthers", "(and others)"); } else { $this->tpl->set_var("andOthers", ""); } } else { $this->tpl->set_var("none", "none"); $this->tpl->set_var("firstOwner", ""); $this->tpl->set_var("andOthers", ""); $this->tpl->set_var("firstOwnerAddress", ""); $this->tpl->set_var("firstOwnerTelephone", ""); } if (is_array($oValue->personArray)) { foreach ($oValue->personArray as $person) { $ownerNamesArray[] = $person->getFullName(); } } if (is_array($oValue->companyArray)) { foreach ($oValue->companyArray as $company) { $ownerNamesArray[] = $company->getCompanyName(); } } if (is_array($ownerNamesArray)) { $this->tpl->set_var("ownerNames", implode(",<br>", $ownerNamesArray)); } else { $this->tpl->set_var("ownerNames", ""); } unset($ownerNamesArray); $locationAddress = $value->locationAddress->getFullAddress(); $this->tpl->set_var("location", $locationAddress); $this->tpl->set_var("transactionCode", $value->getTransactionCode()); $this->tpl->set_var("assessorsLotNo", $value->getLotNumber()); $this->tpl->set_var("dateCreated", date('F j, Y, g:i a', $value->getDateCreated())); if ($this->formArray["filterByClassification"] == "true") { $count++; if ($this->checkActualUseReportCode($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList)) { $noneFound = false; $this->tpl->parse("ReportListBlock", "ReportList", true); } } else { $noneFound = false; $this->tpl->set_block("rptsTemplate", "FilterClassificationDetails", "FilterClassificationDetailsBlock"); $this->tpl->set_var("FilterClassificationDetailsBlock", ""); $this->tpl->parse("ReportListBlock", "ReportList", true); } } } if ($noneFound == true) { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->parse("NotFoundBlock", "NotFound", true); $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock"); $this->tpl->set_var("ReportBlock", ""); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); } } } break; default: $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("message", "select a location to view report"); $this->tpl->parse("NotFoundBlock", "NotFound", true); $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock"); $this->tpl->set_var("ReportBlock", ""); break; } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->set_var("rpts_Session", $this->sess->id); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function getODCount() { $odRecords = new ODRecords(); return $odRecords->countRecords(); }