function Main() { switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["odID"]) > 0) { $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); if (!($deletedRows = $ODList->deleteOD($this->formArray["odID"]))) { $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 "filterBarangay": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $condition = $this->filterArchives(); if (!($count = $ODList->filterByBarangayCount($this->formArray["barangay"], $condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); $numOfPages = 1; } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("previousTxt", "previous"); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); if (!($xmlStr = $ODList->filterByBarangay($this->formArray["page"], $this->formArray["barangay"], $condition))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock"); $this->tpl->set_var("ODTableBlock", ""); $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "ODListTable", "ODListTableBlock"); $this->tpl->set_var("ODListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_block("ODList", "PersonList", "PersonListBlock"); $this->tpl->set_block("ODList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("odID", $value->getOdID()); // added propertyType column : October 20, 2005: $propertyType = $this->getPropertyTypeFromOD($value); $this->tpl->set_var("propertyType", $propertyType); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //echo method_exists($value->location,getFullAddress); $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); $this->tpl->set_var("landArea", number_format($value->getLandArea(), 4, '.', ',')); // $this->tpl->set_var("landArea", formatCurrency1($value->getLandArea())); $this->setODListBlockPerms(); $this->tpl->parse("ODListBlock", "ODList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("ODListBlock", "huh"); } } } break; case "search": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $condition = $this->filterArchives(); if (!($count = $ODList->getSearchCount($this->formArray["searchKey"], $condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); $numOfPages = 1; } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); if (!($xmlStr = $ODList->searchOD($this->formArray["page"], $this->formArray["searchKey"], $condition))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock"); $this->tpl->set_var("ODTableBlock", ""); $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "ODListTable", "ODListTableBlock"); $this->tpl->set_var("ODListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_block("ODList", "PersonList", "PersonListBlock"); $this->tpl->set_block("ODList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("odID", $value->getOdID()); // added propertyType column : October 20, 2005: $propertyType = $this->getPropertyTypeFromOD($value); $this->tpl->set_var("propertyType", $propertyType); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //echo method_exists($value->location,getFullAddress); $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); $this->tpl->set_var("landArea", number_format($value->getLandArea(), 4, '.', ',')); //$this->tpl->set_var("landArea", formatCurrency1($value->getLandArea())); $this->setODListBlockPerms(); $this->tpl->parse("ODListBlock", "ODList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("ODListBlock", "huh"); } } } break; case "cancel": header("location: ODList.php"); exit; break; default: $this->tpl->set_var("msg", ""); $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $condition = $this->filterArchives(); if (!($count = $ODList->getODCount($condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"] || $numOfPages == "") { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $ODList->getODList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock"); $this->tpl->set_var("ODTableBlock", ""); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "ODListTable", "ODListTableBlock"); $this->tpl->set_var("ODListTableBlock", ""); } else { $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_block("ODList", "PersonList", "PersonListBlock"); $this->tpl->set_block("ODList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { //print_r($value); //echo "<br>"; $this->tpl->set_var("odID", $value->getOdID()); // added propertyType column : October 20, 2005: $propertyType = $this->getPropertyTypeFromOD($value); $this->tpl->set_var("propertyType", $propertyType); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //if (method_exists($value->locationAddress,$value->locationAddress->getFullAddress())) if ($value->locationAddress != "") { $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); } $this->tpl->set_var("landArea", number_format($value->getLandArea(), 4, '.', ',')); //$this->tpl->set_var("landArea", formatCurrency1($value->getLandArea())); $this->setODListBlockPerms(); $this->tpl->parse("ODListBlock", "ODList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("ODListBlock", "huh"); } } } } $this->initBarangayList(); $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "search": $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); if (!($count = $CompanyList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); if (!($xmlStr = $CompanyList->searchCompany($this->formArray["searchKey"], $this->formArray["page"]))) { $this->tpl->set_block("rptsTemplate", "Found", "FoundBlock"); $this->tpl->set_var("FoundBlock", ""); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", "error xmlDoc"); } else { $companyRecords = new CompanyRecords(); $companyRecords->parseDomDocument($domDoc); $list = $companyRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("companyID", $value->getCompanyID()); if (!($cname = $value->getCompanyName())) { $cname = "none"; } $this->tpl->set_var("companyName", $cname); $this->tpl->set_var("telephone", $value->getTelephone()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); } else { $this->tpl->set_block("rptsTemplate", "Found", "FoundBlock"); $this->tpl->set_var("FoundBlock", ""); } } } break; case "add": $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); $OwnerList->addOwnerCompany($this->formArray["ownerID"], $this->formArray["companyID"]); header("location: ChangeOfOwnershipCompanySearchClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); break; default: $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", ""); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"], "searchKey" => $this->formArray["searchKey"], "formAction" => "search"))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); if (!($deletedRows = $RPTOPList->deleteRPTOP($this->formArray["rptopID"]))) { $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 "search": $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); if (!($count = $RPTOPList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->searchRPTOP($this->formArray["page"], $condition, $this->formArray["searchKey"]))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxableYear", $value->getTaxableYear()); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { $totalTaxDue = "uncalculated"; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $totalTaxDue = "uncalculated"; } else { $due = new Due(); $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); } } } } else { $totalTaxDue = "no TD's"; } if (is_numeric($totalTaxDue)) { $totalTaxDue = formatCurrency($totalTaxDue); } $this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } break; case "cancel": header("location: CalculateRPTOP.php"); exit; break; default: $this->tpl->set_var("msg", ""); $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $RPTOPList->getRPTOPCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->getRPTOPList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", ""); } else { $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxableYear", $value->getTaxableYear()); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { $totalTaxDue = "uncalculated"; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $totalTaxDue = "uncalculated"; } else { $due = new Due(); $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); } } } } else { $totalTaxDue = "no TD's"; } if (is_numeric($totalTaxDue)) { $totalTaxDue = formatCurrency($totalTaxDue); } $this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "archive": $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object"); $tdIDArray = $this->formArray["tdIDArray"]; $archiveValue = $this->formArray["archiveValue"]; $userID = $this->formArray["uid"]; if (!($archiveRows = $TDList->archiveTD($tdIDArray, $archiveValue, $userID))) { $this->tpl->set_var("msg", "SOAP failed"); } else { $sess = $this->sess->name . "=" . $this->sess->id; header("Location: TDList.php?" . $sess . "&viewArchives=" . $this->formArray["viewArchives"]); exit; } break; case "search": $this->tpl->set_var("msg", ""); $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $condition = $this->filterArchives(); if (!($count = $TDList->getSearchCount($this->formArray["searchKey"], $condition))) { $this->tpl->set_var("PagesBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $TDList->searchTD($this->formArray["page"], $this->formArray["searchKey"], $condition))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock"); $this->tpl->set_var("TDTableBlock", ""); $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); $this->tpl->set_block("rptsTemplate", "ArchiveButton", "ArchiveButtonBlock"); $this->tpl->set_var("ArchiveButtonBlock", ""); $this->tpl->set_block("rptsTemplate", "UnArchiveButton", "UnArchiveButtonBlock"); $this->tpl->set_var("UnArchiveButtonBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock"); $this->tpl->set_var("TDListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $tdRecords = new TDRecords(); $tdRecords->parseDomDocument($domDoc); $list = $tdRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("TDList", "PersonList", "PersonListBlock"); $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("tdID", $value->getTdID()); $this->tpl->set_var("afsID", $value->getAfsID()); $this->tpl->set_var("propertyID", $value->getPropertyID()); $this->tpl->set_var("propertyType", $value->getPropertyType()); $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear()); if ($value->getCeasesWithTheYear() == "") { $this->tpl->set_var("ceasesWithTheYear", ""); } else { $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear()); } $this->displayOwner($value->getAfsID()); $this->tpl->parse("TDListBlock", "TDList", true); } } else { $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_var("TDListBlock", "huh"); } } } break; default: $this->tpl->set_var("msg", ""); $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $condition = $this->filterArchives(); if (!($count = $TDList->getTDCount($condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $TDList->getTDListForList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock"); $this->tpl->set_var("TDTableBlock", ""); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); $this->tpl->set_block("rptsTemplate", "ArchiveButton", "ArchiveButtonBlock"); $this->tpl->set_var("ArchiveButtonBlock", ""); $this->tpl->set_block("rptsTemplate", "UnArchiveButton", "UnArchiveButtonBlock"); $this->tpl->set_var("UnArchiveButtonBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock"); $this->tpl->set_var("TDListTableBlock", ""); } else { $tdRecords = new TDRecords(); $tdRecords->parseDomDocument($domDoc); $list = $tdRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("TDList", "PersonList", "PersonListBlock"); $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("tdID", $value->getTdID()); $this->tpl->set_var("afsID", $value->getAfsID()); $this->tpl->set_var("propertyID", $value->getPropertyID()); $this->tpl->set_var("propertyType", $value->getPropertyType()); $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear()); if ($value->getCeasesWithTheYear() == "") { $this->tpl->set_var("ceasesWithTheYear", ""); } else { $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear()); } $this->displayOwner($value->getAfsID()); $this->tpl->parse("TDListBlock", "TDList", true); } } else { $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_var("TDListBlock", "huh"); } } } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "search": $this->tpl->set_var("msg", ""); $AFSList = new SoapObject(NCCBIZ . "AFSList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $condition = $this->filterArchives(); if (!($count = $AFSList->getSearchCount($this->formArray["searchKey"], $condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $AFSList->searchAFS($this->formArray["page"], $this->formArray["searchKey"], $condition))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "AFSTable", "AFSTableBlock"); $this->tpl->set_var("AFSTableBlock", ""); $this->tpl->set_block("rptsTemplate", "AFSDBEmpty", "AFSDBEmptyBlock"); $this->tpl->set_var("AFSDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "AFSListTable", "AFSListTableBlock"); $this->tpl->set_var("AFSListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "AFSDBEmpty", "AFSDBEmptyBlock"); $this->tpl->set_var("AFSDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "AFSList", "AFSListBlock"); $this->tpl->set_block("AFSList", "PersonList", "PersonListBlock"); $this->tpl->set_block("AFSList", "CompanyList", "CompanyListBlock"); //echo hello; foreach ($list as $key => $value) { $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $this->afsID = $AFSEncode->getAFSID($value->getOdID()); if (!($xmlStr = $AFSEncode->getAFSForList($this->afsID))) { echo "error domdoc"; } else { //echo $xmlStr."<br><br><br>"; if (!($domDoc = domxml_open_mem($xmlStr))) { echo "hello"; $this->tpl->set_var("totalMarketValue", ""); $this->tpl->set_var("totalAssessedValue", ""); //$this->tpl->set_block("rptsTemplate", "AFSListTable", "AFSListTableBlock"); //$this->tpl->set_var("AFSListTableBlock", "error xmlDoc"); } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->tpl->set_var("totalMarketValue", number_format($afs->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); } } $this->tpl->set_var("odID", $value->getOdID()); $this->tpl->set_var("afsID", $this->afsID); $oValue = $value->owner; $this->tpl->set_var("ownerID", $oValue->getOwnerID()); $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //echo method_exists($value->location,getFullAddress); $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); $this->tpl->set_var("landArea", $value->getLandArea()); $this->setAFSListBlockPerms(); $this->tpl->parse("AFSListBlock", "AFSList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "AFSList", "AFSListBlock"); $this->tpl->set_var("AFSListBlock", "huh"); } } } break; default: $this->tpl->set_var("msg", ""); $AFSList = new SoapObject(NCCBIZ . "AFSList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $condition = $this->filterArchives(); if (!($count = $AFSList->getAFSCount($condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $AFSList->getAFSList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "AFSTable", "AFSTableBlock"); $this->tpl->set_var("AFSTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "AFSTable", "AFSTableBlock"); $this->tpl->set_var("AFSTableBlock", ""); } else { $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "AFSDBEmpty", "AFSDBEmptyBlock"); $this->tpl->set_var("AFSDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "AFSList", "AFSListBlock"); $this->tpl->set_block("AFSList", "PersonList", "PersonListBlock"); $this->tpl->set_block("AFSList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $this->afsID = $AFSEncode->getAFSID($value->getOdID()); if (!($xmlStr = $AFSEncode->getAFSForList($this->afsID))) { echo "error domdoc"; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_var("totalMarketValue", ""); $this->tpl->set_var("totalAssessedValue", ""); //$this->tpl->set_block("rptsTemplate", "AFSListTable", "AFSListTableBlock"); //$this->tpl->set_var("AFSListTableBlock", "error xmlDoc"); } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->tpl->set_var("totalMarketValue", number_format($afs->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); } } $this->tpl->set_var("odID", $value->getOdID()); $this->tpl->set_var("afsID", $this->afsID); $oValue = $value->owner; $this->tpl->set_var("ownerID", $oValue->getOwnerID()); $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //echo method_exists($value->location,getFullAddress); $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); $this->tpl->set_var("landArea", $value->getLandArea()); $this->setAFSListBlockPerms(); $this->tpl->parse("AFSListBlock", "AFSList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "AFSList", "AFSListBlock"); $this->tpl->set_var("AFSListBlock", "huh"); } } } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { $this->mergeBasketMain(); switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["odID"]) > 0) { $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); if (!($deletedRows = $ODList->deleteOD($this->formArray["odID"]))) { $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 "consolidate": $odIDArray = $this->formArray["mergeBasketArray"]; $RPUEncode = new SoapObject(NCCBIZ . "RPUEncode.php", "urn:Object"); $newOdID = $RPUEncode->ConsolidateRPU($odIDArray, $this->formArray["transactionCode"]); $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $archiveValue = "true"; $userID = $this->formArray["uid"]; if (!($archiveRows = $ODList->archiveOD($odIDArray, $archiveValue, $userID))) { // archive failed } else { // archive succeeded } $sess = $this->sess->name . "=" . $this->sess->id; header("Location: ODDetails.php?" . $sess . "&odID=" . $newOdID); exit; break; case "archive": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $odIDArray = $this->formArray["odIDArray"]; $archiveValue = $this->formArray["archiveValue"]; $userID = $this->formArray["uid"]; if (!($archiveRows = $ODList->archiveOD($odIDArray, $archiveValue, $userID))) { $this->tpl->set_var("msg", "SOAP failed"); } else { $sess = $this->sess->name . "=" . $this->sess->id; header("Location: ODList.php?" . $sess . "&viewArchives=" . $this->formArray["viewArchives"]); exit; } break; case "filterBarangay": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $condition = $this->filterArchives(); if (!($count = $ODList->filterByBarangayCount($this->formArray["barangay"], $condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); $numOfPages = 1; } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=filterBarangay&barangay=" . urlencode($this->formArray["barangay"])); $this->tpl->set_var("previousTxt", "previous"); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); if (!($xmlStr = $ODList->filterByBarangay($this->formArray["page"], $this->formArray["barangay"], $condition))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock"); $this->tpl->set_var("ODTableBlock", ""); $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "ODListTable", "ODListTableBlock"); $this->tpl->set_var("ODListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_block("ODList", "PersonList", "PersonListBlock"); $this->tpl->set_block("ODList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("odID", $value->getOdID()); $propertyType = $this->getPropertyTypeFromOD($value); if ($propertyType != "Land") { $this->tpl->set_var("checkbox_status", "disabled"); $this->tpl->set_var("checkbox_style", "style='display:none;'"); } else { $this->tpl->set_var("checkbox_status", ""); $this->tpl->set_var("checkbox_style", ""); if (is_array($this->formArray["mergeBasketArray"])) { if (in_array($value->getOdID(), $this->formArray["mergeBasketArray"])) { $this->tpl->set_var("checkbox_status", "checked disabled"); } } } switch ($propertyType) { case "Land": $this->tpl->set_var("propertyType", "L/P"); break; case "ImprovementsBuildings": $this->tpl->set_var("propertyType", "I/B"); break; case "Machineries": $this->tpl->set_var("propertyType", "M"); break; default: $this->tpl->set_var("propertyType", "-"); break; } $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //echo method_exists($value->location,getFullAddress); $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); $this->tpl->set_var("landArea", number_format($value->getLandArea(), 2, '.', ',')); $this->tpl->parse("ODListBlock", "ODList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("ODListBlock", "huh"); } } } break; case "search": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $condition = $this->filterArchives(); if (!($count = $ODList->getSearchCount($this->formArray["searchKey"], $condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); $numOfPages = 1; } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); if (!($xmlStr = $ODList->searchOD($this->formArray["page"], $this->formArray["searchKey"], $condition))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock"); $this->tpl->set_var("ODTableBlock", ""); $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); $this->tpl->set_block("rptsTemplate", "ArchiveButton", "ArchiveButtonBlock"); $this->tpl->set_var("ArchiveButtonBlock", ""); $this->tpl->set_block("rptsTemplate", "UnArchiveButton", "UnArchiveButtonBlock"); $this->tpl->set_var("UnArchiveButtonBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "ODListTable", "ODListTableBlock"); $this->tpl->set_var("ODListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_block("ODList", "PersonList", "PersonListBlock"); $this->tpl->set_block("ODList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("odID", $value->getOdID()); $propertyType = $this->getPropertyTypeFromOD($value); if ($propertyType != "Land") { $this->tpl->set_var("checkbox_status", "disabled"); $this->tpl->set_var("checkbox_style", "style='display:none;'"); } else { $this->tpl->set_var("checkbox_status", ""); $this->tpl->set_var("checkbox_style", ""); if (is_array($this->formArray["mergeBasketArray"])) { if (in_array($value->getOdID(), $this->formArray["mergeBasketArray"])) { $this->tpl->set_var("checkbox_status", "checked disabled"); } } } switch ($propertyType) { case "Land": $this->tpl->set_var("propertyType", "L/P"); break; case "ImprovementsBuildings": $this->tpl->set_var("propertyType", "I/B"); break; case "Machineries": $this->tpl->set_var("propertyType", "M"); break; default: $this->tpl->set_var("propertyType", "-"); break; } $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //echo method_exists($value->location,getFullAddress); $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); $this->tpl->set_var("landArea", number_format($value->getLandArea(), 2, '.', ',')); $this->tpl->parse("ODListBlock", "ODList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("ODListBlock", "huh"); } } } break; case "cancel": header("location: ODList.php"); exit; break; default: $this->tpl->set_var("msg", ""); $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $condition = $this->filterArchives(); if (!($count = $ODList->getODCount($condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"] || $numOfPages == "") { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $ODList->getODList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock"); $this->tpl->set_var("ODTableBlock", ""); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); $this->tpl->set_block("rptsTemplate", "ArchiveButton", "ArchiveButtonBlock"); $this->tpl->set_var("ArchiveButtonBlock", ""); $this->tpl->set_block("rptsTemplate", "UnArchiveButton", "UnArchiveButtonBlock"); $this->tpl->set_var("UnArchiveButtonBlock", ""); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "ODListTable", "ODListTableBlock"); $this->tpl->set_var("ODListTableBlock", ""); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); $this->tpl->set_block("rptsTemplate", "ArchiveButton", "ArchiveButtonBlock"); $this->tpl->set_var("ArchiveButtonBlock", ""); $this->tpl->set_block("rptsTemplate", "UnArchiveButton", "UnArchiveButtonBlock"); $this->tpl->set_var("UnArchiveButtonBlock", ""); } else { $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_block("ODList", "PersonList", "PersonListBlock"); $this->tpl->set_block("ODList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { //print_r($value); //echo "<br>"; $this->tpl->set_var("odID", $value->getOdID()); $propertyType = $this->getPropertyTypeFromOD($value); if ($propertyType != "Land") { $this->tpl->set_var("checkbox_status", "disabled"); $this->tpl->set_var("checkbox_style", "style='display:none;'"); } else { $this->tpl->set_var("checkbox_status", ""); $this->tpl->set_var("checkbox_style", ""); if (is_array($this->formArray["mergeBasketArray"])) { if (in_array($value->getOdID(), $this->formArray["mergeBasketArray"])) { $this->tpl->set_var("checkbox_status", "checked disabled"); } } } switch ($propertyType) { case "Land": $this->tpl->set_var("propertyType", "L/P"); break; case "ImprovementsBuildings": $this->tpl->set_var("propertyType", "I/B"); break; case "Machineries": $this->tpl->set_var("propertyType", "M"); break; default: $this->tpl->set_var("propertyType", "-"); break; } $propertyType = $this->getPropertyTypeFromOD($value); if ($propertyType != "Land") { $this->tpl->set_var("checkbox_status", "disabled"); $this->tpl->set_var("checkbox_style", "style='display:none;'"); } else { $this->tpl->set_var("checkbox_status", ""); $this->tpl->set_var("checkbox_style", ""); if (is_array($this->formArray["mergeBasketArray"])) { if (in_array($value->getOdID(), $this->formArray["mergeBasketArray"])) { $this->tpl->set_var("checkbox_status", "checked disabled"); } } } $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //if (method_exists($value->locationAddress,$value->locationAddress->getFullAddress())) if ($value->locationAddress != "") { $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); } //Begin Edited, Decimal 2 was change to 4 **************** $this->tpl->set_var("landArea", number_format($value->getLandArea(), 4, '.', ',')); //End $this->tpl->parse("ODListBlock", "ODList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("ODListBlock", "huh"); } } } } $this->initBarangayList(); $this->setForm(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { $numOfPages = 1; switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); if (!($deletedRows = $RPTOPList->deleteRPTOP($this->formArray["rptopID"]))) { $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 "cancel": header("location: RPTOPList.php"); exit; break; case "search": $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $count = $this->formArray["formAction"] == "search" ? $RPTOPList->getSearchCount($this->formArray["searchKey"]) : $RPTOPList->getRPTOPCount(); if (!$count) { $this->tpl->set_var("PagesBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = " ORDER BY " . RPTOP_TABLE . ".rptopID desc"; $xmlStr = $this->formArray["formAction"] == "search" ? $RPTOPList->searchRPTOP($this->formArray["page"], $condition, $this->formArray["searchKey"]) : $RPTOPList->getRPTOPList($this->formArray["page"]); break; default: $this->tpl->set_var("msg", ""); $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $RPTOPList->getRPTOPCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = " ORDER BY " . RPTOP_TABLE . ".rptopID desc"; $xmlStr = $RPTOPList->getRPTOPList($this->formArray["page"], $condition); } /* $RPTOPList = new SoapObject(NCCBIZ."RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $count = ($this->formArray["formAction"]=="search") ? $RPTOPList->getSearchCount($this->formArray["searchKey"]) : $RPTOPList->getRPTOPCount(); if (!$count){ $this->tpl->set_var("PagesBlock", ""); } else{ $numOfPages = ceil($count / PAGE_BY); for($i=1;$i<=$numOfPages;$i++){ if ($i==$this->formArray["page"]){ $this->tpl->set_var("pages",""); $this->tpl->set_var("paged",$i); } else{ $this->tpl->set_var("pages",$i); $this->tpl->set_var("paged",""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]){ $this->tpl->set_var("nextTxt", ""); } else{ $this->tpl->set_var("next", $this->formArray["page"]+1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1){ $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"]-1); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"]." of ".$numOfPages); $condition = " ORDER BY ".RPTOP_TABLE.".rptopID desc"; $xmlStr = ($this->formArray["formAction"]=="search") ? $RPTOPList->searchRPTOP($this->formArray["page"],$condition,$this->formArray["searchKey"]) : $RPTOPList->getRPTOPList($this->formArray["page"]); */ if (!$xmlStr) { $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", "page not found"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", "error xmlDoc"); } else { $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if ($this->formArray["sortOrder"] == "") { $this->formArray["sortOrder"] = "desc"; } $this->tpl->set_var("sortOrder", $this->formArray["sortOrder"] == "asc" ? "desc" : "asc"); if ($this->formArray["sortKey"] == "rptopID") { $this->tpl->set_var("sortImageID", "<img src=\"images/" . $this->formArray["sortOrder"] . "_order.png\" border=0 alt=\"" . ucfirst($this->formArray["sortOrder"]) . "ending\">"); $this->tpl->set_var("sortImageName", ""); } elseif ($this->formArray["sortKey"] == "ownerName") { $this->tpl->set_var("sortImageID", ""); $this->tpl->set_var("sortImageName", "<img src=\"images/" . $this->formArray["sortOrder"] . "_order.png\" border=0 alt=\"" . ucfirst($this->formArray["sortOrder"]) . "ending\">"); } if (count($list)) { $this->removeNotFoundBlock(); $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "TaxableYear", "TaxableYearBlock"); $this->tpl->set_block("RPTOPList", "OwnerList", "OwnerListBlock"); #$this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); #$this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); $i = 0; $buffer = array(); foreach ($list as $key => $value) { $buffer[$i]["rptopID"] = $value->getRptopID(); # $forDate = getdate(strtotime($value->getTaxableYear())); $buffer[$i]["taxableYear"] = $value->getTaxableYear(); $buffer[$i]["ownerName"] = ""; /* $this->tpl->set_var("rptopID", $value->getRptopID()); $forDate = getdate(strtotime($value->getRptopDate())); $this->tpl->set_var("rptopDate", $forDate['year']); */ $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $ownerRecord = array("ownerScript" => "PersonDetails.php", "ownerKey" => "personID", "ownerID" => $pValue->getPersonID(), "ownerName" => $pValue->getFullName()); $ownerRecords[] = $ownerRecord; $buffer[$i]["ownerRecords"] = $ownerRecords; $buffer[$i]["ownerName"] .= $pValue->getFullName(); /* $this->tpl->set_var("personID",$pValue->getPersonID()); $this->tpl->set_var("OwnerPerson",$pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); */ } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $ownerRecord = array("ownerScript" => "CompanyDetails.php", "ownerKey" => "companyID", "ownerID" => $cValue->getCompanyID(), "ownerName" => $cValue->getCompanyName()); $ownerRecords[] = $ownerRecord; $buffer[$i]["ownerRecords"] = $ownerRecords; $buffer[$i]["ownerName"] .= $cValue->getCompanyName(); /* $this->tpl->set_var("companyID",$cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany",$cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); */ } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } unset($ownerRecords); $i++; } #end foreach ($list) $buffer = $this->sortArray($buffer, $this->formArray["sortKey"], $this->formArray["sortOrder"]); for ($i = 0; $i < count($buffer); $i++) { //$this->tpl->set_var($buffer[$i]); $rptopRecord = $buffer[$i]; $ownerRecords = $rptopRecord["ownerRecords"]; $this->tpl->set_var("rptopID", $rptopRecord["rptopID"]); $this->tpl->set_var("taxableYear", $rptopRecord["taxableYear"]); if ($rptopRecord["ownerName"] == "") { $this->tpl->set_var("OwnerListBlock", ""); $this->tpl->set_var("none", "none"); } else { $this->tpl->set_var("OwnerListBlock", ""); foreach ($ownerRecords as $key => $ownerRecord) { $this->tpl->set_var("ownerScript", $ownerRecord["ownerScript"]); $this->tpl->set_var("ownerKey", $ownerRecord["ownerKey"]); $this->tpl->set_var("ownerID", $ownerRecord["ownerID"]); $this->tpl->set_var("ownerName", $ownerRecord["ownerName"]); $this->tpl->parse("OwnerListBlock", "OwnerList", true); } $this->tpl->set_var("none", ""); } //$this->tpl->set_var("totalAssessedValue", "00000"); //$this->tpl->set_var("totalTaxDue", "96876565765"); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } #end foreach ($list) } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } $this->tpl->set_var("page", $this->formArray["page"]); $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"); }
function Main() { switch ($this->formArray["formAction"]) { case "remove": $numberOfRecordsRemoved = 0; if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $numberOfRecordsRemoved = $RPTOPList->deleteRPTOP($this->formArray["rptopID"]); } $url = "&formAction=" . urlencode($this->formArray["previousFormAction"]); if ($this->formArray["previousFormAction"] == "search") { $url .= "&searchKey=" . urlencode($this->formArray["searchKey"]); } $url .= "&page=" . $this->formArray["page"]; $url .= "&searchKey=" . $this->formArray["searchKey"]; $url .= "&sortBy=" . $this->formArray["sortBy"]; $url .= "&sortOrder=" . $this->formArray["sortOrder"]; $url .= "&numberOfRecordsRemoved=" . $numberOfRecordsRemoved; header("location: RPTOPList.php" . $this->sess->url("") . $url); break; case "search": if ($this->formArray["numberOfRecordsRemoved"] == "" || $this->formArray["numberOfRecordsRemoved"] == 0) { $this->tpl->set_block("rptsTemplate", "RecordsRemovedMessage", "RecordsRemovedMessageBlock"); $this->tpl->set_var("RecordsRemovedMessageBlock", ""); } else { if ($this->formArray["numberOfRecordsRemoved"] == 1) { $this->tpl->set_var("plural", ""); } else { $this->tpl->set_var("plural", "s"); } } $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); if (!($count = $RPTOPList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->searchRPTOP($this->formArray["page"], $condition, $this->formArray["searchKey"]))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { //$totalTaxDue = "uncalculated"; $checkboxDisabled = ""; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { //$totalTaxDue = "uncalculated"; $checkboxDisabled = ""; } else { $checkboxDisabled = "disabled"; /* sum up total tax due $due = new Due; $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); */ } } } } else { $checkboxDisabled = ""; //$totalTaxDue = "no TD's"; } //if(is_numeric($totalTaxDue)) $totalTaxDue = formatCurrency($totalTaxDue); //$this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->tpl->set_var("checkboxDisabled", $checkboxDisabled); $checkboxDisabled = ""; $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } break; default: if ($this->formArray["numberOfRecordsRemoved"] == "" || $this->formArray["numberOfRecordsRemoved"] == 0) { $this->tpl->set_block("rptsTemplate", "RecordsRemovedMessage", "RecordsRemovedMessageBlock"); $this->tpl->set_var("RecordsRemovedMessageBlock", ""); } else { if ($this->formArray["numberOfRecordsRemoved"] == 1) { $this->tpl->set_var("plural", ""); } else { $this->tpl->set_var("plural", "s"); } } $this->tpl->set_var("msg", ""); $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $RPTOPList->getRPTOPCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->getRPTOPList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", ""); } else { $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { //$totalTaxDue = "uncalculated"; $checkboxDisabled = ""; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { //$totalTaxDue = "uncalculated"; $checkboxDisabled = ""; } else { $checkboxDisabled = "disabled"; /* sum up total tax due $due = new Due; $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); */ } } } } else { $checkboxDisabled = ""; //$totalTaxDue = "no TD's"; } //if(is_numeric($totalTaxDue)) $totalTaxDue = formatCurrency($totalTaxDue); //$this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->tpl->set_var("checkboxDisabled", $checkboxDisabled); $checkboxDisabled = ""; $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "filterPropertyType": $this->tpl->set_var("msg", ""); $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $condition = $this->filterArchives(); $searchKey = $this->formArray["propertyType"]; if (!($count = $TDList->filterPropertyTypeCount($this->formArray["propertyType"], $condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $TDList->filterByPropertyType($this->formArray["page"], $this->formArray["propertyType"], $condition))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock"); $this->tpl->set_var("TDTableBlock", ""); $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock"); $this->tpl->set_var("TDListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $tdRecords = new TDRecords(); $tdRecords->parseDomDocument($domDoc); $list = $tdRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("TDList", "PersonList", "PersonListBlock"); $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("tdID", $value->getTdID()); $this->tpl->set_var("afsID", $value->getAfsID()); $this->tpl->set_var("propertyID", $value->getPropertyID()); $this->tpl->set_var("propertyType", $value->getPropertyType()); $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear()); if ($value->getCeasesWithTheYear() == "") { $this->tpl->set_var("ceasesWithTheYear", ""); } else { $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear()); } $this->displayOwner($value->getAfsID()); $this->displayEffectivity($value->getAfsID()); $this->setTDListBlockPerms(); $this->tpl->parse("TDListBlock", "TDList", true); } } else { $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_var("TDListBlock", "huh"); } } } break; case "search": $this->tpl->set_var("msg", ""); $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $condition = $this->filterArchives(); if (!($count = $TDList->getSearchCount($this->formArray["searchKey"], $condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $TDList->searchTD($this->formArray["page"], $this->formArray["searchKey"], $condition))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock"); $this->tpl->set_var("TDTableBlock", ""); $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock"); $this->tpl->set_var("TDListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $tdRecords = new TDRecords(); $tdRecords->parseDomDocument($domDoc); $list = $tdRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("TDList", "PersonList", "PersonListBlock"); $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("tdID", $value->getTdID()); $this->tpl->set_var("afsID", $value->getAfsID()); $this->tpl->set_var("propertyID", $value->getPropertyID()); $this->tpl->set_var("propertyType", $value->getPropertyType()); $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear()); if ($value->getCeasesWithTheYear() == "") { $this->tpl->set_var("ceasesWithTheYear", ""); } else { $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear()); } $this->displayOwner($value->getAfsID()); $this->displayEffectivity($value->getAfsID()); $this->setTDListBlockPerms(); $this->tpl->parse("TDListBlock", "TDList", true); } } else { $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_var("TDListBlock", "huh"); } } } break; default: $this->tpl->set_var("msg", ""); $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $condition = $this->filterArchives(); if (!($count = $TDList->getTDCount($condition))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->filterArchives(); $condition .= $this->sortBlocks(); if (!($xmlStr = $TDList->getTDListForList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock"); $this->tpl->set_var("TDTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock"); $this->tpl->set_var("TDListTableBlock", ""); } else { $tdRecords = new TDRecords(); $tdRecords->parseDomDocument($domDoc); $list = $tdRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("TDList", "PersonList", "PersonListBlock"); $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("tdID", $value->getTdID()); $this->tpl->set_var("afsID", $value->getAfsID()); $this->tpl->set_var("propertyID", $value->getPropertyID()); $this->tpl->set_var("propertyType", $value->getPropertyType()); $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear()); if ($value->getCeasesWithTheYear() == "") { $this->tpl->set_var("ceasesWithTheYear", ""); } else { $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear()); } $this->displayOwner($value->getAfsID()); $this->displayEffectivity($value->getAfsID()); $this->setTDListBlockPerms(); $this->tpl->parse("TDListBlock", "TDList", true); } } else { $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_var("TDListBlock", "huh"); } } } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "search": $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); if (!($count = $PersonList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); if (!($xmlStr = $PersonList->searchPerson($this->formArray["searchKey"], $this->formArray["page"]))) { $this->tpl->set_block("rptsTemplate", "Found", "FoundBlock"); $this->tpl->set_var("FoundBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", "error xmlDoc"); } else { $personRecords = new PersonRecords(); $personRecords->parseDomDocument($domDoc); $list = $personRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("personID", $value->getPersonID()); if (!($pname = $value->getFullName())) { $pname = "none"; } $this->tpl->set_var("fullName", $pname); $this->tpl->set_var("tin", $value->getTin()); $this->tpl->set_var("telephone", $value->getTelephone()); $this->tpl->set_var("mobileNumber", $value->getMobileNumber()); $this->tpl->parse("PersonListBlock", "PersonList", true); } $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); } else { $this->tpl->set_block("rptsTemplate", "Found", "FoundBlock"); $this->tpl->set_var("FoundBlock", ""); } } } break; case "add": //$owner = new Owner; //foreach($this->formArray["personID"] as $key => $value){ // $owner->deleteOwnerPerson($value); // $owner->insertOwnerPerson($this->formArray["ownerID"],$value); //} //print_r($this->formArray["personID"]); $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); $OwnerList->addOwnerPerson($this->formArray["ownerID"], $this->formArray["personID"]); header("location: PersonSearchClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); break; default: $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", ""); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"], "afsID" => $this->formArray["afsID"], "searchKey" => $this->formArray["searchKey"], "formAction" => "search"))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { // $fp = fopen("batchCalculate.log", "w") or die("Couldn't create new file"); $numOfPages = 1; switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); if (!($deletedRows = $RPTOPList->deleteRPTOP($this->formArray["rptopID"]))) { $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 "cancel": header("location: RPTOPList.php"); exit; break; case "search": $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $count = $this->formArray["formAction"] == "search" ? $RPTOPList->getSearchCount($this->formArray["searchKey"]) : $RPTOPList->getRPTOPCount(); if (!$count) { $this->tpl->set_var("PagesBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = " ORDER BY " . RPTOP_TABLE . ".rptopID desc"; $xmlStr = $this->formArray["formAction"] == "search" ? $RPTOPList->searchRPTOP($this->formArray["page"], $condition, $this->formArray["searchKey"]) : $RPTOPList->getRPTOPList($this->formArray["page"]); break; default: $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $RPTOPList->getRPTOPCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = " ORDER BY " . RPTOP_TABLE . ".rptopID desc"; $xmlStr = $RPTOPList->getRPTOPList($this->formArray["page"], $condition); } /* switch ($this->formArray["formAction"]){ case "delete": if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ."RPTOPList.php", "urn:Object"); if (!$deletedRows = $RPTOPList->deleteRPTOP($this->formArray["rptopID"])){ $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 "cancel": header("location: RPTOPList.php"); exit; break; default: $this->tpl->set_var("msg", ""); } */ /* $RPTOPList = new SoapObject(NCCBIZ."RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $count = ($this->formArray["formAction"]=="search") ? $RPTOPList->getSearchCount($this->formArray["searchKey"]) : $RPTOPList->getRPTOPCount(); if (!$count){ $this->tpl->set_var("PagesBlock", ""); }else{ $numOfPages = ceil($count / PAGE_BY); for($i=1;$i<=$numOfPages;$i++){ if ($i==$this->formArray["page"]){ $this->tpl->set_var("pages",""); $this->tpl->set_var("paged",$i); }else{ $this->tpl->set_var("pages",$i); $this->tpl->set_var("paged",""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]){ $this->tpl->set_var("nextTxt", ""); }else{ $this->tpl->set_var("next", $this->formArray["page"]+1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1){ $this->tpl->set_var("previousTxt", ""); }else { $this->tpl->set_var("previous", $this->formArray["page"]-1); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"]." of ".$numOfPages); $xmlStr = ($this->formArray["formAction"]=="search") ? $RPTOPList->searchRPTOP($this->formArray["page"],"",$this->formArray["searchKey"]) : $RPTOPList->getRPTOPList($this->formArray["page"]); */ if (!$xmlStr) { $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", "page not found"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", "error xmlDoc"); } else { $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); //echo $this->formArray["sortOrder"]; if ($this->formArray["sortOrder"] == "") { $this->formArray["sortOrder"] = "desc"; } $this->tpl->set_var("sortOrder", $this->formArray["sortOrder"] == "asc" ? "desc" : "asc"); if ($this->formArray["sortKey"] == "rptopID") { $this->tpl->set_var("sortImageID", "<img src=\"images/" . $this->formArray["sortOrder"] . "_order.png\" border=0 alt=\"" . ucfirst($this->formArray["sortOrder"]) . "ending\">"); $this->tpl->set_var("sortImageName", ""); } elseif ($this->formArray["sortKey"] == "ownerName") { $this->tpl->set_var("sortImageID", ""); $this->tpl->set_var("sortImageName", "<img src=\"images/" . $this->formArray["sortOrder"] . "_order.png\" border=0 alt=\"" . ucfirst($this->formArray["sortOrder"]) . "ending\">"); } if (count($list)) { $this->removeNotFoundBlock(); $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "TaxableYear", "TaxableYearBlock"); $this->tpl->set_block("RPTOPList", "OwnerList", "OwnerListBlock"); $i = 0; $buffer = array(); foreach ($list as $key => $value) { $buffer[$i]["rptopID"] = $value->getRptopID(); # $forDate = getdate(strtotime($value->getTaxableYear())); $buffer[$i]["taxableYear"] = $value->getTaxableYear(); $buffer[$i]["ownerName"] = ""; $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $ownerRecord = array("ownerScript" => "PersonDetails.php", "ownerKey" => "personID", "ownerID" => $pValue->getPersonID(), "ownerName" => $pValue->getFullName()); $ownerRecords[] = $ownerRecord; $buffer[$i]["ownerRecords"] = $ownerRecords; $buffer[$i]["ownerName"] .= $pValue->getFullName(); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $ownerRecord = array("ownerScript" => "CompanyDetails.php", "ownerKey" => "companyID", "ownerID" => $cValue->getCompanyID(), "ownerName" => $cValue->getCompanyName()); $ownerRecords[] = $ownerRecord; $buffer[$i]["ownerRecords"] = $ownerRecords; $buffer[$i]["ownerName"] .= $cValue->getCompanyName(); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } unset($ownerRecords); /* $RPTOPDetails = new SoapObject(NCCBIZ."RPTOPDetails.php", "urn:Object"); if (!$xmlStr = $RPTOPDetails->getRPTOP($value->getRptopID())){ exit("xml failed"); }else{ fwrite($fp,"\r\nrptopid: ".$value->getRptopID()."\r\n"); if(!$domDoc = domxml_open_mem($xmlStr)) { echo "error xmlDoc"; }else { $rptop = new RPTOP; $td = new TD(); $rptop->parseDomDocument($domDoc); foreach($rptop as $key => $rvalue){ if ($key == "tdArray") { $tdCtr = 0; if (count($rvalue)){ foreach($rvalue as $tkey => $tvalue){ $td->selectRecord($tvalue->getTdID()); $assessedValue = number_format($td->getAssessedValue(),2,".",""); $taxDue = new Dues($tvalue->getTdID(), $this->formArray['taxableYear']); $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->setIdle($assessedValue); $taxDue->store(); fwrite($fp,"TD: ".$tvalue->getTdID()."...PROCESSED COMPLETE\r\n"); //$dueValues['basic'] = number_format($taxDue->getBasic(),2); //$dueValues['sef'] = number_format($taxDue->getSEF(),2); //$dueValues['total'] = number_format($taxDue->getBasic() + $taxDue->getSEF(),2); //$totalValues['totBasic'] += $taxDue->getBasic(); //$totalValues['totSEF'] += $taxDue->getSEF(); //$totalValues['totTotal'] += ($taxDue->getBasic() + $taxDue->getSEF()); //$totalValues['totAssessedValue'] += $assessedValue; //$tdValues['assessedValue'] = number_format($assessedValue,2); //$tdValues['tdNumber'] = $tvalue->getTaxDeclarationNumber(); //$tdValues['propertyIndexNumber'] = $PropertyIndexNumber; $tdCtr++; }#foreach $rvaklue blk }#if count(rvalue) }#if key="tdArray" }#rptopBlk }#else block !domDoc }#else !xmlstr*/ //$totalValues['totBasic'] = number_format($totalValues['totBasic'],2); //$totalValues['totSEF'] = number_format($totalValues['totSEF'],2); //$totalValues['totTotal'] = number_format($totalValues['totTotal'],2); //$totalValues['totAssessedValue'] = number_format($totalValues['totAssessedValue'],2); $i++; } #end foreach ($list) $buffer = $this->sortArray($buffer, $this->formArray["sortKey"], $this->formArray["sortOrder"]); for ($i = 0; $i < count($buffer); $i++) { //$this->tpl->set_var($buffer[$i]); $rptopRecord = $buffer[$i]; $ownerRecords = $rptopRecord["ownerRecords"]; $this->tpl->set_var("rptopID", $rptopRecord["rptopID"]); $this->tpl->set_var("taxableYear", $rptopRecord["taxableYear"]); if ($rptopRecord["ownerName"] == "") { $this->tpl->set_var("OwnerListBlock", ""); $this->tpl->set_var("none", "none"); } else { $this->tpl->set_var("OwnerListBlock", ""); foreach ($ownerRecords as $key => $ownerRecord) { $this->tpl->set_var("ownerScript", $ownerRecord["ownerScript"]); $this->tpl->set_var("ownerKey", $ownerRecord["ownerKey"]); $this->tpl->set_var("ownerID", $ownerRecord["ownerID"]); $this->tpl->set_var("ownerName", $ownerRecord["ownerName"]); $this->tpl->parse("OwnerListBlock", "OwnerList", true); } $this->tpl->set_var("none", ""); } //$this->tpl->set_var("totalAssessedValue", "00000"); //$this->tpl->set_var("totalTaxDue", "96876565765"); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } #end if countlist } #end else domDoc } #end else xmlstr $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->setPageDetailPerms(); $this->tpl->set_var("page", $this->formArray["page"]); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); if (!($deletedRows = $RPTOPList->deleteRPTOP($this->formArray["rptopID"]))) { $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 "search": $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); if (!($count = $RPTOPList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->searchRPTOP($this->formArray["page"], $condition, $this->formArray["searchKey"]))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } break; case "cancel": header("location: RPTOPList.php"); exit; break; default: $this->tpl->set_var("msg", ""); $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $RPTOPList->getRPTOPCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->getRPTOPList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", ""); } else { $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["odID"]) > 0) { $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); if (!($deletedRows = $ODList->deleteOD($this->formArray["odID"]))) { $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 "search": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); if (!($count = $ODList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); $numOfPages = 1; } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $condition = $this->sortBlocks(); $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); if (!($xmlStr = $ODList->searchOD($this->formArray["page"], $condition, $this->formArray["searchKey"]))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock"); $this->tpl->set_var("ODTableBlock", ""); $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "ODListTable", "ODListTableBlock"); $this->tpl->set_var("ODListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_block("ODList", "PersonList", "PersonListBlock"); $this->tpl->set_block("ODList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("odID", $value->getOdID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //echo method_exists($value->location,getFullAddress); $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); $this->tpl->set_var("landArea", number_format($value->getLandArea(), 2, '.', ',')); $this->tpl->parse("ODListBlock", "ODList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("ODListBlock", "huh"); } } } break; case "cancel": header("location: ODList.php"); exit; break; default: $this->tpl->set_var("msg", ""); $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $ODList->getODCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"] || $numOfPages == "") { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->sortBlocks(); if (!($xmlStr = $ODList->getODList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock"); $this->tpl->set_var("ODTableBlock", ""); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "ODListTable", "ODListTableBlock"); $this->tpl->set_var("ODListTableBlock", ""); } else { $odRecords = new ODRecords(); $odRecords->parseDomDocument($domDoc); $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "ODDBEmpty", "ODDBEmptyBlock"); $this->tpl->set_var("ODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_block("ODList", "PersonList", "PersonListBlock"); $this->tpl->set_block("ODList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { //print_r($value); //echo "<br>"; $this->tpl->set_var("odID", $value->getOdID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } //*/ //if (method_exists($value->locationAddress,$value->locationAddress->getFullAddress())) if ($value->locationAddress != "") { $this->tpl->set_var("locationAddress", $value->locationAddress->getFullAddress()); } $this->tpl->set_var("landArea", number_format($value->getLandArea(), 2, '.', ',')); $this->tpl->parse("ODListBlock", "ODList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("ODListBlock", "huh"); } } } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); if (!($deletedRows = $RPTOPList->deleteRPTOP($this->formArray["rptopID"]))) { $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 "updateCalculation": if (is_array($this->formArray["rptopID"])) { $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $DueEncode = new SoapObject(NCCBIZ . "DueEncode.php", "urn:Object"); $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object"); $dueIDArray = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => ""); $treasurySettings = new TreasurySettings(); $treasurySettings->selectRecord(); $this->formArray["masterBasicTaxRate"] = $treasurySettings->getPctRPTax(); $this->formArray["masterSEFTaxRate"] = $treasurySettings->getPctSEF(); $this->formArray["masterIdleTaxRate"] = $treasurySettings->getPctIdle(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $this->formArray["annualDueDate"] = $treasurySettings->getAnnualDueDate(); foreach ($this->formArray["rptopID"] as $rptopID) { if (!($xmlStr = $RPTOPDetails->getRPTOP($rptopID))) { // error xmlStr } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); $this->formArray["taxableYear"] = $rptop->getTaxableYear(); $tdArray = $rptop->getTDArray(); if (is_array($tdArray)) { foreach ($tdArray as $td) { $this->formArray["assessedValue"] = ""; $this->formArray["taxability"] = ""; $this->formArray["idle"] = ""; $this->formArray["tdID"] = $td->getTdID(); $this->formArray["dueID"] = ""; $this->formArray["propertyType"] = $td->getPropertyType(); if (!($afsXmlStr = $AFSDetails->getAFS($td->getAfsID()))) { // error afsXmlStr } else { if (!($afsDomDoc = domxml_open_mem($afsXmlStr))) { // error afsDomDoc } else { $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); $this->formArray["assessedValue"] = $afs->getTotalAssessedValue(); $this->formArray["taxability"] = $afs->getTaxability(); $this->formArray["effectivity"] = $afs->getEffectivity(); $this->formArray["dueDate"] = date("Y-n-d", strtotime($this->formArray["taxableYear"] . "-" . $this->formArray["annualDueDate"])); if ($this->formArray["propertyType"] == "Land") { if (is_array($afs->getLandArray())) { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } } if (!($dueXmlStr = $DueList->getDueList($td->getTdID(), $rptop->getTaxableYear()))) { $this->formArray["dueID"] = ""; $dueIDArray["Annual"] = ""; } else { if (!($dueDomDoc = domxml_open_mem($dueXmlStr))) { $this->formArray["dueID"] = ""; $dueIDArray["Annual"] = ""; } else { //print_r(htmlspecialchars($xmlStr)); //exit; $dueRecords = new DueRecords(); $dueRecords->parseDomDocument($dueDomDoc); foreach ($dueRecords->getArrayList() as $due) { foreach ($due as $dueKey => $dueValue) { switch ($dueKey) { case "dueType": $dueIDArray[$dueValue] = $due->getDueID(); break; } } } $this->formArray["dueID"] = $dueIDArray["Annual"]; } } $this->formArray["basicTaxRate"] = $this->formArray["masterBasicTaxRate"]; $this->formArray["sefTaxRate"] = $this->formArray["masterSEFTaxRate"]; $this->formArray["idleTaxRate"] = $this->formArray["masterIdleTaxRate"]; $this->formArray["basicTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["basicTaxRate"]; $this->formArray["sefTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["sefTaxRate"]; // if land->idle is "Yes", compute idleTax, otherwise set idleTax to zero if ($this->formArray["propertyType"] == "Land") { if ($this->formArray["idle"] == "Yes") { $this->formArray["idleTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["idleTaxRate"]; } else { $this->formArray["idleTax"] = "0.00"; } } // if afs->taxability is "Exempt", reset computations to zero. if ($this->formArray["taxability"] == "Exempt") { $this->formArray["basicTax"] = "0.00"; $this->formArray["sefTax"] = "0.00"; $this->formArray["idleTax"] = "0.00"; } if ($dueIDArray["Annual"] != "") { $dueArray = $this->setDues(); foreach ($dueArray as $due) { $doc = $due->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $DueEncode->updateDue($xmlStr))) { // error update } unset($doc); unset($xmlStr); } } else { $dueArray = $this->setDues(); foreach ($dueArray as $due) { $doc = $due->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $DueEncode->saveDue($xmlStr))) { // error save } unset($doc); unset($xmlStr); } } $this->formArray["taxableYear"] = $rptop->getTaxableYear(); $this->refreshTDHistory($td); } } unset($tdArray); } } } } if ($this->formArray["searchKey"] != "") { $this->formArray["formAction"] = "search"; } else { $this->formArray["formAction"] = ""; } header("Location: CalculateRPTOPBatch.php" . $this->sess->url("") . "&page=" . $this->formArray["page"] . "&sortBy=" . $this->formArray["sortBy"] . "&sortOrder=" . $this->formArray["sortOrder"] . "&formAction=" . $this->formArray["formAction"] . "&searchKey=" . $this->formArray["searchKey"]); exit; break; case "search": $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); if (!($count = $RPTOPList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->searchRPTOP($this->formArray["page"], $condition, $this->formArray["searchKey"]))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxableYear", $value->getTaxableYear()); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { $totalTaxDue = "uncalculated"; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $totalTaxDue = "uncalculated"; } else { $due = new Due(); $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); } } } } else { $totalTaxDue = "no TD's"; } if (is_numeric($totalTaxDue)) { $totalTaxDue = formatCurrency($totalTaxDue); } $this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } break; case "cancel": header("location: CalculateRPTOPBatch.php"); exit; break; default: $this->tpl->set_var("msg", ""); $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $RPTOPList->getRPTOPCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->getRPTOPList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", ""); } else { $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxableYear", $value->getTaxableYear()); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { $totalTaxDue = "uncalculated"; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $totalTaxDue = "uncalculated"; } else { $due = new Due(); $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); } } } } else { $totalTaxDue = "no TD's"; } if (is_numeric($totalTaxDue)) { $totalTaxDue = formatCurrency($totalTaxDue); } $this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }