function getPropertyClassificationFromTD($tdID)
 {
     $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object");
     if (!($xmlStr = $TDDetails->getTD($tdID))) {
         return false;
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             return false;
         } else {
             $td = new TD();
             $td->parseDomDocument($domDoc);
             $afsID = $td->getAfsID();
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             if (!($xmlStr = $AFSDetails->getAFS($afsID))) {
                 return false;
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     return false;
                 } else {
                     $afs = new AFS();
                     $afs->parseDomDocument($domDoc);
                     $LandActualUsesDetails = new SoapObject(NCCBIZ . "LandActualUsesDetails.php", "urn:Object");
                     $PlantsTreesActualUsesDetails = new SoapObject(NCCBIZ . "PlantsTreesActualUsesDetails.php", "urn:Object");
                     $ImprovementsBuildingsActualUsesDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsActualUsesDetails.php", "urn:Object");
                     $MachineriesActualUsesDetails = new SoapObject(NCCBIZ . "MachineriesActualUsesDetails.php", "urn:Object");
                     if (is_array($afs->landArray)) {
                         foreach ($afs->landArray as $land) {
                             $landActualUsesID = $land->getActualUse();
                             if ($xmlStr = $LandActualUsesDetails->getLandActualUsesDetails($landActualUsesID)) {
                                 if ($domDoc = domxml_open_mem($xmlStr)) {
                                     $landActualUses = new LandActualUses();
                                     $landActualUses->parseDomDocument($domDoc);
                                     return $landActualUses->getReportCode();
                                 }
                             }
                         }
                     } else {
                         if (is_array($afs->plantsTreesArray)) {
                             foreach ($afs->plantsTreesArray as $plantsTrees) {
                                 $plantsTreesActualUsesID = $plantsTrees->getActualUse();
                                 if ($xmlStr = $PlantsTreesActualUsesDetails->getPlantsTreesActualUsesDetails($plantsTreesActualUsesID)) {
                                     if ($domDoc = domxml_open_mem($xmlStr)) {
                                         $plantsTreesActualUses = new PlantsTreesActualUses();
                                         $plantsTreesActualUses->parseDomDocument($domDoc);
                                         return $plantsTreesActualUses->getReportCode();
                                     }
                                 }
                             }
                         } else {
                             if (is_array($afs->improvementsBuildingsArray)) {
                                 foreach ($afs->improvementsBuildingsArray as $improvementsBuildings) {
                                     $improvementsBuildingsActualUsesID = $improvementsBuildings->getActualUse();
                                     if ($xmlStr = $ImprovementsBuildingsActualUsesDetails->getImprovementsBuildingsActualUsesDetails($improvementsBuildingsActualUsesID)) {
                                         if ($domDoc = domxml_open_mem($xmlStr)) {
                                             $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                                             $improvementsBuildingsActualUses->parseDomDocument($domDoc);
                                             return $improvementsBuildingsActualUses->getReportCode();
                                         }
                                     }
                                 }
                             } else {
                                 if (is_array($afs->machineriesArray)) {
                                     foreach ($afs->machineriesArray as $machineries) {
                                         $machineriesActualUsesID = $machineries->getActualUse();
                                         if ($xmlStr = $MachineriesActualUsesDetails->getMachineriesActualUsesDetails($machineriesActualUsesID)) {
                                             if ($domDoc = domxml_open_mem($xmlStr)) {
                                                 $machineriesActualUses = new MachineriesActualUses();
                                                 $machineriesActualUses->parseDomDocument($domDoc);
                                                 return $machineriesActualUses->getReportCode();
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     return true;
                 }
             }
         }
     }
 }
Пример #2
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $this->tpl->set_var("MessageBlock", "");
             $PlantsTreesActualUsesDetails = new SoapObject(NCCBIZ . "PlantsTreesActualUsesDetails.php", "urn:Object");
             if (!($xmlStr = $PlantsTreesActualUsesDetails->getPlantsTreesActualUsesDetails($this->formArray["plantsTreesActualUsesID"]))) {
                 $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 {
                     $plantsTreesActualUses = new PlantsTreesActualUses();
                     $plantsTreesActualUses->parseDomDocument($domDoc);
                     $this->formArray["plantsTreesActualUsesID"] = $plantsTreesActualUses->getPlantsTreesActualUsesID();
                     $this->formArray["code"] = $plantsTreesActualUses->getCode();
                     $this->formArray["reportCode"] = $plantsTreesActualUses->getReportCode();
                     $this->formArray["description"] = $plantsTreesActualUses->getDescription();
                     $this->formArray["value"] = $plantsTreesActualUses->getValue();
                     $this->formArray["status"] = $plantsTreesActualUses->getStatus();
                 }
             }
             break;
         case "save":
             if ($this->codeAlreadyExists() == true) {
                 $this->message = "Error. Cannot Save. Code already exists.";
                 $this->tpl->set_var("message", $this->message);
                 $this->tpl->parse("MessageBlock", "Message", true);
                 break;
             } else {
                 $this->tpl->set_var("MessageBlock", "");
             }
             $PlantsTreesActualUsesEncode = new SoapObject(NCCBIZ . "PlantsTreesActualUsesEncode.php", "urn:Object");
             if ($this->formArray["plantsTreesActualUsesID"] != "") {
                 $PlantsTreesActualUsesDetails = new SoapObject(NCCBIZ . "PlantsTreesActualUsesDetails.php", "urn:Object");
                 if (!($xmlStr = $PlantsTreesActualUsesDetails->getPlantsTreesActualUsesDetails($this->formArray["plantsTreesActualUsesID"]))) {
                     exit("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 {
                         $plantsTreesActualUses = new PlantsTreesActualUses();
                         $plantsTreesActualUses->parseDomDocument($domDoc);
                         $plantsTreesActualUses->setPlantsTreesActualUsesID($this->formArray["plantsTreesActualUsesID"]);
                         $plantsTreesActualUses->setCode($this->formArray["code"]);
                         $plantsTreesActualUses->setReportCode($this->formArray["reportCode"]);
                         $plantsTreesActualUses->setDescription($this->formArray["description"]);
                         $plantsTreesActualUses->setValue($this->formArray["value"]);
                         $plantsTreesActualUses->setStatus($this->formArray["status"]);
                         $plantsTreesActualUses->setDomDocument();
                         $doc = $plantsTreesActualUses->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $PlantsTreesActualUsesEncode->updatePlantsTreesActualUses($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 $plantsTreesActualUses->setPlantsTreesActualUsesID($this->formArray["plantsTreesActualUsesID"]);
                 $plantsTreesActualUses->setCode($this->formArray["code"]);
                 $plantsTreesActualUses->setReportCode($this->formArray["reportCode"]);
                 $plantsTreesActualUses->setDescription($this->formArray["description"]);
                 $plantsTreesActualUses->setValue($this->formArray["value"]);
                 $plantsTreesActualUses->setStatus($this->formArray["status"]);
                 $plantsTreesActualUses->setDomDocument();
                 $doc = $plantsTreesActualUses->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $PlantsTreesActualUsesEncode->savePlantsTreesActualUses($xmlStr))) {
                     exit("error save");
                 }
             }
             $this->formArray["plantsTreesActualUsesID"] = $ret;
             header("location: PlantsTreesActualUsesClose.php" . $this->sess->url("") . $this->sess->add_query(array("plantsTreesActualUsesID" => $ret)));
             //header("location: PlantsTreesActualUsesEncode.php");
             exit;
             break;
         case "cancel":
             header("location: PlantsTreesActualUsesClose.php" . $this->sess->url("") . $this->sess->add_query(array("plantsTreesActualUsesID" => $ret)));
             //header("location: PlantsTreesActualUsesList.php");
             exit;
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "PlantsTreesActualUsesID", "PlantsTreesActualUsesIDBlock");
             $this->tpl->set_var("PlantsTreesActualUsesIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
             $this->tpl->set_var("MessageBlock", "");
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Пример #3
0
 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()
 {
     switch ($this->formArray["formAction"]) {
         case "view":
             $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object");
             $condition = "";
             if ($this->formArray["filterByLocation"] == "true") {
                 if ($condition == "") {
                     $condition = " WHERE ";
                 }
                 $condition .= $this->filterLocationAddress();
             } else {
                 $this->tpl->set_block("rptsTemplate", "FilterLocationDetails", "FilterLocationDetailsBlock");
                 $this->tpl->set_var("FilterLocationDetailsBlock", "");
             }
             if ($this->formArray["filterByDate"] == "true") {
                 if ($condition == "") {
                     $condition = " WHERE ";
                 } else {
                     $condition .= " AND ";
                 }
                 $condition .= $this->filterDate();
             } else {
                 $this->tpl->set_block("rptsTemplate", "FilterDateDetails", "FilterDateDetailsBlock");
                 $this->tpl->set_var("FilterDateDetailsBlock", "");
             }
             $condition .= $this->filterArchives();
             $odRecords = new ODRecords();
             if ($this->formArray["filterByClassification"] == "true") {
                 $odIDArray = $this->filterByClassification($condition);
                 if (is_array($odIDArray)) {
                     $count = count($odIDArray);
                     $numOfPages = ceil($count / PAGE_BY);
                     $pLowerLimit = ($this->formArray["page"] - 1) * PAGE_BY;
                     $pUpperLimit = $pLowerLimit + PAGE_BY;
                     $this->tpl->set_var("currentPage", $this->formArray["page"]);
                     $this->tpl->set_var("numOfPages", $numOfPages);
                     $this->tpl->set_block("rptsTemplate", "PageListOne", "PageListOneBlock");
                     for ($p = 1; $p <= $numOfPages; $p++) {
                         $this->tpl->set_var("page", $p);
                         $this->initSelected("page", $p);
                         $this->tpl->parse("PageListOneBlock", "PageListOne", true);
                     }
                     for ($p = $pLowerLimit; $p < $pUpperLimit; $p++) {
                         if ($p < count($odIDArray)) {
                             $od = new OD();
                             $od->selectRecord($odIDArray[$p]);
                             $odRecords->arrayList[] = $od;
                         }
                     }
                 } else {
                     $this->tpl->set_block("rptsTemplate", "PageNavigationOne", "PageNavigationOneBlock");
                     $this->tpl->set_var("PageNavigationOneBlock", "");
                 }
             } else {
                 if (!($count = $odRecords->countRecords($condition))) {
                     $this->tpl->set_block("rptsTemplate", "PageNavigationOne", "PageNavigationOneBlock");
                     $this->tpl->set_var("PageNavigationOneBlock", "");
                 } else {
                     $numOfPages = ceil($count / PAGE_BY);
                     $this->tpl->set_var("currentPage", $this->formArray["page"]);
                     $this->tpl->set_var("numOfPages", $numOfPages);
                     $this->tpl->set_block("rptsTemplate", "PageListOne", "PageListOneBlock");
                     for ($p = 1; $p <= $numOfPages; $p++) {
                         $this->tpl->set_var("page", $p);
                         $this->initSelected("page", $p);
                         $this->tpl->parse("PageListOneBlock", "PageListOne", true);
                     }
                 }
                 $condition .= " LIMIT 0, 10";
                 $odRecords->selectRecords($condition);
             }
             if (!is_array($odRecords->getArrayList())) {
                 $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                 $this->tpl->set_var("message", "properties not found");
                 $this->tpl->parse("NotFoundBlock", "NotFound", true);
                 $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
                 $this->tpl->set_var("ReportBlock", "");
             } else {
                 $list = $odRecords->getArrayList();
                 $count = 0;
                 if (count($list)) {
                     $this->tpl->set_block("rptsTemplate", "ReportList", "ReportListBlock");
                     $noneFound = true;
                     foreach ($list as $key => $value) {
                         $afs = $this->getAFSDetails($value->getOdID());
                         if (is_object($afs)) {
                             $landList = $afs->getLandArray();
                             $plantsTreesList = $afs->getPlantsTreesArray();
                             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
                             $machineriesList = $afs->getMachineriesArray();
                             $kind = "";
                             $class = "";
                             $remarks = "";
                             $actualUse = "";
                             $actualUseReportCode = "";
                             if (is_array($landList)) {
                                 $kind = "Land";
                                 $land = $landList[0];
                                 $actualUse = $land->getActualUse();
                                 $landActualUses = new LandActualUses();
                                 $landActualUses->selectRecord($actualUse);
                                 $actualUse = $landActualUses->getDescription();
                                 $actualUseReportCode = $landActualUses->getReportCode();
                                 $remarks = $land->getMemoranda();
                             } else {
                                 if (is_array($plantsTreesList)) {
                                     $kind = "Land";
                                     $plantsTrees = $plantsTreesList[0];
                                     $actualUse = $plantsTrees->getActualUse();
                                     $plantsTreesActualUses = new PlantsTreesActualUses();
                                     $plantsTreesActualUses->selectRecord($actualUse);
                                     $actualUse = $plantsTreesActualUses->getDescription();
                                     $actualUseReportCode = $plantsTreesActualUses->getReportCode();
                                     $remarks = $plantsTrees->getMemoranda();
                                 } else {
                                     if (is_array($improvementsBuildingsList)) {
                                         $kind = "Improvements/Buildings";
                                         $improvementsBuildings = $improvementsBuildingsList[0];
                                         $actualUse = $improvementsBuildings->getActualUse();
                                         $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                                         $improvementsBuildingsActualUses->selectRecord($actualUse);
                                         $actualUse = $improvementsBuildingsActualUses->getDescription();
                                         $actualUseReportCode = $improvementsBuildingsActualUses->getReportCode();
                                         $remarks = $improvementsBuildings->getMemoranda();
                                     } else {
                                         if (is_array($machineriesList)) {
                                             $kind = "Machineries";
                                             $machineries = $machineriesList[0];
                                             $actualUse = $machineries->getActualUse();
                                             $machineriesActualUses = new MachineriesActualUses();
                                             $machineriesActualUses->selectRecord($actualUse);
                                             $actualUse = $machineriesActualUses->getDescription();
                                             $actualUseReportCode = $machineriesActualUses->getReportCode();
                                             $remarks = $machineries->getMemoranda();
                                         }
                                     }
                                 }
                             }
                             $this->tpl->set_var("kind", $kind);
                             $this->tpl->set_var("actualUse", $actualUse);
                             $this->tpl->set_var("actualUseReportCode", $actualUseReportCode);
                             $this->tpl->set_var("remarks", $remarks);
                             $this->tpl->set_var("taxability", $afs->getTaxability());
                             $this->formArray["odID"] = $value->getOdID();
                             $this->formArray["afsID"] = $afs->getAfsID();
                             $td = new TD();
                             if ($td->selectRecord("", $this->formArray["afsID"])) {
                                 $this->tpl->set_var("taxDeclarationNumber", $td->getTaxDeclarationNumber());
                             } else {
                                 $this->tpl->set_var("taxDeclarationNumber", "");
                             }
                             $this->tpl->set_var("area", $value->getLandArea());
                             $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber());
                             $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue()));
                             $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ','));
                             $oValue = $value->owner;
                             if (count($oValue->personArray)) {
                                 $firstOwner = $oValue->personArray[0]->getLastName();
                                 $firstOwner .= ", ";
                                 $firstOwner .= $oValue->personArray[0]->getFirstName();
                                 $firstOwner .= " ";
                                 $firstOwner .= substr($oValue->personArray[0]->getMiddleName(), 0, 1) . ".";
                                 $pAddress = $oValue->personArray[0]->addressArray ? $oValue->personArray[0]->addressArray[0]->getFullAddress() : "no address";
                                 $firstOwnerAddress = $pAddress;
                                 $firstOwnerTelephone = $oValue->personArray[0]->getTelephone();
                                 $this->tpl->set_var("firstOwner", $firstOwner);
                                 $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress);
                             }
                             if (count($oValue->companyArray)) {
                                 if ($firstOwner == "") {
                                     $firstOwner = $oValue->companyArray[0]->getCompanyName();
                                     $cAddress = $oValue->companyArray[0]->addressArray ? $oValue->companyArray[0]->addressArray[0]->getFullAddress() : "no \taddress";
                                     $firstOwnerAddress = $cAddress;
                                     $firstOwnerTelephone = $oValue->companyArray[0]->getTelephone();
                                     $this->tpl->set_var("firstOwner", $firstOwner);
                                     $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress);
                                 }
                             }
                             if ($firstOwner != "") {
                                 $this->tpl->set_var("none", "");
                                 if (count($oValue->personArray) + count($oValue->companyArray) > 1) {
                                     $this->tpl->set_var("andOthers", "(and others)");
                                 } else {
                                     $this->tpl->set_var("andOthers", "");
                                 }
                             } else {
                                 $this->tpl->set_var("none", "none");
                                 $this->tpl->set_var("firstOwner", "");
                                 $this->tpl->set_var("andOthers", "");
                                 $this->tpl->set_var("firstOwnerAddress", "");
                                 $this->tpl->set_var("firstOwnerTelephone", "");
                             }
                             if (is_array($oValue->personArray)) {
                                 foreach ($oValue->personArray as $person) {
                                     $ownerNamesArray[] = $person->getFullName();
                                 }
                             }
                             if (is_array($oValue->companyArray)) {
                                 foreach ($oValue->companyArray as $company) {
                                     $ownerNamesArray[] = $company->getCompanyName();
                                 }
                             }
                             if (is_array($ownerNamesArray)) {
                                 $this->tpl->set_var("ownerNames", implode(",<br>", $ownerNamesArray));
                             } else {
                                 $this->tpl->set_var("ownerNames", "");
                             }
                             unset($ownerNamesArray);
                             $locationAddress = $value->locationAddress->getFullAddress();
                             $this->tpl->set_var("location", $locationAddress);
                             $this->tpl->set_var("transactionCode", $value->getTransactionCode());
                             $this->tpl->set_var("assessorsLotNo", $value->getLotNumber());
                             $this->tpl->set_var("dateCreated", date('F j, Y, g:i a', $value->getDateCreated()));
                             if ($this->formArray["filterByClassification"] == "true") {
                                 $count++;
                                 if ($this->checkActualUseReportCode($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList)) {
                                     $noneFound = false;
                                     $this->tpl->parse("ReportListBlock", "ReportList", true);
                                 }
                             } else {
                                 $noneFound = false;
                                 $this->tpl->set_block("rptsTemplate", "FilterClassificationDetails", "FilterClassificationDetailsBlock");
                                 $this->tpl->set_var("FilterClassificationDetailsBlock", "");
                                 $this->tpl->parse("ReportListBlock", "ReportList", true);
                             }
                         }
                     }
                     if ($noneFound == true) {
                         $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                         $this->tpl->parse("NotFoundBlock", "NotFound", true);
                         $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
                         $this->tpl->set_var("ReportBlock", "");
                     } else {
                         $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                         $this->tpl->set_var("NotFoundBlock", "");
                     }
                 }
             }
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
             $this->tpl->set_var("message", "select a location to view report");
             $this->tpl->parse("NotFoundBlock", "NotFound", true);
             $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
             $this->tpl->set_var("ReportBlock", "");
             break;
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->set_var("rpts_Session", $this->sess->id);
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
 function getPropertyClassificationFromTD($tdID)
 {
     $td = new TD($this->dbName);
     if ($td->selectRecord($tdID)) {
         $afsID = $td->getAfsID();
         $afs = new AFS($this->dbName);
         if ($afs->selectRecord($afsID)) {
             if (is_array($afs->landArray)) {
                 foreach ($afs->landArray as $land) {
                     $landActualUsesID = $land->getActualUse();
                     $landActualUses = new LandActualUses($this->dbName);
                     if ($landActualUses->selectRecord($landActualUsesID)) {
                         return $landActualUses->getReportCode();
                     }
                 }
             } else {
                 if (is_array($afs->plantsTreesArray)) {
                     foreach ($afs->plantsTreesArray as $plantsTrees) {
                         $plantsTreesActualUsesID = $plantsTrees->getActualUse();
                         $plantsTreesActualUses = new PlantsTreesActualUses($this->dbName);
                         if ($plantsTreesActualUses->selectRecord($plantsTreesActualUsesID)) {
                             return $plantsTreesActualUses->getReportCode();
                         }
                     }
                 } else {
                     if (is_array($afs->improvementsBuildingsArray)) {
                         foreach ($afs->improvementsBuildingsArray as $improvementsBuildings) {
                             $improvementsBuildingsActualUsesID = $improvementsBuildings->getActualUse();
                             $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses($this->dbName);
                             if ($improvementsBuildingsActualUses->selectRecord($improvementsBuildingsActualUsesID)) {
                                 return $improvementsBuildingsActualUses->getReportCode();
                             }
                         }
                     } else {
                         if (is_array($afs->machineriesArray)) {
                             foreach ($afs->machineriesArray as $machineries) {
                                 $machineriesActualUsesID = $machineries->getActualUse();
                                 $machineriesActualUses = new MachineriesActualUses($this->dbName);
                                 if ($machineriesActualUses->selectRecord($machineriesActualUsesID)) {
                                     return $machineriesActualUses->getReportCode();
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return false;
 }
Пример #6
0
 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);
 }