function updateDue($xmlStr) { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } $due = new Due(); $due->parseDomDocument($domDoc); $ret = $due->updateRecord(); return $ret; }
function parseDomDocument($domDoc) { $baseNode = $domDoc->document_element(); if ($baseNode->has_child_nodes()) { $child = $baseNode->first_child(); while ($child) { //if ($child->tagname=="Due") { if ($child->tagname) { $tempXmlStr = $domDoc->dump_node($child); $tempDomDoc = domxml_open_mem($tempXmlStr); $due = new Due(); $due->parseDomDocument($tempDomDoc); $this->arrayList[] = $due; } $child = $child->next_sibling(); } } $this->setDomDocument(); //$this->setDomDocumentRecords(); return true; }
function getDue($dueID) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDue($dueID))) { // error xmlStr } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $due = new Due(); $due->parseDomDocument($domDoc); return $due; } } }
function Main() { switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); if (!($deletedRows = $RPTOPList->deleteRPTOP($this->formArray["rptopID"]))) { $this->tpl->set_var("msg", "SOAP failed"); } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } break; case "search": $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); if (!($count = $RPTOPList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->searchRPTOP($this->formArray["page"], $condition, $this->formArray["searchKey"]))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxableYear", $value->getTaxableYear()); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { $totalTaxDue = "uncalculated"; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $totalTaxDue = "uncalculated"; } else { $due = new Due(); $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); } } } } else { $totalTaxDue = "no TD's"; } if (is_numeric($totalTaxDue)) { $totalTaxDue = formatCurrency($totalTaxDue); } $this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } break; case "cancel": header("location: CalculateRPTOP.php"); exit; break; default: $this->tpl->set_var("msg", ""); $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $RPTOPList->getRPTOPCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", ""); $this->tpl->set_var("pagesUrl", ""); $this->tpl->set_var("paged", $i); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->getRPTOPList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", ""); } else { $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxableYear", $value->getTaxableYear()); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { $totalTaxDue = "uncalculated"; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $totalTaxDue = "uncalculated"; } else { $due = new Due(); $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); } } } } else { $totalTaxDue = "no TD's"; } if (is_numeric($totalTaxDue)) { $totalTaxDue = formatCurrency($totalTaxDue); } $this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "save": $DueEncode = new SoapObject(NCCBIZ . "DueEncode.php", "urn:Object"); if ($this->formArray["dueID"] != "") { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDue($this->formArray["dueID"]))) { $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 { $dueArray = $this->setDues(); foreach ($dueArray as $due) { $doc = $due->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $DueEncode->updateDue($xmlStr))) { exit("error update"); } unset($doc); unset($xmlStr); } } } } else { $dueArray = $this->setDues(); foreach ($dueArray as $due) { $doc = $due->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $DueEncode->saveDue($xmlStr))) { exit("error saving"); } unset($doc); unset($xmlStr); } } $this->formArray["dueID"] = $ret; header("location: DueClose.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit($ret); break; default: // grab current tax rates from TreasurySettings $treasurySettings = new TreasurySettings(); $treasurySettings->selectRecord(); $this->formArray["masterBasicTaxRate"] = $treasurySettings->getPctRPTax(); $this->formArray["masterSEFTaxRate"] = $treasurySettings->getPctSEF(); $this->formArray["masterIdleTaxRate"] = $treasurySettings->getPctIdle(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // domDoc empty } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["afsID"] = $td->getAfsID(); $this->formArray["taxDeclarationNumber"] = $td->getTaxDeclarationNumber(); $this->formArray["taxBeginsWithTheYear"] = $td->getTaxBeginsWithTheYear(); } } unset($xmlStr); unset($domDoc); $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["assessedValue"] = $afs->getTotalAssessedValue(); $this->formArray["taxability"] = $afs->getTaxability(); $this->formArray["effectivity"] = $afs->getEffectivity(); $this->formArray["propertyType"] = $td->getPropertyType(); $this->formArray["idle"] = "No"; if ($td->getPropertyType() == "Land") { if (is_array($afs->landArray)) { // if land is stripped if (count($afs->landArray) > 1) { foreach ($afs->landArray as $land) { if ($land->getIdle() == "Yes") { $this->formArray["idle"] = "Yes"; break; } } } else { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } if ($this->formArray["idle"] == "") { $this->formArray["idle"] = "No"; } } } if ($this->formArray["dueID"] != "") { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDue($this->formArray["dueID"]))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error xmlDoc"; } else { $due = new Due(); $due->parseDomDocument($domDoc); foreach ($due as $key => $value) { switch ($key) { default: $this->formArray[$key] = $value; } } $this->formArray["dueDate_str"] = date("F d, Y", strtotime($this->formArray["dueDate"])); $this->formArray["taxDue"] = $due->getTaxDue(); } } } else { // select RPTOP taxable year from rptopID $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error domDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); $this->formArray["taxableYear"] = $rptop->getTaxableYear(); } } // display default Due details $this->formArray["dueDate"] = date("Y-n-d", strtotime($this->formArray["taxableYear"] . "-" . $treasurySettings->getAnnualDueDate())); $this->formArray["dueDate_str"] = date("F d, Y", strtotime($this->formArray["dueDate"])); $this->formArray["basicTaxRate"] = $this->formArray["masterBasicTaxRate"]; $this->formArray["sefTaxRate"] = $this->formArray["masterSEFTaxRate"]; $this->formArray["idleTaxRate"] = $this->formArray["masterIdleTaxRate"]; $this->formArray["basicTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["basicTaxRate"]; $this->formArray["sefTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["sefTaxRate"]; // if land->idle is "Yes", compute idleTax, otherwise set idleTax to zero if ($this->formArray["propertyType"] == "Land") { if ($this->formArray["idle"] == "Yes") { $this->formArray["idleTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["idleTaxRate"]; } else { $this->formArray["idleTax"] = "0.00"; } } // if afs->taxability is "Exempt", reset computations to zero. if ($this->formArray["taxability"] == "Exempt") { $this->formArray["basicTax"] = 0.0; $this->formArray["sefTax"] = 0.0; $this->formArray["idleTax"] = 0.0; } $this->formArray["taxDue"] = $this->formArray["basicTax"] + $this->formArray["sefTax"] + $this->formArray["idleTax"]; } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("dueID" => $this->formArray["dueID"], "tdID" => $this->formArray["tdID"], "rptopID" => $this->formArray["rptopID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "remove": //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")"; $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) { if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) { $this->tpl->set_var("msg", "SOAP failed"); //echo "SOAP failed"; } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } //select $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("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 { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $this->displayOwnerList($domDoc); } } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID()); $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName()); $this->formArray["cityAssessorName"] = $cityAssessor->getFullName(); } else { $cityAssessor = $value; $this->tpl->set_var("cityAssessorID", $cityAssessor); $this->tpl->set_var("cityAssessorName", $cityAssessor); $this->formArray["cityAssessorName"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID()); $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName()); $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName(); } else { $cityTreasurer = $value; $this->tpl->set_var("cityTreasurerID", $cityTreasurer); $this->tpl->set_var("cityTreasurerName", $cityTreasurer); $this->formArray["cityTreasurerName"] = $cityTreasurer; } break; case "tdArray": $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $tdCtr = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); /* $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); */ foreach ($value as $tkey => $tvalue) { //foreach($tvalue as $column => $val){ // $this->tpl->set_var($column,$val); //} $this->tpl->set_var("tdID", $tvalue->getTDID()); $this->tpl->set_var("taxDeclarationNumber", $tvalue->getTaxDeclarationNumber()); $this->tpl->set_var("afsID", $tvalue->getAfsID()); $this->tpl->set_var("cancelsTDNumber", $tvalue->getCancelsTDNumber()); $this->tpl->set_var("canceledByTDNumber", $tvalue->getCanceledByTDNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $tvalue->getTaxBeginsWithTheYear()); $this->tpl->set_var("ceasesWithTheYear", $tvalue->getCeasesWithTheYear()); $this->tpl->set_var("enteredInRPARForBy", $tvalue->getEnteredInRPARForBy()); $this->tpl->set_var("enteredInRPARForYear", $tvalue->getEnteredInRPARForYear()); $this->tpl->set_var("previousOwner", $tvalue->getPreviousOwner()); $this->tpl->set_var("previousAssessedValue", $tvalue->getPreviousAssessedValue()); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getProvincialAssessorDate()); $this->tpl->set_var("pa_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("pa_month", removePreZero($dateArr["month"])); $this->tpl->set_var("pa_dayValue", removePreZero($dateArr["day"])); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getCityMunicipalAssessorDate()); $this->tpl->set_var("cm_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("cm_month", removePreZero($dateArr["month"])); $this->tpl->set_var("cm_dayValue", removePreZero($dateArr["day"])); $this->tpl->set_var("provincialAssessorName", $tvalue->provincialAssessor); $this->tpl->set_var("cityMunicipalAssessorName", $tvalue->cityMunicipalAssessor); //$this->tpl->set_var("assessedValue",$tvalue->getAssessedValue()); $this->tpl->set_var("propertyType", $tvalue->getPropertyType()); $this->tpl->set_var("basicTax", ""); $this->tpl->set_var("sefTax", ""); $this->tpl->set_var("total", ""); //$this->tpl->set_var("basicTax",$tvalue->getBasicTax()); //$this->tpl->set_var("sefTax",$tvalue->getSefTax()); //$this->tpl->set_var("total",$tvalue->getTotal()); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { //$this->tpl->set_block("rptsTemplate", "AFSTable", "AFSTableBlock"); //$this->tpl->set_var("AFSTableBlock", "afs not found"); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { //$this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); //$this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue(); $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue(); $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxability", $afs->getTaxability()); $this->tpl->set_var("effectivity", $afs->getEffectivity()); $this->formArray["idle"] = "No"; if ($tvalue->getPropertyType() == "Land") { if (is_array($afs->landArray)) { // if land is stripped if (count($afs->landArray) > 1) { foreach ($afs->landArray as $land) { if ($land->getIdle() == "Yes") { $this->formArray["idle"] = "Yes"; break; } } } else { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } if ($this->formArray["idle"] == "") { $this->formArray["idle"] = "No"; } $this->tpl->set_var("idle", $this->formArray["idle"]); } } // grab Due from tdID $this->formArray["totalTaxDue"] = 0.0; $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDueFromTdID($tvalue->getTdID(), $rptop->getTaxableYear()))) { $this->tpl->set_var("dueID", ""); $this->tpl->set_var("dueDate", "---/--/--"); $this->tpl->set_var("basicTax", "uncalculated"); $this->tpl->set_var("sefTax", "uncalculated"); $this->tpl->set_var("idleTax", "uncalculated"); $this->tpl->set_var("taxDue", "uncalculated"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_var("dueDate", "---/--/--"); $this->tpl->set_var("dueID", "uncalculated"); $this->tpl->set_var("basicTax", "uncalculated"); $this->tpl->set_var("sefTax", "uncalculated"); $this->tpl->set_var("idleTax", "uncalculated"); $this->tpl->set_var("taxDue", "uncalculated"); } else { $due = new Due(); $due->parseDomDocument($domDoc); $this->tpl->set_var("dueID", $due->getDueID()); $this->tpl->set_var("dueDate", date("M. d, Y", strtotime($due->getDueDate()))); $this->tpl->set_var("basicTax", formatCurrency($due->getBasicTax())); $this->tpl->set_var("sefTax", formatCurrency($due->getSEFTax())); $this->tpl->set_var("idleTax", formatCurrency($due->getIdleTax())); $this->tpl->set_var("taxDue", formatCurrency($due->getTaxDue())); $this->formArray["totalTaxDue"] += $due->getTaxDue(); } } // refresh tdHistory // insert/update Dues from PreviousTD as BacktaxTD for CurrentTD // if previous TD has no Dues, create a Due and insert as BacktaxTD $this->formArray["taxableYear"] = $rptop->getTaxableYear(); $this->refreshTDHistory($tvalue); $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("defaultTDListBlock", "defaultTDList", true); $this->tpl->parse("toggleTDListBlock", "toggleTDList", true); $this->tpl->parse("TDListBlock", "TDList", true); /* $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); */ $tdCtr++; } } else { $this->tpl->set_var("defaultTDListBlock", "//no default"); $this->tpl->set_var("toggleTDListBlock", "//no Toggle"); $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; case "landTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "landTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; default: $this->formArray[$key] = $value; } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; unset($rptop); $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $rptop = new RPTOP(); $rptop->setRptopID($this->formArray["rptopID"]); $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]); $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]); $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]); $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]); $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]); $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]); $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]); $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]); $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]); $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]); $rptop->setCreatedBy($this->userID); $rptop->setModifiedBy($this->userID); $rptop->setDomDocument(); $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object"); $rptop->setDomDocument(); $doc = $rptop->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $RPTOPEncode->updateRPTOPtotals($xmlStr))) { echo "ret=" . $ret; } //echo $ret; } } $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->sess->add_query(array("rptopID" => $this->formArray["rptopID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Page", "PageBlock"); // start batch loop $rptopIDArray = $this->formArray["rptopIDArray"]; foreach ($rptopIDArray as $key => $rptopID) { $this->formArray["rptopID"] = $rptopID; $this->pageNumber++; if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { //echo($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error xmlDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domdoc } else { $this->displayOwnerList($domDoc); } } } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->formArray["municipalAssessor"] = $cityAssessor->getName(); } else { $cityAssessor = $value; $this->formArray["municipalAssessor"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->formArray["municipalTreasurer"] = $cityTreasurer->getName(); } else { $cityTreasurer = $value; $this->formArray["municipalTreasurer"] = $cityTreasurer; } break; case "tdArray": $tdCtr = 1; $tdPageNumber = 1; // RC 20091012 Modified to handle multiple page RPTOPS $totalBasic = 0; $totalSef = 0; $totalTaxes = 0; if (count($value)) { $tdTotalPages = intval((count($value) - 1) / 6) + 1; //RC 20091012 Calculate 1 to 6 = 1. foreach ($value as $tkey => $tvalue) { if ($tdCtr > 6) { // RC 20091012 Deal with multiple page RPTOP (i.e. more than 6 TDs) $this->formArray["tdPageNumber"] = $tdPageNumber; $this->formArray["tdTotalPages"] = $tdTotalPages; $this->formArray["totalOnLastPage"] = "Please Refer to Totals on Last Page..."; $this->setForm(); // generate page of output $this->clearDetails(); // clear the values from Form $this->pageNumber++; //increment PDF Page Number $tdPageNumber++; $tdCtr = 1; //reset count for lines on new page of RPTOP $this->formArray["totalOnLastPage"] = ""; } $this->formArray["arpNumber" . $tdCtr] = $tvalue->getTaxDeclarationNumber(); // word wrap arpNumber if (strlen($this->formArray["arpNumber" . $tdCtr]) > 13) { $this->formArray["arpNumber" . $tdCtr . "a"] = substr($this->formArray["arpNumber" . $tdCtr], 0, 12); $this->formArray["arpNumber" . $tdCtr . "b"] = substr($this->formArray["arpNumber" . $tdCtr], 12); $this->formArray["arpNumber" . $tdCtr] = ""; } $this->formArray["afsID"] = $tvalue->getAfsID(); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["odID"] = $afs->getOdID(); $od = new OD(); $od->selectRecord($this->formArray["odID"]); $locationNumber = $od->locationAddress->getNumber(); $locationStreet = $od->locationAddress->getStreet(); $locationBarangay = $od->locationAddress->getBarangay(); $locationDistrict = $od->locationAddress->getDistrict(); $locationMunicipalityCity = $od->locationAddress->getMunicipalityCity(); $locationProvince = $od->locationAddress->getProvince(); $this->formArray["location" . $tdCtr] = $locationNumber . " " . $locationStreet . " " . $locationBarangay; // word wrap location if (strlen($this->formArray["location" . $tdCtr]) > 26) { $this->formArray["location" . $tdCtr . "a"] = $locationNumber . " " . $locationStreet; $this->formArray["location" . $tdCtr . "b"] = $locationBarangay; $this->formArray["location" . $tdCtr] = ""; } $this->formArray["province"] = $locationProvince; $this->formArray["municipalityCity"] = strtoupper($locationMunicipalityCity); $this->formArray["area" . $tdCtr] = $od->getLandArea(); $this->formArray["lotNo" . $tdCtr] = $od->getLotNumber(); $this->formArray["pin" . $tdCtr] = $afs->getPropertyIndexNumber(); // word wrap pin if (strlen($this->formArray["pin" . $tdCtr]) > 25) { $this->formArray["pin" . $tdCtr . "a"] = substr($this->formArray["pin" . $tdCtr], 0, 25); $this->formArray["pin" . $tdCtr . "b"] = substr($this->formArray["pin" . $tdCtr], 25); $this->formArray["pin" . $tdCtr] = ""; } $landList = $afs->getLandArray(); $plantsTreesList = $afs->getPlantsTreesArray(); $improvementsBuildingsList = $afs->getImprovementsBuildingsArray(); $machineriesList = $afs->getMachineriesArray(); $kind = ""; $actualUse = ""; if (count($landList)) { $kind = "Land"; $land = $landList[0]; $actualUse = $land->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $actualUse = $landActualUses->getDescription(); $actualUseReportCode = $landActualUses->getReportCode(); } else { if (count($plantsTreesList)) { $kind = "Land"; $plantsTrees = $plantsTreesList[0]; $actualUse = $plantsTrees->getActualUse(); $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord($actualUse); $actualUse = $plantsTreesActualUses->getDescription(); $actualUseReportCode = $plantsTreesActualUses->getReportCode(); } else { if (count($improvementsBuildingsList)) { $kind = "Improvements/Buildings"; $improvementsBuildings = $improvementsBuildingsList[0]; $actualUse = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $actualUse = $improvementsBuildingsActualUses->getDescription(); $actualUseReportCode = $improvementsBuildingsActualUses->getReportCode(); } else { if (count($machineriesList)) { $kind = "Machineries"; $machineries = $machineriesList[0]; $actualUse = $machineries->getActualUse(); $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord($actualUse); $actualUse = $machineriesActualUses->getDescription(); $actualUseReportCode = $machineriesActualUses->getReportCode(); } } } } eval(REPORT_CODE_LIST); foreach ($reportCodeList as $key => $reportCode) { if ($reportCode["code"] == $actualUseReportCode) { $reportCodeDescription = $reportCode["description"]; break; } } $this->formArray["classification" . $tdCtr] = $reportCodeDescription; $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["marketValue" . $tdCtr] += $afs->getTotalMarketValue(); $this->formArray["assessedValue" . $tdCtr] += $afs->getTotalAssessedValue(); //RC $this->formArray["totalMarketValue"] += $this->formArray["marketValue"]; //RC $this->formArray["totalAssessedValue"] += $this->formArray["assessedValue"]; // grab Due from tdID $this->formArray["totalTaxDue"] = 0.0; $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDueFromTdID($tvalue->getTdID()))) { $this->formArray["basic" . $tdCtr] = ""; $this->formArray["sef" . $tdCtr] = ""; $this->formArray["totalTax" . $tdCtr] = ""; $this->formArray["totalBasic"] += 0; $this->formArray["totalSef"] += 0; $this->formArray["totalTaxes"] += 0; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->formArray["basic" . $tdCtr] = ""; $this->formArray["sef" . $tdCtr] = ""; $this->formArray["totalTax" . $tdCtr] = ""; $this->formArray["totalBasic"] += 0; $this->formArray["totalSef"] += 0; $this->formArray["totalTaxes"] += 0; } else { $due = new Due(); $due->parseDomDocument($domDoc); $this->formArray["basic" . $tdCtr] = $due->getBasicTax(); $this->formArray["sef" . $tdCtr] = $due->getSEFTax(); $this->formArray["totalTax" . $tdCtr] = $due->getTaxDue(); /* RC 20091012 revised to not print total until last page of RPTOP $this->formArray["totalBasic"] += $due->getBasicTax(); $this->formArray["totalSef"] += $due->getSEFTax(); $this->formArray["totalTaxes"] += $due->getTaxDue(); */ $totalBasic += $due->getBasicTax(); $totalSef += $due->getSEFTax(); $totalTaxes += $due->getTaxDue(); } } } } $tdCtr++; } } break; default: $this->formArray[$key] = $value; } } $this->formArray["tdPageNumber"] = $tdPageNumber; $this->formArray["tdTotalPages"] = $tdTotalPages; $this->formArray["totalBasic"] += $totalBasic; // RC 20091012 set values for last page of RPTOP $this->formArray["totalSef"] += $totalSef; $this->formArray["totalTaxes"] += $totalTaxes; $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; unset($rptop); } } $this->setForm(); // send XML to file $this->clearForm(); // clear the XML form values } // end batch loop $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $testpdf = new PDFWriter(); $testpdf->setOutputXML($this->tpl->get("templatePage"), "test"); $testpdf->writePDF("RPTOPBatch.pdf"); // popup the IE Save to File thingee... exit; }
function Main() { $this->displayLGUName(); $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { //echo($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error xmlDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domdoc } else { $this->displayOwnerList($domDoc); } } } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->formArray["municipalAssessor"] = $cityAssessor->getName(); } else { $cityAssessor = $value; $this->formArray["municipalAssessor"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->formArray["municipalTreasurer"] = $cityTreasurer->getName(); } else { $cityTreasurer = $value; $this->formArray["municipalTreasurer"] = $cityTreasurer; } break; case "tdArray": $tdCtr = 1; $tdContinuousCtr = 1; if (count($value)) { $this->tdPagingArray["tdCount"] = count($value); $this->tdPagingArray["tdPageRecordsCounter"] = 1; $this->tdPagingArray["tdTotalPages"] = ceil($this->tdPagingArray["tdCount"] / $this->tdPagingArray["tdPageBy"]); $this->tdPagingArray["tdPageNumber"] = 1; $this->tpl->set_block("rptsTemplate", "Page", "PageBlock"); $this->tpl->set_block("Page", "FirstPageText", "FirstPageTextBlock"); $this->tpl->set_block("Page", "ContinuedFromPreviousPageText", "ContinuedFromPreviousPageTextBlock"); $this->tpl->set_block("Page", "ContinuedNextPageText", "ContinuedNextPageTextBlock"); $this->tpl->set_block("Page", "Totals", "TotalsBlock"); foreach ($value as $tkey => $tvalue) { $this->formArray["arpNumber" . $tdCtr] = $tvalue->getTaxDeclarationNumber(); // word wrap arpNumber if (strlen($this->formArray["arpNumber" . $tdCtr]) > 13) { $this->formArray["arpNumber" . $tdCtr . "a"] = substr($this->formArray["arpNumber" . $tdCtr], 0, 12); $this->formArray["arpNumber" . $tdCtr . "b"] = substr($this->formArray["arpNumber" . $tdCtr], 12); $this->formArray["arpNumber" . $tdCtr] = ""; } $this->formArray["afsID"] = $tvalue->getAfsID(); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["odID"] = $afs->getOdID(); $od = new OD(); $od->selectRecord($this->formArray["odID"]); $locationNumber = $od->locationAddress->getNumber(); $locationStreet = $od->locationAddress->getStreet(); $locationBarangay = $od->locationAddress->getBarangay(); $locationDistrict = $od->locationAddress->getDistrict(); $locationMunicipalityCity = $od->locationAddress->getMunicipalityCity(); $locationProvince = $od->locationAddress->getProvince(); $this->formArray["location" . $tdCtr] = $locationNumber . " " . $locationStreet . " " . $locationBarangay; // word wrap location if (strlen($this->formArray["location" . $tdCtr]) > 26) { $this->formArray["location" . $tdCtr . "a"] = $locationNumber . " " . $locationStreet; $this->formArray["location" . $tdCtr . "b"] = $locationBarangay; $this->formArray["location" . $tdCtr] = ""; } $this->formArray["province"] = $locationProvince; $this->formArray["municipalityCity"] = strtoupper($locationMunicipalityCity); $this->formArray["area" . $tdCtr] = $od->getLandArea(); $this->formArray["lotNo" . $tdCtr] = $od->getLotNumber(); $this->formArray["pin" . $tdCtr] = $afs->getPropertyIndexNumber(); // word wrap pin if (strlen($this->formArray["pin" . $tdCtr]) > 13) { $this->formArray["pin" . $tdCtr . "a"] = substr($this->formArray["pin" . $tdCtr], 0, 12); $this->formArray["pin" . $tdCtr . "b"] = substr($this->formArray["pin" . $tdCtr], 12); $this->formArray["pin" . $tdCtr] = ""; } $landList = $afs->getLandArray(); $plantsTreesList = $afs->getPlantsTreesArray(); $improvementsBuildingsList = $afs->getImprovementsBuildingsArray(); $machineriesList = $afs->getMachineriesArray(); $kind = ""; $actualUse = ""; if (count($landList)) { $kind = "Land"; $land = $landList[0]; $actualUse = $land->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $actualUse = $landActualUses->getDescription(); $actualUseReportCode = $landActualUses->getReportCode(); } else { if (count($plantsTreesList)) { $kind = "Land"; $plantsTrees = $plantsTreesList[0]; $actualUse = $plantsTrees->getActualUse(); $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord($actualUse); $actualUse = $plantsTreesActualUses->getDescription(); $actualUseReportCode = $plantsTreesActualUses->getReportCode(); } else { if (count($improvementsBuildingsList)) { $kind = "Improvements/Buildings"; $improvementsBuildings = $improvementsBuildingsList[0]; $actualUse = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $actualUse = $improvementsBuildingsActualUses->getDescription(); $actualUseReportCode = $improvementsBuildingsActualUses->getReportCode(); } else { if (count($machineriesList)) { $kind = "Machineries"; $machineries = $machineriesList[0]; $actualUse = $machineries->getActualUse(); $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord($actualUse); $actualUse = $machineriesActualUses->getDescription(); $actualUseReportCode = $machineriesActualUses->getReportCode(); } } } } eval(REPORT_CODE_LIST); foreach ($reportCodeList as $key => $reportCode) { if ($reportCode["code"] == $actualUseReportCode) { $reportCodeDescription = $reportCode["description"]; break; } } $this->formArray["classification" . $tdCtr] = $reportCodeDescription; $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["marketValue" . $tdCtr] += $afs->getTotalMarketValue(); $this->formArray["assessedValue" . $tdCtr] += $afs->getTotalAssessedValue(); $this->formArray["totalMarketValue"] += $this->formArray["marketValue"]; $this->formArray["totalAssessedValue"] += $this->formArray["assessedValue"]; // grab Due from tdID $this->formArray["totalTaxDue"] = 0.0; $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDueFromTdID($tvalue->getTdID()))) { $this->formArray["basic" . $tdCtr] = ""; $this->formArray["sef" . $tdCtr] = ""; $this->formArray["totalTax" . $tdCtr] = ""; $this->formArray["totalBasic"] += 0; $this->formArray["totalSef"] += 0; $this->formArray["totalTaxes"] += 0; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->formArray["basic" . $tdCtr] = ""; $this->formArray["sef" . $tdCtr] = ""; $this->formArray["totalTax" . $tdCtr] = ""; $this->formArray["totalBasic"] += 0; $this->formArray["totalSef"] += 0; $this->formArray["totalTaxes"] += 0; } else { $due = new Due(); $due->parseDomDocument($domDoc); $this->formArray["basic" . $tdCtr] = $due->getBasicTax(); $this->formArray["sef" . $tdCtr] = $due->getSEFTax(); $this->formArray["totalTax" . $tdCtr] = $due->getTaxDue(); //WRONG CODE --------------------------------------------------> //$this->formArray["totalBasic"] += $due->getBasicTax(); //$this->formArray["totalSef"] += $due->getSEFTax(); //$this->formArray["totalTaxes"] += $due->getTaxDue(); //-------------------------------------------------------------> } } } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; //NEW CODE - Argao----Added on 03152008--------------------------------------------> //Computes Grand Totals on Basic, SEF and Total-----By CHT $this->formArray["totalBasic"] = $this->formArray["totalAssessedValue"] * 0.01; $this->formArray["totalSef"] = $this->formArray["totalAssessedValue"] * 0.01; $this->formArray["totalTaxes"] = $this->formArray["totalBasic"] + $this->formArray["totalSef"]; //---------------------------------------------------------------------------------> if ($this->tdPagingArray["tdPageRecordsCounter"] == $this->tdPagingArray["tdPageBy"]) { // if 6 $this->setForm(); $this->resetTDPageRecords(); $this->tpl->set_var("tdPageNumber", $this->tdPagingArray["tdPageNumber"]); $this->tpl->set_var("tdTotalPages", $this->tdPagingArray["tdTotalPages"]); if ($this->tdPagingArray["tdPageNumber"] > 1) { $this->tpl->set_var("FirstPageTextBlock", ""); $this->tpl->parse("ContinuedFromPreviousPageTextBlock", "ContinuedFromPreviousPageText", true); } else { if ($this->tdPagingArray["tdPageNumber"] == 1) { $this->tpl->parse("FirstPageTextBlock", "FirstPageText", true); $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", ""); } } if ($this->tdPagingArray["tdTotalPages"] > 1 && $this->tdPagingArray["tdPageNumber"] < $this->tdPagingArray["tdTotalPages"]) { $this->tpl->parse("ContinuedNextPageTextBlock", "ContinuedNextPageText", true); } else { if ($this->tdPagingArray["tdTotalPages"] == 1) { $this->tpl->set_var("ContinuedNextPageTextBlock", ""); } } if ($this->tdPagingArray["tdTotalPages"] == $this->tdPagingArray["tdPageNumber"]) { $this->tpl->parse("TotalsBlock", "Totals", true); } else { $this->tpl->set_var("TotalsBlock", ""); } $this->tpl->parse("PageBlock", "Page", true); $this->tpl->set_var("FirstPageTextBlock", ""); $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", ""); $this->tpl->set_var("ContinuedNextPageTextBlock", ""); $this->tpl->set_var("TotalsBlock", ""); $this->tdPagingArray["tdPageNumber"]++; $this->formArray["pageNumber"]++; // reset counter $this->tdPagingArray["tdPageRecordsCounter"] = 0; $tdCtr = 0; } else { if ($tdContinuousCtr == $this->tdPagingArray["tdCount"]) { // if this is the last record, and count is still not 6 $this->setForm(); $this->resetTDPageRecords(); $this->tpl->set_var("tdPageNumber", $this->tdPagingArray["tdPageNumber"]); $this->tpl->set_var("tdTotalPages", $this->tdPagingArray["tdTotalPages"]); if ($this->tdPagingArray["tdPageNumber"] > 1) { $this->tpl->set_var("FirstPageTextBlock", ""); $this->tpl->parse("ContinuedFromPreviousPageTextBlock", "ContinuedFromPreviousPageText", true); } else { if ($this->tdPagingArray["tdPageNumber"] == 1) { $this->tpl->parse("FirstPageTextBlock", "FirstPageText", true); $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", ""); } } if ($this->tdPagingArray["tdTotalPages"] > 1 && $this->tdPagingArray["tdPageNumber"] < $this->tdPagingArray["tdTotalPages"]) { $this->tpl->parse("ContinuedNextPageTextBlock", "ContinuedNextPageText", true); } else { if ($this->tdPagingArray["tdTotalPages"] == 1) { $this->tpl->set_var("ContinuedNextPageTextBlock", ""); } } if ($this->tdPagingArray["tdTotalPages"] == $this->tdPagingArray["tdPageNumber"]) { $this->tpl->parse("TotalsBlock", "Totals", true); } else { $this->tpl->set_var("TotalsBlock", ""); } $this->tpl->parse("PageBlock", "Page", true); $this->tpl->set_var("FirstPageTextBlock", ""); $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", ""); $this->tpl->set_var("ContinuedNextPageTextBlock", ""); $this->tpl->set_var("TotalsBlock", ""); $this->tdPagingArray["tdPageNumber"]++; $this->formArray["pageNumber"]++; } } $tdCtr++; $tdContinuousCtr++; $this->tdPagingArray["tdPageRecordsCounter"]++; } } break; default: $this->formArray[$key] = $value; } } unset($rptop); } } $this->tpl->set_block("rptsTemplate", "Totals", "TotalsBlock"); $this->tpl->set_var("TotalsBlock", ""); //$this->setForm(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); // print_r($this->tpl->get("templatePage")); // exit; $testpdf = new PDFWriter(); $testpdf->setOutputXML($this->tpl->get("templatePage"), "test"); if (isset($this->formArray["print"])) { $testpdf->writePDF($name); //,$this->formArray["print"]); } else { $testpdf->writePDF($name); } //header("location: ".$testpdf->pdfPath); }
function Main() { switch ($this->formArray["formAction"]) { case "delete": //print_r($this->formArray); if (count($this->formArray["rptopID"]) > 0) { $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); if (!($deletedRows = $RPTOPList->deleteRPTOP($this->formArray["rptopID"]))) { $this->tpl->set_var("msg", "SOAP failed"); } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } break; case "updateCalculation": if (is_array($this->formArray["rptopID"])) { $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $DueEncode = new SoapObject(NCCBIZ . "DueEncode.php", "urn:Object"); $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object"); $dueIDArray = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => ""); $treasurySettings = new TreasurySettings(); $treasurySettings->selectRecord(); $this->formArray["masterBasicTaxRate"] = $treasurySettings->getPctRPTax(); $this->formArray["masterSEFTaxRate"] = $treasurySettings->getPctSEF(); $this->formArray["masterIdleTaxRate"] = $treasurySettings->getPctIdle(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $this->formArray["annualDueDate"] = $treasurySettings->getAnnualDueDate(); foreach ($this->formArray["rptopID"] as $rptopID) { if (!($xmlStr = $RPTOPDetails->getRPTOP($rptopID))) { // error xmlStr } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); $this->formArray["taxableYear"] = $rptop->getTaxableYear(); $tdArray = $rptop->getTDArray(); if (is_array($tdArray)) { foreach ($tdArray as $td) { $this->formArray["assessedValue"] = ""; $this->formArray["taxability"] = ""; $this->formArray["idle"] = ""; $this->formArray["tdID"] = $td->getTdID(); $this->formArray["dueID"] = ""; $this->formArray["propertyType"] = $td->getPropertyType(); if (!($afsXmlStr = $AFSDetails->getAFS($td->getAfsID()))) { // error afsXmlStr } else { if (!($afsDomDoc = domxml_open_mem($afsXmlStr))) { // error afsDomDoc } else { $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); $this->formArray["assessedValue"] = $afs->getTotalAssessedValue(); $this->formArray["taxability"] = $afs->getTaxability(); $this->formArray["effectivity"] = $afs->getEffectivity(); $this->formArray["dueDate"] = date("Y-n-d", strtotime($this->formArray["taxableYear"] . "-" . $this->formArray["annualDueDate"])); if ($this->formArray["propertyType"] == "Land") { if (is_array($afs->getLandArray())) { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } } if (!($dueXmlStr = $DueList->getDueList($td->getTdID(), $rptop->getTaxableYear()))) { $this->formArray["dueID"] = ""; $dueIDArray["Annual"] = ""; } else { if (!($dueDomDoc = domxml_open_mem($dueXmlStr))) { $this->formArray["dueID"] = ""; $dueIDArray["Annual"] = ""; } else { //print_r(htmlspecialchars($xmlStr)); //exit; $dueRecords = new DueRecords(); $dueRecords->parseDomDocument($dueDomDoc); foreach ($dueRecords->getArrayList() as $due) { foreach ($due as $dueKey => $dueValue) { switch ($dueKey) { case "dueType": $dueIDArray[$dueValue] = $due->getDueID(); break; } } } $this->formArray["dueID"] = $dueIDArray["Annual"]; } } $this->formArray["basicTaxRate"] = $this->formArray["masterBasicTaxRate"]; $this->formArray["sefTaxRate"] = $this->formArray["masterSEFTaxRate"]; $this->formArray["idleTaxRate"] = $this->formArray["masterIdleTaxRate"]; $this->formArray["basicTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["basicTaxRate"]; $this->formArray["sefTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["sefTaxRate"]; // if land->idle is "Yes", compute idleTax, otherwise set idleTax to zero if ($this->formArray["propertyType"] == "Land") { if ($this->formArray["idle"] == "Yes") { $this->formArray["idleTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["idleTaxRate"]; } else { $this->formArray["idleTax"] = "0.00"; } } // if afs->taxability is "Exempt", reset computations to zero. if ($this->formArray["taxability"] == "Exempt") { $this->formArray["basicTax"] = "0.00"; $this->formArray["sefTax"] = "0.00"; $this->formArray["idleTax"] = "0.00"; } if ($dueIDArray["Annual"] != "") { $dueArray = $this->setDues(); foreach ($dueArray as $due) { $doc = $due->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $DueEncode->updateDue($xmlStr))) { // error update } unset($doc); unset($xmlStr); } } else { $dueArray = $this->setDues(); foreach ($dueArray as $due) { $doc = $due->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $DueEncode->saveDue($xmlStr))) { // error save } unset($doc); unset($xmlStr); } } $this->formArray["taxableYear"] = $rptop->getTaxableYear(); $this->refreshTDHistory($td); } } unset($tdArray); } } } } if ($this->formArray["searchKey"] != "") { $this->formArray["formAction"] = "search"; } else { $this->formArray["formAction"] = ""; } header("Location: CalculateRPTOPBatch.php" . $this->sess->url("") . "&page=" . $this->formArray["page"] . "&sortBy=" . $this->formArray["sortBy"] . "&sortOrder=" . $this->formArray["sortOrder"] . "&formAction=" . $this->formArray["formAction"] . "&searchKey=" . $this->formArray["searchKey"]); exit; break; case "search": $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); if (!($count = $RPTOPList->getSearchCount($this->formArray["searchKey"]))) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $numOfPages = 1; $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1 . "&formAction=search&searchKey=" . urlencode($this->formArray["searchKey"])); $this->tpl->set_var("previousTxt", "previous"); } $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->searchRPTOP($this->formArray["page"], $condition, $this->formArray["searchKey"]))) { $this->tpl->set_var("pageOf", ""); $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_var("previousTxt", ""); $this->tpl->set_var("nextTxt", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", "error xmlDoc"); } else { $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxableYear", $value->getTaxableYear()); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { $totalTaxDue = "uncalculated"; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $totalTaxDue = "uncalculated"; } else { $due = new Due(); $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); } } } } else { $totalTaxDue = "no TD's"; } if (is_numeric($totalTaxDue)) { $totalTaxDue = formatCurrency($totalTaxDue); } $this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } break; case "cancel": header("location: CalculateRPTOPBatch.php"); exit; break; default: $this->tpl->set_var("msg", ""); $RPTOPList = new SoapObject(NCCBIZ . "RPTOPList.php", "urn:Object"); $this->tpl->set_block("rptsTemplate", "Pages", "PagesBlock"); $this->tpl->set_block("rptsTemplate", "PagesList", "PagesListBlock"); $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock"); $this->tpl->set_var("NotFoundBlock", ""); if (!($count = $RPTOPList->getRPTOPCount())) { $this->tpl->set_var("PagesBlock", ""); $this->tpl->set_var("PagesListBlock", ""); $this->tpl->set_block("rptsTemplate", "PageNavigator", "PageNavigatorBlock"); $this->tpl->set_var("PageNavigatorBlock", ""); } else { $numOfPages = ceil($count / PAGE_BY); // page list nav $this->formArray["pageLinksInLine"] = 7; if ($this->formArray["page"] < round($this->formArray["pageLinksInLine"] / 2)) { $startPageLinks = 1; } else { $startPageLinks = $this->formArray["page"] - round($this->formArray["pageLinksInLine"] / 2); if ($startPageLinks < 1) { $startPageLinks = 1; } } $endPageLinks = $startPageLinks + ($this->formArray["pageLinksInLine"] - 1); if ($endPageLinks > $numOfPages) { $endPageLinks = $numOfPages; } for ($i = $startPageLinks; $i <= $endPageLinks; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pageListPages", ""); $this->tpl->set_var("pageListPagesUrl", ""); $this->tpl->set_var("pageListPaged", $i); } else { $this->tpl->set_var("pageListPages", $i); $this->tpl->set_var("pageListPagesUrl", $i); $this->tpl->set_var("pageListPaged", ""); } $this->tpl->parse("PagesListBlock", "PagesList", true); } // drop down nav for ($i = 1; $i <= $numOfPages; $i++) { if ($i == $this->formArray["page"]) { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", "selected"); } else { $this->tpl->set_var("pages", $i); $this->tpl->set_var("pagesUrl", $i); $this->tpl->set_var("paged", ""); } $this->tpl->parse("PagesBlock", "Pages", true); } } if ($numOfPages == $this->formArray["page"]) { $this->tpl->set_var("nextTxt", ""); } else { $this->tpl->set_var("next", $this->formArray["page"] + 1); $this->tpl->set_var("nextTxt", "next"); } if ($this->formArray["page"] == 1) { $this->tpl->set_var("previousTxt", ""); } else { $this->tpl->set_var("previous", $this->formArray["page"] - 1); $this->tpl->set_var("previousTxt", "previous"); } if ($numOfPages == "") { $this->tpl->set_var("pageOf", ""); } else { $this->tpl->set_var("pageOf", $this->formArray["page"] . " of " . $numOfPages); } $condition = $this->sortBlocks(); if (!($xmlStr = $RPTOPList->getRPTOPList($this->formArray["page"], $condition))) { $this->tpl->set_block("rptsTemplate", "RPTOPTable", "RPTOPTableBlock"); $this->tpl->set_var("RPTOPTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "RPTOPListTable", "RPTOPListTableBlock"); $this->tpl->set_var("RPTOPListTableBlock", ""); } else { $rptopRecords = new RPTOPRecords(); $rptopRecords->parseDomDocument($domDoc); $list = $rptopRecords->getArrayList(); if (count($list)) { $this->tpl->set_block("rptsTemplate", "RPTOPDBEmpty", "RPTOPDBEmptyBlock"); $this->tpl->set_var("RPTOPDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_block("RPTOPList", "PersonList", "PersonListBlock"); $this->tpl->set_block("RPTOPList", "CompanyList", "CompanyListBlock"); foreach ($list as $key => $value) { $this->tpl->set_var("rptopID", $value->getRptopID()); $oValue = $value->owner; $pOwnerStr = ""; if (count($oValue->personArray)) { foreach ($oValue->personArray as $pKey => $pValue) { $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } if (count($oValue->companyArray)) { foreach ($oValue->companyArray as $cKey => $cValue) { $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("totalMarketValue", number_format($value->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("totalAssessedValue", number_format($value->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxableYear", $value->getTaxableYear()); // grab Dues of rptop to get totalTaxDue $totalTaxDue = 0.0; if (is_array($value->tdArray)) { foreach ($value->tdArray as $td) { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $afsXml = $AFSDetails->getAfs($td->getAfsID()); $afsDomDoc = domxml_open_mem($afsXml); $afs = new AFS(); $afs->parseDomDocument($afsDomDoc); if (!($xmlStr = $DueDetails->getDueFromTdID($td->getTdID(), $value->getTaxableYear()))) { $totalTaxDue = "uncalculated"; break; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $totalTaxDue = "uncalculated"; } else { $due = new Due(); $due->parseDomDocument($domDoc); $totalTaxDue += $due->getTaxDue(); } } } } else { $totalTaxDue = "no TD's"; } if (is_numeric($totalTaxDue)) { $totalTaxDue = formatCurrency($totalTaxDue); } $this->tpl->set_var("totalTaxDue", $totalTaxDue); $this->setRPTOPListBlockPerms(); $this->tpl->parse("RPTOPListBlock", "RPTOPList", true); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_var("CompanyListBlock", ""); } } else { $this->tpl->set_block("rptsTemplate", "RPTOPList", "RPTOPListBlock"); $this->tpl->set_var("RPTOPListBlock", "huh"); } } } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }