Example #1
0
 function removeTD($tdIDArray)
 {
     $tdRecords = new TDRecords();
     $rows = $tdRecords->removeRecords($tdIDArray);
     return $rows;
 }
Example #2
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "archive":
             $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object");
             $tdIDArray = $this->formArray["tdIDArray"];
             $archiveValue = $this->formArray["archiveValue"];
             $userID = $this->formArray["uid"];
             if (!($archiveRows = $TDList->archiveTD($tdIDArray, $archiveValue, $userID))) {
                 $this->tpl->set_var("msg", "SOAP failed");
             } else {
                 $sess = $this->sess->name . "=" . $this->sess->id;
                 header("Location: TDList.php?" . $sess . "&viewArchives=" . $this->formArray["viewArchives"]);
                 exit;
             }
             break;
         case "search":
             $this->tpl->set_var("msg", "");
             $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object");
             $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
             $condition = $this->filterArchives();
             if (!($count = $TDList->getSearchCount($this->formArray["searchKey"], $condition))) {
                 $this->tpl->set_var("PagesBlock", "");
                 $numOfPages = 1;
                 $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock");
                 $this->tpl->set_var("PageNavigatorBlock", "");
             } else {
                 $numOfPages = ceil($count / PAGE_BY);
                 for ($i = 1; $i <= $numOfPages; $i++) {
                     if ($i == $this->formArray["page"]) {
                         $this->tpl->set_var("pages", "");
                         $this->tpl->set_var("pagesUrl", "");
                         $this->tpl->set_var("paged", $i);
                     } else {
                         $this->tpl->set_var("pages", $i);
                         $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"]));
                         $this->tpl->set_var("paged", "");
                     }
                     $this->tpl->parse("PagesBlock", "Pages", true);
                 }
             }
             if ($numOfPages == $this->formArray["page"]) {
                 $this->tpl->set_var("nextTxt", "");
             } else {
                 $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"]));
                 $this->tpl->set_var("nextTxt", "next");
             }
             if ($this->formArray["page"] == 1) {
                 $this->tpl->set_var("previousTxt", "");
             } else {
                 $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"]));
                 $this->tpl->set_var("previousTxt", "previous");
             }
             $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages);
             $condition = $this->filterArchives();
             $condition .= $this->sortBlocks();
             if (!($xmlStr = $TDList->searchTD($this->formArray["page"], $this->formArray["searchKey"], $condition))) {
                 $this->tpl->set_var("pageOf", "");
                 $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock");
                 $this->tpl->set_var("TDTableBlock", "");
                 $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                 $this->tpl->set_var("TDDBEmptyBlock", "");
                 $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_var("previousTxt", "");
                 $this->tpl->set_var("nextTxt", "");
                 $this->tpl->set_block("rptsTemplate", "ArchiveButton", "ArchiveButtonBlock");
                 $this->tpl->set_var("ArchiveButtonBlock", "");
                 $this->tpl->set_block("rptsTemplate", "UnArchiveButton", "UnArchiveButtonBlock");
                 $this->tpl->set_var("UnArchiveButtonBlock", "");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock");
                     $this->tpl->set_var("TDListTableBlock", "error xmlDoc");
                 } else {
                     $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                     $this->tpl->set_var("NotFoundBlock", "");
                     $tdRecords = new TDRecords();
                     $tdRecords->parseDomDocument($domDoc);
                     $list = $tdRecords->getArrayList();
                     if (count($list)) {
                         $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                         $this->tpl->set_var("TDDBEmptyBlock", "");
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_block("TDList", "PersonList", "PersonListBlock");
                         $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock");
                         foreach ($list as $key => $value) {
                             $this->tpl->set_var("tdID", $value->getTdID());
                             $this->tpl->set_var("afsID", $value->getAfsID());
                             $this->tpl->set_var("propertyID", $value->getPropertyID());
                             $this->tpl->set_var("propertyType", $value->getPropertyType());
                             $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber());
                             $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear());
                             if ($value->getCeasesWithTheYear() == "") {
                                 $this->tpl->set_var("ceasesWithTheYear", "");
                             } else {
                                 $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear());
                             }
                             $this->displayOwner($value->getAfsID());
                             $this->tpl->parse("TDListBlock", "TDList", true);
                         }
                     } else {
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_var("TDListBlock", "huh");
                     }
                 }
             }
             break;
         default:
             $this->tpl->set_var("msg", "");
             $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object");
             $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
             $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
             $this->tpl->set_var("NotFoundBlock", "");
             $condition = $this->filterArchives();
             if (!($count = $TDList->getTDCount($condition))) {
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock");
                 $this->tpl->set_var("PageNavigatorBlock", "");
             } else {
                 $numOfPages = ceil($count / PAGE_BY);
                 for ($i = 1; $i <= $numOfPages; $i++) {
                     if ($i == $this->formArray["page"]) {
                         $this->tpl->set_var("pages", "");
                         $this->tpl->set_var("pagesUrl", "");
                         $this->tpl->set_var("paged", $i);
                     } else {
                         $this->tpl->set_var("pages", $i);
                         $this->tpl->set_var("pagesUrl", $i);
                         $this->tpl->set_var("paged", "");
                     }
                     $this->tpl->parse("PagesBlock", "Pages", true);
                 }
             }
             if ($numOfPages == $this->formArray["page"]) {
                 $this->tpl->set_var("nextTxt", "");
             } else {
                 $this->tpl->set_var("next", $this->formArray["page"] + 1);
                 $this->tpl->set_var("nextTxt", "next");
             }
             if ($this->formArray["page"] == 1) {
                 $this->tpl->set_var("previousTxt", "");
             } else {
                 $this->tpl->set_var("previous", $this->formArray["page"] - 1);
                 $this->tpl->set_var("previousTxt", "previous");
             }
             if ($numOfPages == "") {
                 $this->tpl->set_var("pageOf", "");
             } else {
                 $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages);
             }
             $condition = $this->filterArchives();
             $condition .= $this->sortBlocks();
             if (!($xmlStr = $TDList->getTDListForList($this->formArray["page"], $condition))) {
                 $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock");
                 $this->tpl->set_var("TDTableBlock", "");
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock");
                 $this->tpl->set_var("PageNavigatorBlock", "");
                 $this->tpl->set_block("rptsTemplate", "ArchiveButton", "ArchiveButtonBlock");
                 $this->tpl->set_var("ArchiveButtonBlock", "");
                 $this->tpl->set_block("rptsTemplate", "UnArchiveButton", "UnArchiveButtonBlock");
                 $this->tpl->set_var("UnArchiveButtonBlock", "");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock");
                     $this->tpl->set_var("TDListTableBlock", "");
                 } else {
                     $tdRecords = new TDRecords();
                     $tdRecords->parseDomDocument($domDoc);
                     $list = $tdRecords->getArrayList();
                     if (count($list)) {
                         $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                         $this->tpl->set_var("TDDBEmptyBlock", "");
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_block("TDList", "PersonList", "PersonListBlock");
                         $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock");
                         foreach ($list as $key => $value) {
                             $this->tpl->set_var("tdID", $value->getTdID());
                             $this->tpl->set_var("afsID", $value->getAfsID());
                             $this->tpl->set_var("propertyID", $value->getPropertyID());
                             $this->tpl->set_var("propertyType", $value->getPropertyType());
                             $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber());
                             $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear());
                             if ($value->getCeasesWithTheYear() == "") {
                                 $this->tpl->set_var("ceasesWithTheYear", "");
                             } else {
                                 $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear());
                             }
                             $this->displayOwner($value->getAfsID());
                             $this->tpl->parse("TDListBlock", "TDList", true);
                         }
                     } else {
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_var("TDListBlock", "huh");
                     }
                 }
             }
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Example #3
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "filterPropertyType":
             $this->tpl->set_var("msg", "");
             $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object");
             $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
             $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock");
             $condition = $this->filterArchives();
             $searchKey = $this->formArray["propertyType"];
             if (!($count = $TDList->filterPropertyTypeCount($this->formArray["propertyType"], $condition))) {
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_var("PagesListBlock", "");
                 $numOfPages = 1;
                 $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock");
                 $this->tpl->set_var("PageNavigatorBlock", "");
             } else {
                 $numOfPages = ceil($count / PAGE_BY);
                 // page list nav
                 $this->formArray["pageLinksInLine"] = 7;
                 if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) {
                     $startPageLinks = 1;
                 } else {
                     $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2);
                     if ($startPageLinks < 1) {
                         $startPageLinks = 1;
                     }
                 }
                 $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1);
                 if ($endPageLinks > $numOfPages) {
                     $endPageLinks = $numOfPages;
                 }
                 for ($i = $startPageLinks; $i <= $endPageLinks; $i++) {
                     if ($i == $this->formArray["page"]) {
                         $this->tpl->set_var("pageListPages", "");
                         $this->tpl->set_var("pageListPagesUrl", "");
                         $this->tpl->set_var("pageListPaged", $i);
                     } else {
                         $this->tpl->set_var("pageListPages", $i);
                         $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"]));
                         $this->tpl->set_var("pageListPaged", "");
                     }
                     $this->tpl->parse("PagesListBlock", "PagesList", true);
                 }
                 // drop down nav
                 for ($i = 1; $i <= $numOfPages; $i++) {
                     if ($i == $this->formArray["page"]) {
                         $this->tpl->set_var("pages", $i);
                         $this->tpl->set_var("pagesUrl", $i . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"]));
                         $this->tpl->set_var("paged", "selected");
                     } else {
                         $this->tpl->set_var("pages", $i);
                         $this->tpl->set_var("pagesUrl", $i . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"]));
                         $this->tpl->set_var("paged", "");
                     }
                     $this->tpl->parse("PagesBlock", "Pages", true);
                 }
             }
             if ($numOfPages == $this->formArray["page"]) {
                 $this->tpl->set_var("nextTxt", "");
             } else {
                 $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"]));
                 $this->tpl->set_var("nextTxt", "next");
             }
             if ($this->formArray["page"] == 1) {
                 $this->tpl->set_var("previousTxt", "");
             } else {
                 $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=filterPropertyType&propertyType=" . urlencode($this->formArray["propertyType"]));
                 $this->tpl->set_var("previousTxt", "previous");
             }
             $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages);
             $condition = $this->filterArchives();
             $condition .= $this->sortBlocks();
             if (!($xmlStr = $TDList->filterByPropertyType($this->formArray["page"], $this->formArray["propertyType"], $condition))) {
                 $this->tpl->set_var("pageOf", "");
                 $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock");
                 $this->tpl->set_var("TDTableBlock", "");
                 $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                 $this->tpl->set_var("TDDBEmptyBlock", "");
                 $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_var("PagesListBlock", "");
                 $this->tpl->set_var("previousTxt", "");
                 $this->tpl->set_var("nextTxt", "");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock");
                     $this->tpl->set_var("TDListTableBlock", "error xmlDoc");
                 } else {
                     $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                     $this->tpl->set_var("NotFoundBlock", "");
                     $tdRecords = new TDRecords();
                     $tdRecords->parseDomDocument($domDoc);
                     $list = $tdRecords->getArrayList();
                     if (count($list)) {
                         $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                         $this->tpl->set_var("TDDBEmptyBlock", "");
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_block("TDList", "PersonList", "PersonListBlock");
                         $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock");
                         foreach ($list as $key => $value) {
                             $this->tpl->set_var("tdID", $value->getTdID());
                             $this->tpl->set_var("afsID", $value->getAfsID());
                             $this->tpl->set_var("propertyID", $value->getPropertyID());
                             $this->tpl->set_var("propertyType", $value->getPropertyType());
                             $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber());
                             $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear());
                             if ($value->getCeasesWithTheYear() == "") {
                                 $this->tpl->set_var("ceasesWithTheYear", "");
                             } else {
                                 $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear());
                             }
                             $this->displayOwner($value->getAfsID());
                             $this->displayEffectivity($value->getAfsID());
                             $this->setTDListBlockPerms();
                             $this->tpl->parse("TDListBlock", "TDList", true);
                         }
                     } else {
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_var("TDListBlock", "huh");
                     }
                 }
             }
             break;
         case "search":
             $this->tpl->set_var("msg", "");
             $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object");
             $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
             $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock");
             $condition = $this->filterArchives();
             if (!($count = $TDList->getSearchCount($this->formArray["searchKey"], $condition))) {
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_var("PagesListBlock", "");
                 $numOfPages = 1;
                 $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock");
                 $this->tpl->set_var("PageNavigatorBlock", "");
             } else {
                 $numOfPages = ceil($count / PAGE_BY);
                 // page list nav
                 $this->formArray["pageLinksInLine"] = 7;
                 if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) {
                     $startPageLinks = 1;
                 } else {
                     $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2);
                     if ($startPageLinks < 1) {
                         $startPageLinks = 1;
                     }
                 }
                 $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1);
                 if ($endPageLinks > $numOfPages) {
                     $endPageLinks = $numOfPages;
                 }
                 for ($i = $startPageLinks; $i <= $endPageLinks; $i++) {
                     if ($i == $this->formArray["page"]) {
                         $this->tpl->set_var("pageListPages", "");
                         $this->tpl->set_var("pageListPagesUrl", "");
                         $this->tpl->set_var("pageListPaged", $i);
                     } else {
                         $this->tpl->set_var("pageListPages", $i);
                         $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"]));
                         $this->tpl->set_var("pageListPaged", "");
                     }
                     $this->tpl->parse("PagesListBlock", "PagesList", true);
                 }
                 // drop down nav
                 for ($i = 1; $i <= $numOfPages; $i++) {
                     if ($i == $this->formArray["page"]) {
                         $this->tpl->set_var("pages", $i);
                         $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"]));
                         $this->tpl->set_var("paged", "selected");
                     } else {
                         $this->tpl->set_var("pages", $i);
                         $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"]));
                         $this->tpl->set_var("paged", "");
                     }
                     $this->tpl->parse("PagesBlock", "Pages", true);
                 }
             }
             if ($numOfPages == $this->formArray["page"]) {
                 $this->tpl->set_var("nextTxt", "");
             } else {
                 $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"]));
                 $this->tpl->set_var("nextTxt", "next");
             }
             if ($this->formArray["page"] == 1) {
                 $this->tpl->set_var("previousTxt", "");
             } else {
                 $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"]));
                 $this->tpl->set_var("previousTxt", "previous");
             }
             $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages);
             $condition = $this->filterArchives();
             $condition .= $this->sortBlocks();
             if (!($xmlStr = $TDList->searchTD($this->formArray["page"], $this->formArray["searchKey"], $condition))) {
                 $this->tpl->set_var("pageOf", "");
                 $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock");
                 $this->tpl->set_var("TDTableBlock", "");
                 $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                 $this->tpl->set_var("TDDBEmptyBlock", "");
                 $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_var("PagesListBlock", "");
                 $this->tpl->set_var("previousTxt", "");
                 $this->tpl->set_var("nextTxt", "");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock");
                     $this->tpl->set_var("TDListTableBlock", "error xmlDoc");
                 } else {
                     $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                     $this->tpl->set_var("NotFoundBlock", "");
                     $tdRecords = new TDRecords();
                     $tdRecords->parseDomDocument($domDoc);
                     $list = $tdRecords->getArrayList();
                     if (count($list)) {
                         $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                         $this->tpl->set_var("TDDBEmptyBlock", "");
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_block("TDList", "PersonList", "PersonListBlock");
                         $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock");
                         foreach ($list as $key => $value) {
                             $this->tpl->set_var("tdID", $value->getTdID());
                             $this->tpl->set_var("afsID", $value->getAfsID());
                             $this->tpl->set_var("propertyID", $value->getPropertyID());
                             $this->tpl->set_var("propertyType", $value->getPropertyType());
                             $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber());
                             $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear());
                             if ($value->getCeasesWithTheYear() == "") {
                                 $this->tpl->set_var("ceasesWithTheYear", "");
                             } else {
                                 $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear());
                             }
                             $this->displayOwner($value->getAfsID());
                             $this->displayEffectivity($value->getAfsID());
                             $this->setTDListBlockPerms();
                             $this->tpl->parse("TDListBlock", "TDList", true);
                         }
                     } else {
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_var("TDListBlock", "huh");
                     }
                 }
             }
             break;
         default:
             $this->tpl->set_var("msg", "");
             $TDList = new SoapObject(NCCBIZ . "TDList.php", "urn:Object");
             $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock");
             $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock");
             $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
             $this->tpl->set_var("NotFoundBlock", "");
             $condition = $this->filterArchives();
             if (!($count = $TDList->getTDCount($condition))) {
                 $this->tpl->set_var("PagesBlock", "");
                 $this->tpl->set_var("PagesListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "PageNavigator", "PagesBlock");
                 $this->tpl->set_var("PageNavigatorBlock", "");
             } else {
                 $numOfPages = ceil($count / PAGE_BY);
                 // page list nav
                 $this->formArray["pageLinksInLine"] = 7;
                 if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) {
                     $startPageLinks = 1;
                 } else {
                     $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2);
                     if ($startPageLinks < 1) {
                         $startPageLinks = 1;
                     }
                 }
                 $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1);
                 if ($endPageLinks > $numOfPages) {
                     $endPageLinks = $numOfPages;
                 }
                 for ($i = $startPageLinks; $i <= $endPageLinks; $i++) {
                     if ($i == $this->formArray["page"]) {
                         $this->tpl->set_var("pageListPages", "");
                         $this->tpl->set_var("pageListPagesUrl", "");
                         $this->tpl->set_var("pageListPaged", $i);
                     } else {
                         $this->tpl->set_var("pageListPages", $i);
                         $this->tpl->set_var("pageListPagesUrl", $i);
                         $this->tpl->set_var("pageListPaged", "");
                     }
                     $this->tpl->parse("PagesListBlock", "PagesList", true);
                 }
                 // drop down nav
                 for ($i = 1; $i <= $numOfPages; $i++) {
                     if ($i == $this->formArray["page"]) {
                         $this->tpl->set_var("pages", $i);
                         $this->tpl->set_var("pagesUrl", $i);
                         $this->tpl->set_var("paged", "selected");
                     } else {
                         $this->tpl->set_var("pages", $i);
                         $this->tpl->set_var("pagesUrl", $i);
                         $this->tpl->set_var("paged", "");
                     }
                     $this->tpl->parse("PagesBlock", "Pages", true);
                 }
             }
             if ($numOfPages == $this->formArray["page"]) {
                 $this->tpl->set_var("nextTxt", "");
             } else {
                 $this->tpl->set_var("next", $this->formArray["page"] + 1);
                 $this->tpl->set_var("nextTxt", "next");
             }
             if ($this->formArray["page"] == 1) {
                 $this->tpl->set_var("previousTxt", "");
             } else {
                 $this->tpl->set_var("previous", $this->formArray["page"] - 1);
                 $this->tpl->set_var("previousTxt", "previous");
             }
             if ($numOfPages == "") {
                 $this->tpl->set_var("pageOf", "");
             } else {
                 $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages);
             }
             $condition = $this->filterArchives();
             $condition .= $this->sortBlocks();
             if (!($xmlStr = $TDList->getTDListForList($this->formArray["page"], $condition))) {
                 $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock");
                 $this->tpl->set_var("TDTableBlock", "");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "TDListTable", "TDListTableBlock");
                     $this->tpl->set_var("TDListTableBlock", "");
                 } else {
                     $tdRecords = new TDRecords();
                     $tdRecords->parseDomDocument($domDoc);
                     $list = $tdRecords->getArrayList();
                     if (count($list)) {
                         $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                         $this->tpl->set_var("TDDBEmptyBlock", "");
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_block("TDList", "PersonList", "PersonListBlock");
                         $this->tpl->set_block("TDList", "CompanyList", "CompanyListBlock");
                         foreach ($list as $key => $value) {
                             $this->tpl->set_var("tdID", $value->getTdID());
                             $this->tpl->set_var("afsID", $value->getAfsID());
                             $this->tpl->set_var("propertyID", $value->getPropertyID());
                             $this->tpl->set_var("propertyType", $value->getPropertyType());
                             $this->tpl->set_var("taxDeclarationNumber", $value->getTaxDeclarationNumber());
                             $this->tpl->set_var("taxBeginsWithTheYear", $value->getTaxBeginsWithTheYear());
                             if ($value->getCeasesWithTheYear() == "") {
                                 $this->tpl->set_var("ceasesWithTheYear", "");
                             } else {
                                 $this->tpl->set_var("ceasesWithTheYear", " - " . $value->getCeasesWithTheYear());
                             }
                             $this->displayOwner($value->getAfsID());
                             $this->displayEffectivity($value->getAfsID());
                             $this->setTDListBlockPerms();
                             $this->tpl->parse("TDListBlock", "TDList", true);
                         }
                     } else {
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $this->tpl->set_var("TDListBlock", "huh");
                     }
                 }
             }
     }
     $this->setForm();
     $this->setPageDetailPerms();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }