function Main() { $this->tpl->set_var("Session", $this->sess->url("")); $this->formArray["mergeBasketArray"] = explode(",", $this->formArray["mergeBasketCSV"]); if (is_array($this->formArray["mergeBasketArray"])) { $this->tpl->set_block("rptsTemplate", "NoODList", "NoODListBlock"); $this->tpl->set_var("NoODListBlock", ""); $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock"); $this->tpl->set_var("totalInMergeBasket", count($this->formArray["mergeBasketArray"])); foreach ($this->formArray["mergeBasketArray"] as $odID) { $od = new OD(); $od->selectRecord($odID); $owner = $od->owner; $ownerStr = ""; if (is_array($owner->personArray)) { foreach ($owner->personArray as $pKey => $pValue) { $ownerArray[] = $pValue->getFullName(); } } if (is_array($owner->companyArray)) { foreach ($owner->companyArray as $cKey => $cValue) { $ownerArray[] = $cValue->getCompanyName(); } } if (is_object($od->locationAddress)) { $this->tpl->set_var("locationAddress", $od->locationAddress->getFullAddress()); } else { $this->tpl->set_var("locationAddress", ""); } $this->tpl->set_var("landArea", number_format($od->getLandArea(), 2, '.', ',')); $this->tpl->set_var("odID", $od->getOdID()); if (is_array($ownerArray)) { $this->tpl->set_var("ownerName", implode(",", $ownerArray)); } else { $this->tpl->set_var("ownerName", ""); } $afs = new AFS(); $afs->selectRecord("", "", $odID, ""); if (is_object($afs)) { if ($afs->getPropertyIndexNumber() != "") { $propertyIndexNumber = $afs->getPropertyIndexNumber(); } else { $propertyIndexNumber = ""; } } $this->tpl->set_var("propertyIndexNumber", $propertyIndexNumber); $this->tpl->parse("ODListBlock", "ODList", true); unset($ownerArray); } } else { $this->tpl->set_block("rptsTemplate", "ShowODList", "ShowODListBlock"); $this->tpl->set_var("ShowODListBlock", ""); $this->tpl->set_var("totalInMergeBasket", 0); } $this->setForm(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { //echo $this->formArray["formAction"]; switch ($this->formArray["formAction"]) { case "delete": if (count($this->formArray["personID"]) > 0) { $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object"); if (!($deletedRows = $PersonList->deleteRecord($this->formArray["personID"]))) { $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"); } if (count($this->formArray["companyID"]) > 0) { $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object"); if (!($deletedRows = $CompanyList->deleteRecord($this->formArray["companyID"]))) { $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"); } header("location: ChangeOfOwnershipODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); exit; break; case "remove": if (count($this->formArray["personID"])) { $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (!($deletedRows = $OwnerList->removeOwnerPerson($this->formArray["ownerID"], $this->formArray["personID"]))) { $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"); } if (count($this->formArray["companyID"]) > 0) { $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (!($deletedRows = $OwnerList->removeOwnerCompany($this->formArray["ownerID"], $this->formArray["companyID"]))) { $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"); } header("location: ChangeOfOwnershipODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) { exit("xml failed"); } else { //exit($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $od = new OD(); $od->parseDomDocument($domDoc); foreach ($od as $key => $value) { if ($key == "locationAddress" && is_object($value)) { foreach ($value as $lkey => $lvalue) { $this->formArray[$lkey] = $lvalue; } } else { $this->formArray[$key] = $value; } } $this->formArray["landArea"] = number_format($od->getLandArea(), 4, '.', ','); $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); //$OwnerList = new SoapObject(NCCBIZ."OwnerList.php", "urn:Object"); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { //exit(print_r($OwnerList)); $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $this->displayOwnerList($domDoc); } } } } $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); if (!($afsID = $AFSEncode->getAfsID($this->formArray["odID"]))) { //$this->tpl->set_block("rptsTemplate", "AFSDetails", "AFSDetailsBlock"); //$this->tpl->set_var("AFSDetailsBlock", ""); //echo "1afsID=".$afsID."=>".$this->formArray["odID"]; $afs = new AFS(); $afs->setOdID($this->formArray["odID"]); $afs->setDomDocument(); $doc = $afs->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($afsID = $AFSEncode->saveAFS($xmlStr))) { echo "ret=" . $afsID; } //echo "<br>afsID=".$afsID; } else { //echo "2afsID=".$afsID."=>".$this->formArray["odID"]; //$this->tpl->set_block("rptsTemplate", "AFSEncode", "AFSEncodeBlock"); //$this->tpl->set_var("AFSEncodeBlock", ""); } $this->formArray["afsID"] = $afsID; $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { //echo $this->formArray["formAction"]; switch ($this->formArray["formAction"]) { case "delete": if (count($this->formArray["personID"]) > 0) { $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object"); if (!($deletedRows = $PersonList->deleteRecord($this->formArray["personID"]))) { $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"); } if (count($this->formArray["companyID"]) > 0) { $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object"); if (!($deletedRows = $CompanyList->deleteRecord($this->formArray["companyID"]))) { $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"); } header("location: ODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); exit; break; case "remove": if (count($this->formArray["personID"])) { $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (!($deletedRows = $OwnerList->removeOwnerPerson($this->formArray["ownerID"], $this->formArray["personID"]))) { $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"); } if (count($this->formArray["companyID"]) > 0) { $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (!($deletedRows = $OwnerList->removeOwnerCompany($this->formArray["ownerID"], $this->formArray["companyID"]))) { $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"); } header("location: ODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) { exit("xml failed"); } else { //exit($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $od = new OD(); $od->parseDomDocument($domDoc); foreach ($od as $key => $value) { if ($key == "locationAddress" && is_object($value)) { foreach ($value as $lkey => $lvalue) { $this->formArray[$lkey] = $lvalue; } } else { $this->formArray[$key] = $value; } } $this->formArray["landArea"] = number_format($od->getLandArea(), 4, '.', ','); // confirmation for double transaction $this->formArray["TRANSACTION_MAX_DAYDIFFERENCE"] = TRANSACTION_MAX_DAYDIFFERENCE; $this->formArray["dayDifference"] = getDateDifference($od->getDateCreated(), strtotime("now"), "d"); $this->formArray["dayDifferenceText"] = getOnlyDays($this->formArray["dayDifference"]); $this->formArray["transactionCode"] = $od->getTransactionCode(); $this->formArray["blockDoubleTransaction"] = $od->getArchive(); $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); //$OwnerList = new SoapObject(NCCBIZ."OwnerList.php", "urn:Object"); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { //exit(print_r($OwnerList)); $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $this->displayOwnerList($domDoc); } } } } $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); if (!($afsID = $AFSEncode->getAfsID($this->formArray["odID"]))) { //$this->tpl->set_block("rptsTemplate", "AFSDetails", "AFSDetailsBlock"); //$this->tpl->set_var("AFSDetailsBlock", ""); //echo "1afsID=".$afsID."=>".$this->formArray["odID"]; $afs = new AFS(); $afs->setOdID($this->formArray["odID"]); $afs->setDomDocument(); $doc = $afs->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($afsID = $AFSEncode->saveAFS($xmlStr))) { echo "ret=" . $afsID; } //echo "<br>afsID=".$afsID; } else { //echo "2afsID=".$afsID."=>".$this->formArray["odID"]; //$this->tpl->set_block("rptsTemplate", "AFSEncode", "AFSEncodeBlock"); //$this->tpl->set_var("AFSEncodeBlock", ""); } $this->displayODHistory(); $this->formArray["afsID"] = $afsID; $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("odID" => $this->formArray["odID"], "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 displaySucceedingOD() { $ODHistoryList = new SoapObject(NCCBIZ . "ODHistoryList.php", "urn:Object"); if (!($xmlStr = $ODHistoryList->getSucceedingODList($this->formArray["odID"]))) { $this->tpl->set_block("rptsTemplate", "SucceedingODList", "SucceedingODListBlock"); $this->tpl->set_var("SucceedingODListBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "SucceedingODList", "SucceedingODListBlock"); $this->tpl->set_var("SucceedingODListBlock", ""); } else { $odHistoryRecords = new ODHistoryRecords(); $odHistoryRecords->parseDomDocument($domDoc); $arrayList = $odHistoryRecords->getArrayList(); if (count($arrayList)) { $this->tpl->set_block("rptsTemplate", "SucceedingODDBEmpty", "SucceedingODDBEmptyBlock"); $this->tpl->set_var("SucceedingODDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "SucceedingODList", "SucceedingODListBlock"); $this->tpl->set_block("SucceedingODList", "SucceedingODPersonList", "SucceedingODPersonListBlock"); $this->tpl->set_block("SucceedingODList", "SucceedingODCompanyList", "SucceedingODCompanyListBlock"); foreach ($arrayList as $key => $value) { $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($value->getPresentODID()))) { // error xml } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domdoc } else { $succeedingOD = new OD(); $succeedingOD->parseDomDocument($domDoc); $this->tpl->set_var("odID", $succeedingOD->getOdID()); $this->tpl->set_var("transactionCode", $value->getTransactionCode()); $oValue = $succeedingOD->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("SucceedingODPersonListBlock", "SucceedingODPersonList", 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("SucceedingODCompanyListBlock", "SucceedingODCompanyList", true); } } if (count($oValue->personArray) || count($oValue->companyArray)) { $this->tpl->set_var("none", ""); } else { $this->tpl->set_var("none", "none"); } if ($succeedingOD->locationAddress != "") { $this->tpl->set_var("locationAddress", $succeedingOD->locationAddress->getFullAddress()); } $this->tpl->set_var("landArea", number_format($succeedingOD->getLandArea(), 2, '.', ',')); } } $this->tpl->set_var("odID", $value->getPresentODID()); $this->tpl->parse("SucceedingODListBlock", "SucceedingODList", true); $this->tpl->set_var("SucceedingODPersonListBlock", ""); $this->tpl->set_var("SucceedingODCompanyListBlock", ""); } } } } }
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); }