Пример #1
0
 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");
 }
Пример #2
0
 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");
 }
Пример #3
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         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($condition))) {
                 $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);
             }
             if (!($xmlStr = $ODList->getODList(0, $condition))) {
                 $this->tpl->set_block("rptsTemplate", "ODTable", "ODTableBlock");
                 $this->tpl->set_var("ODTableBlock", "");
                 $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 {
                 echo $xmlStr;
                 exit;
                 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_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());
                             $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");
 }
Пример #4
0
 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");
 }
Пример #5
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "view":
             $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object");
             $condition = $this->filterLocationAddress();
             $condition .= $this->filterArchives();
             if (!($xmlStr = $ODList->getODList(0, $condition))) {
                 $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                 $this->tpl->set_var("message", "properties not found");
                 $this->tpl->parse("NotFoundBlock", "NotFound", true);
                 $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
                 $this->tpl->set_var("ReportBlock", "");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                     $this->tpl->set_var("message", "properties not found");
                     $this->tpl->parse("NotFoundBlock", "NotFound", true);
                     $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
                     $this->tpl->set_var("ReportBlock", "");
                 } else {
                     $odRecords = new ODRecords();
                     $odRecords->parseDomDocument($domDoc);
                     $list = $odRecords->getArrayList();
                     if (count($list)) {
                         $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                         $this->tpl->set_var("NotFoundBlock", "");
                         $this->tpl->set_block("rptsTemplate", "ReportList", "ReportListBlock");
                         foreach ($list as $key => $value) {
                             $this->tpl->set_var("odID", $value->getOdID());
                             $afs = $this->getAFSDetails($value->getOdID());
                             $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber());
                             $this->tpl->set_var("arpNumber", $afs->getArpNumber());
                             $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ','));
                             $landList = $afs->getLandArray();
                             $plantsTreesList = $afs->getPlantsTreesArray();
                             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
                             $machineriesList = $afs->getMachineriesArray();
                             $this->tpl->set_var("taxability", $afs->getTaxability());
                             $this->tpl->set_var("effectivity", $afs->getEffectivity());
                             $kind = "";
                             $class = "";
                             if (count($landList)) {
                                 $kind = "Land";
                                 $land = $landList[0];
                                 $class = $land->getClassification();
                                 $landClasses = new LandClasses();
                                 $landClasses->selectRecord($class);
                                 $class = $landClasses->getDescription();
                             } else {
                                 if (count($plantsTreesList)) {
                                     $kind = "Land";
                                     $plantsTrees = $plantsTreesList[0];
                                     $class = $plantsTrees->getProductClass();
                                     $plantsTreesClasses = new PlantsTreesClasses();
                                     $plantsTreesClasses->selectRecord($class);
                                     $class = $plantsTreesClasses->getDescription();
                                 } else {
                                     if (count($improvementsBuildingsList)) {
                                         $kind = "Improvements/Buildings";
                                         $improvementsBuildings = $improvementsBuildingsList[0];
                                         $class = $improvementsBuildings->getBuildingClassification();
                                         $improvementsBuildingsClasses = new ImprovementsBuildingsClasses();
                                         $improvementsBuildingsClasses->selectRecord($class);
                                         $class = $improvementsBuildingsClasses->getDescription();
                                     } else {
                                         if (count($machineriesList)) {
                                             $kind = "Machineries";
                                             $machineries = $machineriesList[0];
                                             $class = $machineries->getKind();
                                         }
                                     }
                                 }
                             }
                             $this->tpl->set_var("kind", $kind);
                             $this->tpl->set_var("class", $class);
                             $oValue = $value->owner;
                             if (count($oValue->personArray)) {
                                 $firstOwner = $oValue->personArray[0]->getLastName();
                                 $firstOwner .= ", ";
                                 $firstOwner .= $oValue->personArray[0]->getFirstName();
                                 $firstOwner .= " ";
                                 $firstOwner .= substr($oValue->personArray[0]->getMiddleName(), 0, 1) . ".";
                                 $pAddress = $oValue->personArray[0]->addressArray ? $oValue->personArray[0]->addressArray[0]->getFullAddress() : "no address";
                                 $firstOwnerAddress = $pAddress;
                                 $firstOwnerTelephone = $oValue->personArray[0]->getTelephone();
                                 $this->tpl->set_var("firstOwner", $firstOwner);
                                 $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress);
                                 $this->tpl->set_var("firstOwnerTelephone", $firstOwnerTelephone);
                             }
                             if (count($oValue->companyArray)) {
                                 if ($firstOwner == "") {
                                     $firstOwner = $oValue->companyArray[0]->getCompanyName();
                                     $cAddress = $oValue->companyArray[0]->addressArray ? $oValue->companyArray[0]->addressArray[0]->getFullAddress() : "no address";
                                     $firstOwnerAddress = $cAddress;
                                     $firstOwnerTelephone = $oValue->companyArray[0]->getTelephone();
                                     $this->tpl->set_var("firstOwner", $firstOwner);
                                     $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress);
                                     $this->tpl->set_var("firstOwnerTelephone", $firstOwnerTelephone);
                                 }
                             }
                             if ($firstOwner != "") {
                                 $this->tpl->set_var("none", "");
                                 if (count($oValue->personArray) + count($oValue->companyArray) > 1) {
                                     $this->tpl->set_var("andOthers", "(and others)");
                                 } else {
                                     $this->tpl->set_var("andOthers", "");
                                 }
                             } else {
                                 $this->tpl->set_var("none", "none");
                                 $this->tpl->set_var("firstOwner", "");
                                 $this->tpl->set_var("andOthers", "");
                                 $this->tpl->set_var("firstOwnerAddress", "");
                                 $this->tpl->set_var("firstOwnerTelephone", "");
                             }
                             $locationAddress = $value->locationAddress->getNumber();
                             $locationAddress .= " ";
                             $locationAddress .= $value->locationAddress->getStreet();
                             $this->tpl->set_var("locationAddress", $locationAddress);
                             $this->tpl->parse("ReportListBlock", "ReportList", true);
                         }
                     }
                 }
             }
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
             $this->tpl->set_var("message", "select a location to view report");
             $this->tpl->parse("NotFoundBlock", "NotFound", true);
             $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
             $this->tpl->set_var("ReportBlock", "");
             break;
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->set_var("rpts_Session", $this->sess->id);
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }