function displayTDDetails() { $afsID = $this->formArray["afsID"]; $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD("", $afsID, "", ""))) { // error xml } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["taxDeclarationNumber"] = $td->getTaxDeclarationNumber(); $this->formArray["memoranda"] = $td->getMemoranda(); $this->formArray["cancelsTDNumber"] = $td->getCancelsTDNumber(); //cityMunicipalAssessor if (is_numeric($td->getCityMunicipalAssessor())) { $cityMunicipalAssessor = new Person(); $cityMunicipalAssessor->selectRecord($td->cityMunicipalAssessor); $this->formArray["cityAssessor"] = $cityMunicipalAssessor->getFullName(); } else { $this->formArray["cityAssessor"] = $td->getCityMunicipalAssessor; } $this->formArray["propertyType"] = $td->getPropertyType(); } } }
function displayTD($afsID) { $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock"); $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTDFromAfsID($this->formArray["afsID"]))) { $this->tpl->set_var("tdID", ""); $this->tpl->set_var("TDTableBlock", ""); $this->tpl->parse("TDDBEmptyBlock", "TDDBEmpty", true); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_var("tdID", ""); $this->tpl->set_var("TDTableBlock", ""); $this->tpl->parse("TDDBEmptyBlock", "TDDBEmpty", true); } else { $td = new TD(); $td->parseDomDocument($domDoc); // update Cancels/CanceledBy TDNumber if ($td->getCancelsTDNumber() == "") { $td = $this->updateTDCancelsTDNumber($td); } if ($td->getCanceledByTDNumber() == "") { $td = $this->updateTDCanceledByTDNumber($td); } $this->formArray["tdID"] = $td->tdID; $this->formArray["taxDeclarationNumber"] = $td->taxDeclarationNumber; //provincialAssessor if (is_numeric($td->provincialAssessor)) { $provincialAssessor = new Person(); $provincialAssessor->selectRecord($td->provincialAssessor); $this->formArray["provincialAssessor"] = $provincialAssessor->getFullName(); } else { $this->formArray["provincialAssessor"] = $td->provincialAssessor; } //provincialAssessorDate if ($td->provincialAssessorDate) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $td->provincialAssessorDate); $this->formArray["pa_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["pa_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["pa_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray["pa_yearValue"] = ""; $this->formArray["pa_month"] = ""; $this->formArray["pa_dayValue"] = ""; } //cityMunicipalAssessor if (is_numeric($td->cityMunicipalAssessor)) { $cityMunicipalAssessor = new Person(); $cityMunicipalAssessor->selectRecord($td->cityMunicipalAssessor); $this->formArray["cityMunicipalAssessor"] = $cityMunicipalAssessor->getFullName(); } else { $this->formArray["cityMunicipalAssessor"] = $td->cityMunicipalAssessor; } //cityMunicipalAssessorDate if ($td->cityMunicipalAssessorDate) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $td->cityMunicipalAssessorDate); $this->formArray["cm_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["cm_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["cm_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray["cm_yearValue"] = ""; $this->formArray["cm_month"] = ""; $this->formArray["cm_dayValue"] = ""; } $this->formArray["cancelsTDNumber"] = $td->cancelsTDNumber; $this->formArray["canceledByTDNumber"] = $td->canceledByTDNumber; $this->formArray["taxBeginsWithTheYear"] = $td->taxBeginsWithTheYear; $this->formArray["ceasesWithTheYear"] = $td->ceasesWithTheYear; //enteredInRPARForBy if (is_numeric($td->enteredInRPARForBy)) { $enteredInRPARForBy = new Person(); $enteredInRPARForBy->selectRecord($td->enteredInRPARForBy); $this->formArray["enteredInRPARForBy"] = $enteredInRPARForBy->getFullName(); } else { $this->formArray["enteredInRPARForBy"] = $td->enteredInRPARForBy; } $this->formArray["enteredInRPARForYear"] = $td->enteredInRPARForYear; $this->formArray["previousOwner"] = $td->previousOwner; $this->formArray["previousAssessedValue"] = $td->previousAssessedValue; if ($td->previousAssessedValue != "") { $this->tpl->set_var("previousAssessedValue", number_format(toFloat($td->previousAssessedValue), 2, ".", ",")); } $this->tpl->set_var("memoranda", $td->memoranda); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->parse("TDTableBlock", "TDTable", true); } } }
function Main() { switch ($this->formArray["formAction"]) { case "view": $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object"); $condition = ""; if ($this->formArray["filterByLocation"] == "true") { if ($condition == "") { $condition = " WHERE "; } $condition .= $this->filterLocationAddress(); } else { $this->tpl->set_block("rptsTemplate", "FilterLocationDetails", "FilterLocationDetailsBlock"); $this->tpl->set_var("FilterLocationDetailsBlock", ""); } if ($this->formArray["filterByDate"] == "true") { if ($condition == "") { $condition = " WHERE "; } else { $condition .= " AND "; } $condition .= $this->filterDate(); } else { $this->tpl->set_block("rptsTemplate", "FilterDateDetails", "FilterDateDetailsBlock"); $this->tpl->set_var("FilterDateDetailsBlock", ""); } $condition .= $this->filterArchives(); $odRecords = new ODRecords(); // paging if (!($count = $odRecords->countRecords($condition))) { $this->tpl->set_block("rptsTemplate", "PageNavigationOne", "PageNavigationOneBlock"); $this->tpl->set_var("PageNavigationOneBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); $this->tpl->set_var("currentPage", $this->formArray["page"]); $this->tpl->set_var("numOfPages", $numOfPages); $this->tpl->set_block("rptsTemplate", "PageListOne", "PageListOneBlock"); for ($p = 1; $p <= $numOfPages; $p++) { $this->tpl->set_var("page", $p); $this->initSelected("page", $p); $this->tpl->parse("PageListOneBlock", "PageListOne", true); } } if ($this->formArray["page"] > 0) { $initialLimit = ($this->formArray["page"] - 1) * PAGE_BY; $condition .= " LIMIT " . $initialLimit . "," . PAGE_BY; } // listing if (!$odRecords->selectRecords($condition)) { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("message", "properties not found"); $this->tpl->parse("NotFoundBlock", "NotFound", true); $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock"); $this->tpl->set_var("ReportBlock", ""); } else { $list = $odRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $this->tpl->set_block("rptsTemplate", "ReportList", "ReportListBlock"); foreach ($list as $key => $value) { $this->formArray["odID"] = $value->getOdID(); $this->tpl->set_var("odID", $value->getOdID()); $afs = $this->getAFSDetails($value->getOdID()); if (is_object($afs)) { $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber()); $this->tpl->set_var("arpNumber", $afs->getArpNumber()); $this->formArray["odID"] = $value->getOdID(); $this->formArray["afsID"] = $afs->getAfsID(); //$od = $this->getODDetails($value->getOdID()); $this->tpl->set_var("transactionCode", $value->getTransactionCode()); $td = new TD(); if ($td->selectRecord("", $this->formArray["afsID"])) { $this->tpl->set_var("taxDeclarationNumber", $td->getTaxDeclarationNumber()); } else { $this->tpl->set_var("taxDeclarationNumber", ""); } $this->tpl->set_var("area", $value->getLandArea()); $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue())); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("cancelsTDNumber", $td->getCancelsTDNumber()); $this->tpl->set_var("previousAssessedValue", $td->getPreviousAssessedValue()); $this->tpl->set_var("previousOwner", $td->getPreviousOwner()); $this->tpl->set_var("canceledByTDNumber", $td->getCanceledByTDNumber()); $landList = $afs->getLandArray(); $plantsTreesList = $afs->getPlantsTreesArray(); $improvementsBuildingsList = $afs->getImprovementsBuildingsArray(); $machineriesList = $afs->getMachineriesArray(); $this->tpl->set_var("taxability", $afs->getTaxability()); $this->tpl->set_var("effectivity", $afs->getEffectivity()); $kind = ""; $class = ""; if (count($landList)) { $kind = "Land"; $land = $landList[0]; $class = $land->getClassification(); $landClasses = new LandClasses(); $landClasses->selectRecord($class); $class = $landClasses->getDescription(); } else { if (count($plantsTreesList)) { $kind = "Land"; $plantsTrees = $plantsTreesList[0]; $class = $plantsTrees->getProductClass(); $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord($class); $class = $plantsTreesClasses->getDescription(); } else { if (count($improvementsBuildingsList)) { $kind = "Improvements/Buildings"; $improvementsBuildings = $improvementsBuildingsList[0]; $class = $improvementsBuildings->getBuildingClassification(); $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); $improvementsBuildingsClasses->selectRecord($class); $class = $improvementsBuildingsClasses->getDescription(); } else { if (count($machineriesList)) { $kind = "Machineries"; $machineries = $machineriesList[0]; $class = $machineries->getKind(); } } } } $this->tpl->set_var("kind", $kind); $this->tpl->set_var("class", $class); $oValue = $value->owner; if (is_array($oValue->personArray)) { foreach ($oValue->personArray as $person) { $ownerNamesArray[] = $person->getName(); } } if (is_array($oValue->companyArray)) { foreach ($oValue->companyArray as $company) { $ownerNamesArray[] = $company->getCompanyName(); } } if (is_array($ownerNamesArray)) { $this->tpl->set_var("ownerNames", implode(",<br>", $ownerNamesArray)); } else { $this->tpl->set_var("ownerNames", ""); } unset($ownerNamesArray); if (count($oValue->personArray)) { $firstOwner = $oValue->personArray[0]->getLastName(); $firstOwner .= ", "; $firstOwner .= $oValue->personArray[0]->getFirstName(); $firstOwner .= " "; $firstOwner .= substr($oValue->personArray[0]->getMiddleName(), 0, 1) . "."; $pAddress = $oValue->personArray[0]->addressArray ? $oValue->personArray[0]->addressArray[0]->getFullAddress() : "no address"; $firstOwnerAddress = $pAddress; $firstOwnerTelephone = $oValue->personArray[0]->getTelephone(); $this->tpl->set_var("firstOwner", $firstOwner); $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress); $this->tpl->set_var("firstOwnerTelephone", $firstOwnerTelephone); } if (count($oValue->companyArray)) { if ($firstOwner == "") { $firstOwner = $oValue->companyArray[0]->getCompanyName(); $cAddress = $oValue->companyArray[0]->addressArray ? $oValue->companyArray[0]->addressArray[0]->getFullAddress() : "no address"; $firstOwnerAddress = $cAddress; $firstOwnerTelephone = $oValue->companyArray[0]->getTelephone(); $this->tpl->set_var("firstOwner", $firstOwner); $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress); $this->tpl->set_var("firstOwnerTelephone", $firstOwnerTelephone); } } if ($firstOwner != "") { $this->tpl->set_var("none", ""); if (count($oValue->personArray) + count($oValue->companyArray) > 1) { $this->tpl->set_var("andOthers", "(and others)"); } else { $this->tpl->set_var("andOthers", ""); } } else { $this->tpl->set_var("none", "none"); $this->tpl->set_var("firstOwner", ""); $this->tpl->set_var("andOthers", ""); $this->tpl->set_var("firstOwnerAddress", ""); $this->tpl->set_var("firstOwnerTelephone", ""); } $locationAddress = $value->locationAddress->getFullAddress(); $this->tpl->set_var("locationAddress", $locationAddress); $this->displayPrecedingOD(); $this->displaySucceedingOD(); //$this->tpl->set_var("transactionCode", $value->getTransactionCode()); $this->tpl->parse("ReportListBlock", "ReportList", true); } } } } break; default: $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("message", "select a location to view report"); $this->tpl->parse("NotFoundBlock", "NotFound", true); $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock"); $this->tpl->set_var("ReportBlock", ""); break; } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->set_var("rpts_Session", $this->sess->id); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function displayTD($afsID) { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTDFromAfsID($this->formArray["afsID"]))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["memoranda"] = $td->getMemoranda(); $this->formArray["taxDeclarationNumber"] = $td->getTaxDeclarationNumber(); $this->formArray["cancelsTDNumber"] = $td->getCancelsTDNumber(); $this->formArray["previousOwner"] = $td->getPreviousOwner(); $this->formArray["previousAssessedValue"] = $td->getPreviousAssessedValue(); } } }
function Main() { //echo $this->formArray["formAction"]; switch ($this->formArray["formAction"]) { case "save": $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object"); if ($this->formArray["tdID"] != "") { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", "record not found"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", "error xmlDoc"); } else { $td = new TD(); $td->parseDomDocument($domDoc); $td->setTdID($this->formArray["tdID"]); $td->setAfsID($this->formArray["afsID"]); $td->setPropertyID($this->formArray["propertyID"]); $td->setPropertyType($this->formArray["propertyType"]); $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]); $td->setProvincialAssessor($this->formArray["provincialAssessorID"]); $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]); $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]); $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]); $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]); $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]); $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]); $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]); $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]); $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]); $td->setPreviousOwner($this->formArray["previousOwner"]); $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $td->setMemoranda($this->formArray["memoranda"]); $td->setCreatedBy($this->userID); $td->setModifiedBy($this->userID); $td->setDomDocument(); $doc = $td->getDomDocument(); $xmlStr = $doc->dump_mem(true); //exit($xmlStr); if (!($ret = $TDEncode->updateTD($xmlStr))) { exit("error update"); } } } } else { $td = new TD(); $td->parseDomDocument($domDoc); //$td->setTdID($this->formArray["tdID"]); $td->setAfsID($this->formArray["afsID"]); $td->setPropertyID($this->formArray["propertyID"]); $td->setPropertyType($this->formArray["propertyType"]); $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]); $td->setProvincialAssessor($this->formArray["provincialAssessorID"]); $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]); $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]); $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]); $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]); $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]); $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]); $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]); $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]); $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]); $td->setPreviousOwner($this->formArray["previousOwner"]); $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $td->setMemoranda($this->formArray["memoranda"]); $td->setCreatedBy($this->userID); $td->setModifiedBy($this->userID); $td->setDomDocument(); $doc = $td->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $TDEncode->saveTD($xmlStr))) { echo "Error saving"; } } $this->formArray["propertyID"] = $ret; header("location: TDClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"]))); exit($ret); break; case "cancel": header("location: TDList.php"); exit; break; default: if ($this->formArray["tdID"]) { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $td = new TD(); $td->parseDomDocument($domDoc); if ($td->getCancelsTDNumber() == "") { $td = $this->updateTDCancelsTDNumber($td); } if ($td->getCanceledByTDNumber() == "") { $td = $this->updateTDCanceledByTDNumber($td); } foreach ($td as $key => $value) { switch ($key) { case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["pa_year"] = removePreZero($dateArr["year"]); $this->formArray["pa_month"] = removePreZero($dateArr["month"]); $this->formArray["pa_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["cm_year"] = removePreZero($dateArr["year"]); $this->formArray["cm_month"] = removePreZero($dateArr["month"]); $this->formArray["cm_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "propertyType": // so it wont go to the default loop. so that propertyType can refresh from the GET input break; default: //echo $key."=>".$value."<br>"; $this->formArray[$key] = $value; } } } } } else { $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // domDoc empty } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["taxDeclarationNumber"] = $afs->getARPNumber(); $this->formArray["odID"] = $afs->getOdID(); // default cancelsTDNumber and canceledByTDNumber $cancelsTDNumberArray = $this->getCancelsTDNumberArray(); if (is_array($cancelsTDNumberArray)) { $this->formArray["cancelsTDNumber"] = implode(", ", $cancelsTDNumberArray); } $canceledByTDNumberArray = $this->getCanceledByTDNumberArray(); if (is_array($canceledByTDNumberArray)) { $this->formArray["canceledByTDNumber"] = implode(", ", $canceledByTDNumberArray); } // default memoranda from properties $this->formArray["memoranda"] = ""; if (is_array($afs->landArray)) { if (is_object($afs->landArray[0])) { if ($afs->landArray[0]->memoranda != "") { $this->formArray["memoranda"] .= "Land Memo:\n" . $afs->landArray[0]->memoranda; } } } if (is_array($afs->plantsTreesArray)) { if (is_object($afs->plantsTreesArray[0])) { if ($afs->plantsTreesArray[0]->memoranda != "") { $this->formArray["memoranda"] .= "\nPlants Trees Memo:\n" . $afs->plantsTreesArray[0]->memoranda; } } } if (is_array($afs->improvementsBuildingsArray)) { if (is_object($afs->improvementsBuildingsArray[0])) { if ($afs->improvementsBuildingsArray[0]->memoranda != "") { $this->formArray["memoranda"] .= "\nImprovements/Buildings Memo:\n" . $afs->improvementsBuildingsArray[0]->memoranda; } } } if (is_array($afs->machineriesArray)) { if (is_object($afs->machineriesArray[0])) { if ($afs->machineriesArray[0]->memoranda != "") { $this->formArray["memoranda"] .= "\nMachineries Memo:\n" . $afs->machineriesArray[0]->memoranda; } } } } } } $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock"); $this->tpl->set_var("odIDBlock", ""); $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock"); $this->tpl->set_var("ACKBlock", ""); } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("tdID" => $this->formArray["tdID"], "propertyType" => $this->formArray["propertyType"], "propertyID" => $this->formArray["propertyID"], "afsID" => $this->formArray["afsID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }