function updateLandActualUses($xmlStr) { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } $landActualUses = new LandActualUses(); $landActualUses->parseDomDocument($domDoc); $ret = $landActualUses->updateRecord(); return $ret; }
function getLandActualUsesDetails($landActualUsesID) { $landActualUses = new LandActualUses(); $landActualUses->selectRecord($landActualUsesID); if (!($domDoc = $landActualUses->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } }
function displayPlantsTrees($plantsTrees) { if ($plantsTrees) { $this->displayDetails($plantsTrees); foreach ($plantsTrees as $pkey => $pvalue) { if (is_numeric($pvalue)) { switch ($pkey) { case "productClass": $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord($pvalue); $this->tpl->set_var("productClass", $plantsTreesClasses->getDescription()); break; case "actualUse": $plantsTreesActualUses = new LandActualUses(); $plantsTreesActualUses->selectRecord($pvalue); $this->tpl->set_var("actualUse", $plantsTreesActualUses->getDescription()); break; } } } $this->tpl->parse("PlantsTreesBlock", "PlantsTrees", true); } else { $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_var("PlantsTreesBlock", ""); } }
function Main() { $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error domDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); foreach ($rptop as $key => $value) { switch ($key) { case "owner": if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $this->formArray["ownerName"] = ""; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->formArray["ownerName"] = ""; } else { $this->displayOwnerList($domDoc); } } } else { $this->formArray["ownerNames"] = ""; } break; case "tdArray": $tdCtr = 0; if (count($value)) { foreach ($value as $tkey => $tvalue) { $this->tdRecord["arpNumber"] = $tvalue->getTaxDeclarationNumber(); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { // error xml } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $odID = $afs->getOdID(); $od = new OD(); $od->selectRecord($odID); if (is_object($od->locationAddress)) { $locationAddress = $od->getLocationAddress(); $this->tdRecord["location"] = $locationAddress->getBarangay() . ", " . $locationAddress->getMunicipalityCity(); } $this->tdRecord["assessedValue"] = $afs->getTotalAssessedValue(); switch ($tvalue->getPropertyType()) { case "ImprovementsBuildings": if (is_array($afs->getImprovementsBuildingsArray())) { $improvementsBuildings = $afs->improvementsBuildingsArray[0]; $actualUse = $improvementsBuildings->getActualUse(); if (is_numeric($actualUse)) { $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $actualUse = $improvementsBuildingsActualUses->getCode(); //$actualUse = $improvementsBuildingsActualUses->getDescription(); } $this->tdRecord["class"] = $actualUse; } break; case "Machineries": if (is_array($afs->getMachineriesArray())) { $machineries = $afs->machineriesArray[0]; $actualUse = $machineries->getActualUse(); if (is_numeric($actualUse)) { $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord($actualUse); $actualUse = $machineriesActualUses->getCode(); //$actualUse = $machineriesActualUses->getDescription(); } $this->tdRecord["class"] = $actualUse; } break; case "Land": default: if (is_array($afs->getLandArray())) { $land = $afs->landArray[0]; $actualUse = $land->getActualUse(); if (is_numeric($actualUse)) { $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $actualUse = $landActualUses->getCode(); //$actualUse = $landActualUses->getDescription(); } $this->tdRecord["class"] = $actualUse; } else { if (is_array($afs->getPlantsTreesArray())) { if (is_numeric($actualUse)) { $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord($actualUse); $actualUse = $plantsTreesActualUses->getCode(); //$actualUse = $plantsTreesActualUses->getDescription(); } $this->tdRecord["class"] = $actualUse; } } } } } // grab DueRecords from tdID $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object"); $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => ""); if (!($xmlStr = $DueList->getDueList($tvalue->getTdID(), $rptop->getTaxableYear()))) { // error xml // taxDue = uncalculated } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc // taxDue = uncalculated } else { $dueRecords = new DueRecords(); $dueRecords->parseDomDocument($domDoc); foreach ($dueRecords->getArrayList() as $due) { foreach ($due as $dueKey => $dueValue) { switch ($dueKey) { case "dueType": if ($dueValue == "Annual") { $this->formArray["totalTaxDue"] += $due->getTaxDue(); $this->tdRecord["basic"] = $due->getBasicTax(); $this->tdRecord["sef"] = $due->getSEFTax(); } $dueArrayList[$dueValue] = $due; $this->tpl->set_var("basicTax[" . $dueValue . "]", formatCurrency($due->getBasicTax())); $this->tpl->set_var("sefTax[" . $dueValue . "]", formatCurrency($due->getSEFTax())); $this->tpl->set_var("idleTax[" . $dueValue . "]", formatCurrency($due->getIdleTax())); $this->tpl->set_var("taxDue[" . $dueValue . "]", formatCurrency($due->getTaxDue())); $this->tpl->set_var("dueDate[" . $dueValue . "]", date("M. d, Y", strtotime($due->getDueDate()))); $dueDateYear = date("Y", strtotime($due->getDueDate())); $this->tdRecord["year"] = $dueDateYear; break; } } } $treasurySettings = new TreasurySettings(); $treasurySettings->selectRecord(); // initialize discountPeriod and discountPercentage for earlyPaymentDiscount $this->tpl->set_var("discountPercentage", $treasurySettings->getDiscountPercentage() . "%"); $this->tpl->set_var("discountPeriod", "January 01, " . $dueDateYear . " - " . date("F d, Y", strtotime($dueDateYear . "-" . $treasurySettings->getDiscountPeriod()))); $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $this->formArray["discountPeriod_End"] = strtotime($dueDateYear . "-" . $this->formArray["discountPeriod"]); $this->formArray["discountPeriod_Start"] = strtotime($dueDateYear . "-01-01"); // initialize advancedDiscountPercentage for advancedPayment $this->tpl->set_var("advancedDiscountPercentage", $treasurySettings->getAdvancedDiscountPercentage() . "%"); $this->formArray["advancedDiscountPercentage"] = $treasurySettings->getAdvancedDiscountPercentage(); // initialize penaltyLUTArray $penaltyLUTArray = $treasurySettings->getPenaltyLUT(); $this->penaltyLUTArray = $treasurySettings->getPenaltyLUT(); foreach ($dueArrayList as $dKey => $due) { $dueArrayList[$dKey]->setEarlyPaymentDiscountPeriod($this->formArray["discountPeriod"]); $dueArrayList[$dKey]->setEarlyPaymentDiscountPercentage($this->formArray["discountPercentage"]); // compute earlyPaymentDiscount as of today // check if today is within the discountPeriod and compute Discount // AND if today is BEFORE annual dueDate $dueArrayList[$dKey]->setEarlyPaymentDiscount(0.0); if (strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]) { if (strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } } // compute advancedPaymentDiscount as of today // check if today is BEFORE January 1 of the year of the annual dueDate $dueArrayList[$dKey]->setAdvancedPaymentDiscount(0.0); if (strtotime($this->now) < strtotime(date("Y", strtotime($dueArrayList[$dKey]->getDueDate())) . "-01-01")) { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["advancedDiscountPercentage"] / 100)); } $latestPaymentDate = $this->getLatestPaymentDate($dueArrayList); $amountPaidForDue = $this->getAmountPaidForDue($dueArrayList); $amnestyStatus = $this->getAmnestyStatusForDue($dueArrayList); // calculate Penalties verses either today or verses the last paymentDate if ($latestPaymentDate != "") { $dueArrayList[$dKey] = $this->computePenalty($latestPaymentDate, $dueArrayList[$dKey]); // if balance is 0 leave penalty as is, otherwise calculatePenalty according to date now $balance = $dueArrayList[$dKey]->getInitialNetDue() - $amountPaidForDue; if (round($balance, 4) > 0) { $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]); } } else { $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]); } $this->tpl->set_var("advancedPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty())); $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getInitialNetDue())); $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue(); if ($amnestyStatus) { $this->initialNetDue[$dKey] -= $dueArrayList[$dKey]->getPenalty(); $this->tpl->set_var("amnesty[" . $dKey . "]", "Yes"); } else { $this->tpl->set_var("amnesty[" . $dKey . "]", "No"); } if ($dKey == "Annual") { $this->tdRecord["penalty"] = $dueArrayList[$dKey]->getPenalty(); } } } } // display Backtaxes and previousTD Backtaxes $this->formArray["totalBacktaxesBalance"] = 0; $this->displayBacktaxTD($tvalue->getTdID()); $precedingTDArray = $this->getPrecedingTDArray($tvalue); if (is_array($precedingTDArray)) { foreach ($precedingTDArray as $precedingTD) { $this->displayBacktaxTD($precedingTD->getTdID()); } } $this->tpl->set_var("total", number_format($this->formArray["totalBacktaxesDue"], 2)); $this->tpl->set_var("totalBacktaxesBalance", number_format($this->formArray["totalBacktaxesBalance"], 2)); // grab dueID's and backtaxTDID's to run through payments // create $dueIDArray foreach ($dueArrayList as $due) { $this->dueIDArray[] = $due->getDueID(); } $this->displayTotalPaid(); $this->displayNetDue(); $this->tdArrayList[$this->tdRecord["year"] . $this->tdArrayListCounter] = $this->tdRecord; $this->tdArrayListCounter++; unset($this->tdRecord); $tdCtr++; } } else { // 0 } $this->tpl->set_var("tdCtr", $tdCtr); break; } } } } if (is_array($this->tdArrayList)) { ksort($this->tdArrayList); reset($this->tdArrayList); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->formArray["totalTaxDue"] = 0; foreach ($this->tdArrayList as $tdRecord) { $this->tpl->set_var("tdYPos", $this->formArray["tdYPosValue"]); $this->tpl->set_var("arpNumber", $tdRecord["arpNumber"]); $this->tpl->set_var("class", $tdRecord["class"]); if (strlen($tdRecord["location"]) > 25) { $this->formArray["tdYPosValue"] -= 15; } $this->tpl->set_var("location", $tdRecord["location"]); $this->tpl->set_var("year", $tdRecord["year"]); $this->tpl->set_var("assessedValue", formatCurrency($tdRecord["assessedValue"])); $this->tpl->set_var("basic", formatCurrency($tdRecord["basic"])); $this->tpl->set_var("sef", formatCurrency($tdRecord["sef"])); $this->tpl->set_var("penalty", formatCurrency($tdRecord["penalty"])); $this->tpl->set_var("taxDue", formatCurrency($tdRecord["taxDue"])); $this->formArray["totalTaxDue"] += $tdRecord["taxDue"]; $this->tpl->parse("TDListBlock", "TDList", true); $this->formArray["tdYPosValue"] -= 15; } } $this->setForm(); $this->setLguDetails(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $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); exit; }
function Main() { switch ($this->formArray["formAction"]) { case "remove": //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")"; $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) { if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) { $this->tpl->set_var("msg", "SOAP failed"); //echo "SOAP failed"; } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } //select $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { //echo($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $this->displayOwnerList($domDoc); } } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID()); $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName()); $this->formArray["cityAssessorName"] = $cityAssessor->getFullName(); } else { $cityAssessor = $value; $this->tpl->set_var("cityAssessorID", $cityAssessor); $this->tpl->set_var("cityAssessorName", $cityAssessor); $this->formArray["cityAssessorName"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID()); $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName()); $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName(); } else { $cityTreasurer = $value; $this->tpl->set_var("cityTreasurerID", $cityTreasurer); $this->tpl->set_var("cityTreasurerName", $cityTreasurer); $this->formArray["cityTreasurerName"] = $cityTreasurer; } break; case "tdArray": //$this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); //$this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); //$this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); //$this->tpl->set_block("TDList", "BacktaxesList", "BacktaxesListBlock"); $tdCtr = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); /* $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); */ foreach ($value as $tkey => $tvalue) { //foreach($tvalue as $column => $val){ // $this->tpl->set_var($column,$val); //} /* $this->tpl->set_var("tdID",$tvalue->getTDID()); $this->tpl->set_var("taxDeclarationNumber",$tvalue->getTaxDeclarationNumber()); $this->tpl->set_var("afsID",$tvalue->getAfsID()); $this->tpl->set_var("cancelsTDNumber",$tvalue->getCancelsTDNumber()); $this->tpl->set_var("canceledByTDNumber",$tvalue->getCanceledByTDNumber()); $this->tpl->set_var("taxBeginsWithTheYear",$tvalue->getTaxBeginsWithTheYear()); $this->tpl->set_var("ceasesWithTheYear",$tvalue->getCeasesWithTheYear()); $this->tpl->set_var("enteredInRPARForBy",$tvalue->getEnteredInRPARForBy()); $this->tpl->set_var("enteredInRPARForYear",$tvalue->getEnteredInRPARForYear()); $this->tpl->set_var("previousOwner",$tvalue->getPreviousOwner()); $this->tpl->set_var("previousAssessedValue",$tvalue->getPreviousAssessedValue()); list($dateArr["year"],$dateArr["month"],$dateArr["day"]) = explode("-",$tvalue->getProvincialAssessorDate()); $this->tpl->set_var("pa_yearValue",removePreZero($dateArr["year"])); $this->tpl->set_var("pa_month",removePreZero($dateArr["month"])); $this->tpl->set_var("pa_dayValue",removePreZero($dateArr["day"])); list($dateArr["year"],$dateArr["month"],$dateArr["day"]) = explode("-",$tvalue->getCityMunicipalAssessorDate()); $this->tpl->set_var("cm_yearValue",removePreZero($dateArr["year"])); $this->tpl->set_var("cm_month",removePreZero($dateArr["month"])); $this->tpl->set_var("cm_dayValue",removePreZero($dateArr["day"])); $this->tpl->set_var("provincialAssessorName",$tvalue->provincialAssessor); $this->tpl->set_var("cityMunicipalAssessorName",$tvalue->cityMunicipalAssessor); //$this->tpl->set_var("assessedValue",$tvalue->getAssessedValue()); $this->tpl->set_var("propertyType",$tvalue->getPropertyType()); $this->tpl->set_var("basicTax",""); $this->tpl->set_var("sefTax", ""); $this->tpl->set_var("total", ""); //$this->tpl->set_var("basicTax",$tvalue->getBasicTax()); //$this->tpl->set_var("sefTax",$tvalue->getSefTax()); //$this->tpl->set_var("total",$tvalue->getTotal()); */ $this->tdRecord["arpNumber"] = $tvalue->getTaxDeclarationNumber(); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { //$this->tpl->set_block("rptsTemplate", "AFSTable", "AFSTableBlock"); //$this->tpl->set_var("AFSTableBlock", "afs not found"); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { //$this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); //$this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $odID = $afs->getOdID(); $od = new OD(); $od->selectRecord($odID); if (is_object($od->locationAddress)) { $locationAddress = $od->getLocationAddress(); $this->tdRecord["location"] = $locationAddress->getBarangay() . ", " . $locationAddress->getMunicipalityCity(); } switch ($tvalue->getPropertyType()) { case "ImprovementsBuildings": if (is_array($afs->getImprovementsBuildingsArray())) { $improvementsBuildings = $afs->improvementsBuildingsArray[0]; $actualUse = $improvementsBuildings->getActualUse(); if (is_numeric($actualUse)) { $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $actualUse = $improvementsBuildingsActualUses->getCode(); //$actualUse = $improvementsBuildingsActualUses->getDescription(); } $this->tdRecord["class"] = $actualUse; } break; case "Machineries": if (is_array($afs->getMachineriesArray())) { $machineries = $afs->machineriesArray[0]; $actualUse = $machineries->getActualUse(); if (is_numeric($actualUse)) { $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord($actualUse); $actualUse = $machineriesActualUses->getCode(); //$actualUse = $machineriesActualUses->getDescription(); } $this->tdRecord["class"] = $actualUse; } break; case "Land": default: if (is_array($afs->getLandArray())) { $land = $afs->landArray[0]; $actualUse = $land->getActualUse(); if (is_numeric($actualUse)) { $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $actualUse = $landActualUses->getCode(); //$actualUse = $landActualUses->getDescription(); } $this->tdRecord["class"] = $actualUse; } else { if (is_array($afs->getPlantsTreesArray())) { if (is_numeric($actualUse)) { $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord($actualUse); $actualUse = $plantsTreesActualUses->getCode(); //$actualUse = $plantsTreesActualUses->getDescription(); } $this->tdRecord["class"] = $actualUse; } } } $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue(); $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue(); $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxability", $afs->getTaxability()); $this->tpl->set_var("effectivity", $afs->getEffectivity()); $this->formArray["idle"] = "No"; if ($tvalue->getPropertyType() == "Land") { if (is_array($afs->landArray)) { // if land is stripped if (count($afs->landArray) > 1) { foreach ($afs->landArray as $land) { if ($land->getIdle() == "Yes") { $this->formArray["idle"] = "Yes"; break; } } } else { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } if ($this->formArray["idle"] == "") { $this->formArray["idle"] = "No"; } $this->tpl->set_var("idle", $this->formArray["idle"]); } } // grab DueRecords from tdID $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object"); $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => ""); if (!($xmlStr = $DueList->getDueList($tvalue->getTdID(), $rptop->getTaxableYear()))) { if ($this->formArray["rptopID"] != "") { $redirectMessage = "Dues are uncalculated. <a href='CalculateRPTOPDetails.php" . $this->sess->url("") . "&rptopID=" . $this->formArray["rptopID"] . "'>Click here</a> to go to calculation page or <a href='SOA.php" . $this->sess->url("") . "'>return to list</a>."; } else { $redirectMessage = "Dues are uncalculated. <a href='SOA.php" . $this->sess->url("") . "'>Click here</a> to return to list."; } exit($redirectMessage); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { if ($this->formArray["rptopID"] != "") { $redirectMessage = "Dues are uncalculated. <a href='CalculateRPTOPDetails.php" . $this->sess->url("") . "&rptopID=" . $this->formArray["rptopID"] . "'>Click here</a> to go to calculation page or <a href='SOA.php" . $this->sess->url("") . "'>return to list</a>."; } else { $redirectMessage = "Dues are uncalculated. <a href='SOA.php" . $this->sess->url("") . "'>Click here</a> to return to list."; } exit($redirectMessage); } else { $dueRecords = new DueRecords(); $dueRecords->parseDomDocument($domDoc); foreach ($dueRecords->getArrayList() as $due) { foreach ($due as $dueKey => $dueValue) { switch ($dueKey) { case "dueType": if ($dueValue == "Annual") { $this->formArray["totalTaxDue"] += $due->getTaxDue(); } $dueArrayList[$dueValue] = $due; $this->tpl->set_var("basicTax[" . $dueValue . "]", formatCurrency($due->getBasicTax())); $this->tpl->set_var("sefTax[" . $dueValue . "]", formatCurrency($due->getSEFTax())); $this->tpl->set_var("idleTax[" . $dueValue . "]", formatCurrency($due->getIdleTax())); $this->tpl->set_var("taxDue[" . $dueValue . "]", formatCurrency($due->getTaxDue())); $this->tpl->set_var("dueDate[" . $dueValue . "]", date("M. d, Y", strtotime($due->getDueDate()))); $dueDateYear = date("Y", strtotime($due->getDueDate())); $this->tdRecord["year"] = $dueDateYear; break; } } } $treasurySettings = new TreasurySettings(); $treasurySettings->selectRecord(); // initialize discountPeriod and discountPercentage for earlyPaymentDiscount $this->tpl->set_var("discountPercentage", $treasurySettings->getDiscountPercentage() . "%"); $this->tpl->set_var("discountPeriod", "January 01, " . $dueDateYear . " - " . date("F d, Y", strtotime($dueDateYear . "-" . $treasurySettings->getDiscountPeriod()))); $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $this->formArray["discountPeriod_End"] = strtotime($dueDateYear . "-" . $this->formArray["discountPeriod"]); $this->formArray["discountPeriod_Start"] = strtotime($dueDateYear . "-01-01"); // initialize advancedDiscountPercentage for advancedPayment $this->tpl->set_var("advancedDiscountPercentage", $treasurySettings->getAdvancedDiscountPercentage() . "%"); $this->formArray["advancedDiscountPercentage"] = $treasurySettings->getAdvancedDiscountPercentage(); $this->tpl->set_var("q1AdvancedDiscountPercentage", $treasurySettings->getQ1AdvancedDiscountPercentage() . "%"); $this->formArray["q1AdvancedDiscountPercentage"] = $treasurySettings->getQ1AdvancedDiscountPercentage(); // initialize penaltyLUTArray $penaltyLUTArray = $treasurySettings->getPenaltyLUT(); $this->penaltyLUTArray = $treasurySettings->getPenaltyLUT(); foreach ($dueArrayList as $dKey => $due) { $dueArrayList[$dKey]->setEarlyPaymentDiscountPeriod($this->formArray["discountPeriod"]); $dueArrayList[$dKey]->setEarlyPaymentDiscountPercentage($this->formArray["discountPercentage"]); // compute earlyPaymentDiscount as of today // check if today is within the discountPeriod and compute Discount // AND if today is BEFORE annual dueDate $dueArrayList[$dKey]->setEarlyPaymentDiscount(0.0); if ($due->getDueType() == "Annual") { if (strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]) { if (strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } } } else { // if today is BEFORE dueDate if (strtotime($this->now) <= strtotime($due->getDueDate()) && strtotime($this->now) >= $this->formArray["discountPeriod_Start"]) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } // commented out Febuary 08, 2005 : Provide Quarterly Discounts // earlyPaymentDiscount aren't given to Quarterly Dues except for Quarter 1 /* if($due->getDueType()=="Q1"){ if(strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]){ if(strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())){ $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"]/100)); } } } */ } // compute advancedPaymentDiscount as of today // check if today is BEFORE January 1 of the year of the annual dueDate $dueArrayList[$dKey]->setAdvancedPaymentDiscount(0.0); if (strtotime($this->now) < strtotime(date("Y", strtotime($dueArrayList[$dKey]->getDueDate())) . "-01-01")) { // for advanced payments, give 20% discount to annual dues [advanced discount] // give 10% discount to quarterly dues [early discount] if ($due->getDueType() == "Annual") { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["advancedDiscountPercentage"] / 100)); } else { if ($due->getDueType() == "Q1") { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["q1AdvancedDiscountPercentage"] / 100)); } else { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } // commented out: February 08, 2005 // advancedPaymentDiscount aren't given to Quarterly Dues except for Quarter 1 /* if($due->getDueType()=="Q1"){ $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["q1AdvancedDiscountPercentage"]/100)); } */ } } $latestPaymentDate[$dKey] = $this->getLatestPaymentDateForDue($dueArrayList[$dKey]); $amountPaidForDue = $this->getAmountPaidForDue($dueArrayList); $latestPaymentDueType = $this->getLatestPaymentDueType($dueArrayList); $amnestyStatus[$dKey] = $this->getAmnestyStatusForDue($dueArrayList[$dKey]); $totalEarlyPaymentDiscount = $this->getTotalEarlyPaymentDiscountForDue($dueArrayList); $totalAdvancedPaymentDiscount = $this->getTotalAdvancedPaymentDiscountForDue($dueArrayList); if ($totalEarlyPaymentDiscount > 0) { $earlyPaymentDiscountForDueType = $this->getTotalEarlyPaymentDiscountForDueType($dueArrayList[$dKey]); if ($earlyPaymentDiscountForDueType > 0) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($earlyPaymentDiscountForDueType); } } if ($totalAdvancedPaymentDiscount > 0) { $advancedPaymentDiscountForDueType = $this->getTotalAdvancedPaymentDiscountForDueType($dueArrayList[$dKey]); if ($advancedPaymentDiscountForDueType > 0) { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($advancedPaymentDiscountForDueType); } } // calculate Penalties verses either today or verses the last paymentDate if ($latestPaymentDate[$dKey] != "" || $latestPaymentDate[$dKey] != "now") { $dueArrayList[$dKey] = $this->computePenalty($latestPaymentDate[$dKey], $dueArrayList[$dKey]); // if balance is 0 leave penalty as is, otherwise calculatePenalty according to date now $balance = round($dueArrayList[$dKey]->getInitialNetDue() - $amountPaidForDue, 4); // 0.1 is used instead of 0 because a lot of balances may end up as 0.002 or so... if ($balance > 0.1) { $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]); } } else { $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]); } //print_r($dueArrayList[$dKey]); //echo "<hr>"; $this->tpl->set_var("advancedPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty())); $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue(); if ($amnestyStatus[$dKey]) { $this->initialNetDue[$dKey] -= $dueArrayList[$dKey]->getPenalty(); $this->tpl->set_var("amnesty[" . $dKey . "]", "Yes"); } else { $this->tpl->set_var("amnesty[" . $dKey . "]", "No"); } $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($this->initialNetDue[$dKey])); } // out of the loop, // verify balances to make disable penalties and discounts for Annual if ALL QUARTERS have been paid // and to disable penalties and discounts for Quarters if ALL of ANNUAL has been paid // example: Q1, Q2, Q3 and Q4 have been fully paid. Annual should not show any payables. // Likewise if Annual has been fully paid, Q1, Q2, Q3 and Q4 should not show any payables. $totalQuarterlyNetDue = 0; $totalQuarterlyNetDue += $dueArrayList["Q1"]->getBasicTax() + $dueArrayList["Q1"]->getSefTax() + $dueArrayList["Q1"]->getIdleTax(); $totalQuarterlyNetDue -= $dueArrayList["Q1"]->getEarlyPaymentDiscount() + $dueArrayList["Q1"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Q1"]) { $totalQuarterlyNetDue += $dueArrayList["Q1"]->getPenalty(); } $totalQuarterlyNetDue += $dueArrayList["Q2"]->getBasicTax() + $dueArrayList["Q2"]->getSefTax() + $dueArrayList["Q2"]->getIdleTax(); $totalQuarterlyNetDue -= $dueArrayList["Q2"]->getEarlyPaymentDiscount() + $dueArrayList["Q2"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Q2"]) { $totalQuarterlyNetDue += $dueArrayList["Q2"]->getPenalty(); } $totalQuarterlyNetDue += $dueArrayList["Q3"]->getBasicTax() + $dueArrayList["Q3"]->getSefTax() + $dueArrayList["Q3"]->getIdleTax(); $totalQuarterlyNetDue -= $dueArrayList["Q3"]->getEarlyPaymentDiscount() + $dueArrayList["Q3"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Q3"]) { $totalQuarterlyNetDue += $dueArrayList["Q3"]->getPenalty(); } $totalQuarterlyNetDue += $dueArrayList["Q4"]->getBasicTax() + $dueArrayList["Q4"]->getSefTax() + $dueArrayList["Q4"]->getIdleTax(); $totalQuarterlyNetDue -= $dueArrayList["Q4"]->getEarlyPaymentDiscount() + $dueArrayList["Q4"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Q4"]) { $totalQuarterlyNetDue += $dueArrayList["Q4"]->getPenalty(); } $totalAnnualNetDue = 0; $totalAnnualNetDue += $dueArrayList["Annual"]->getBasicTax() + $dueArrayList["Annual"]->getSefTax() + $dueArrayList["Annual"]->getIdleTax(); $totalAnnualNetDue -= $dueArrayList["Annual"]->getEarlyPaymentDiscount() + $dueArrayList["Annual"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Annual"]) { $totalAnnualNetDue += $dueArrayList["Annual"]->getPenalty(); } if ($latestPaymentDueType != "Annual" && $totalQuarterlyNetDue - $amountPaidForDue <= 0) { // all QUARTERLY DUES have been paid, modify Annual Due values $dueArrayList["Annual"]->setAdvancedPaymentDiscount(0); $dueArrayList["Annual"]->setEarlyPaymentDiscount(0); $dueArrayList["Annual"]->setMonthsOverDue(0); $dueArrayList["Annual"]->setPenaltyPercentage(0); $dueArrayList["Annual"]->setPenalty(0); $this->initialNetDue["Annual"] = $dueArrayList["Annual"]->getInitialNetDue(); $this->tpl->set_var("advancedPaymentDiscount[Annual]", formatCurrency($dueArrayList["Annual"]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount[Annual]", formatCurrency($dueArrayList["Annual"]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[Annual]", $dueArrayList["Annual"]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[Annual]", $dueArrayList["Annual"]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[Annual]", formatCurrency($dueArrayList["Annual"]->getPenalty())); $this->tpl->set_var("amnesty[Annual]", "No"); $this->tpl->set_var("initialNetDue[Annual]", formatCurrency($this->initialNetDue["Annual"])); } else { if ($latestPaymentDueType == "Annual" && $totalAnnualNetDue - $amountPaidForDue <= 0) { // all of ANNUAL Due has been fully paid, modify Quarterly Due values $quarterlyDueKeys = array("Q1", "Q2", "Q3", "Q4"); foreach ($quarterlyDueKeys as $dKey) { $dueArrayList[$dKey]->setAdvancedPaymentDiscount(0); $dueArrayList[$dKey]->setEarlyPaymentDiscount(0); $dueArrayList[$dKey]->setMonthsOverDue(0); $dueArrayList[$dKey]->setPenaltyPercentage(0); $dueArrayList[$dKey]->setPenalty(0); $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue(); $this->tpl->set_var("advancedPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty())); $this->tpl->set_var("amnesty[" . $dKey . "]", "No"); $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($this->initialNetDue[$dKey])); } } } } } // display Backtaxes and previousTD Backtaxes $this->formArray["totalBacktaxesBalance"] = 0; $this->displayBacktaxTD($tvalue->getTdID()); $precedingTDArray = $this->getPrecedingTDArray($tvalue); if (is_array($precedingTDArray)) { foreach ($precedingTDArray as $precedingTD) { $this->displayBacktaxTD($precedingTD->getTdID()); } } $this->tpl->set_var("total", number_format($this->formArray["totalBacktaxesDue"], 2)); $this->tpl->set_var("totalBacktaxesBalance", number_format($this->formArray["totalBacktaxesBalance"], 2)); // grab dueID's and backtaxTDID's to run through payments // create $dueIDArray foreach ($dueArrayList as $due) { $this->dueIDArray[] = $due->getDueID(); } $this->displayTotalPaid(); $this->displayNetDue(); $this->tdArrayList[$this->tdRecord["year"] . $this->tdArrayListCounter] = $this->tdRecord; $this->tdArrayListCounter++; unset($this->tdRecord); $this->tpl->set_var("ctr", $tdCtr); //$this->tpl->parse("defaultTDListBlock", "defaultTDList", true); //$this->tpl->parse("toggleTDListBlock", "toggleTDList", true); //$this->tpl->parse("TDListBlock", "TDList", true); //$this->tpl->set_var("BacktaxesListBlock", ""); /* $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); */ $tdCtr++; } } else { $this->tpl->set_var("defaultTDListBlock", "//no default"); $this->tpl->set_var("toggleTDListBlock", "//no Toggle"); $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; case "landTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "landTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; default: $this->formArray[$key] = $value; } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; unset($rptop); $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $rptop = new RPTOP(); $rptop->setRptopID($this->formArray["rptopID"]); $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]); $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]); $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]); $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]); $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]); $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]); $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]); $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]); $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]); $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]); $rptop->setCreatedBy($this->userID); $rptop->setModifiedBy($this->userID); $rptop->setDomDocument(); $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object"); $rptop->setDomDocument(); $doc = $rptop->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $RPTOPEncode->updateRPTOPtotals($xmlStr))) { echo "ret=" . $ret; } //echo $ret; } } if (is_array($this->tdArrayList)) { ksort($this->tdArrayList); reset($this->tdArrayList); // $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("rptsTemplate", "Page", "PageBlock"); $this->tpl->set_block("Page", "TDList", "TDListBlock"); $this->tpl->set_block("Page", "TotalDue", "TotalDueBlock"); $this->formArray["totalTaxDue"] = 0; $maxRows = 20; $numRows = count($this->tdArrayList); $numPages = ceil($numRows / $maxRows); $rowStr = ""; $j = 0; $page = 0; foreach ($this->tdArrayList as $tdRecord) { ++$j; if ($j > $maxRows) { $this->formArray["tdYPosValue"] = "564"; $this->tpl->set_var("TDListBlock", $rowStr); $this->tpl->set_var("PageNumber", ++$page); if ($page == $numPages) { $this->tpl->set_var("TotalDueBlock", $this->tpl->subst("TotalDue")); } else { $this->tpl->set_var("TotalDueBlock", ""); } $this->tpl->parse("PageBlock", "Page", true); $rowStr = ""; $j = 1; } $this->tpl->set_var("arpNumber", $tdRecord["arpNumber"]); $this->tpl->set_var("class", $tdRecord["class"]); $this->tpl->set_var("location", $tdRecord["location"]); $this->tpl->set_var("year", $tdRecord["year"]); $this->tpl->set_var("taxDue", formatCurrency($tdRecord["taxDue"])); $this->tpl->set_var("tdYPos", $this->formArray["tdYPosValue"]); $this->formArray["tdYPosValue"] -= 15; $this->formArray["totalTaxDue"] += $tdRecord["taxDue"]; $rowStr .= $this->tpl->subst("TDList"); } $this->tpl->set_var("TDListBlock", $rowStr); $this->tpl->set_var("PageNumber", ++$page); if ($page == $numPages) { $this->tpl->set_var("TotalDueBlock", $this->tpl->subst("TotalDue")); } else { $this->tpl->set_var("TotalDueBlock", ""); } $this->tpl->parse("PageBlock", "Page", true); // echo $this->tpl->subst("Page"); /* $maxRows = 5; $numRows = count($this->tdArrayList); $numPages = ceil($numRows/$maxRows); $tdRecord = current($this->tdArrayList); for ($page=0; $page<$numPages; ++$page) { $rowStr = ""; $this->formArray["tdYPosValue"] = "564"; for ($currRow=0; $currRow<$maxRows; ++$currRow) { // $tdRecord = $this->tdArrayList[($page*$maxRows)+$currRow]; $this->tpl->set_var("arpNumber", $tdRecord["arpNumber"]); $this->tpl->set_var("class", $tdRecord["class"]); $this->tpl->set_var("location", $tdRecord["location"]); $this->tpl->set_var("year", $tdRecord["year"]); $this->tpl->set_var("taxDue", formatCurrency($tdRecord["taxDue"])); $this->tpl->set_var("tdYPos", $this->formArray["tdYPosValue"]); $this->formArray["tdYPosValue"]-=15; $rowStr .= $this->tpl->subst("TDList"); $this->formArray["totalTaxDue"] += $tdRecord["taxDue"]; $tdRecord = next($this->tdArrayList); } echo $rowStr; $this->tpl->set_var("TDListBlock", $rowStr); $this->tpl->set_var("PageNum", $page+1); $this->tpl->parse("PageBlock", "Page", true); } foreach($this->tdArrayList as $tdRecord){ $this->tpl->set_var("arpNumber", $tdRecord["arpNumber"]); $this->tpl->set_var("class", $tdRecord["class"]); $this->tpl->set_var("location", $tdRecord["location"]); $this->tpl->set_var("year", $tdRecord["year"]); $this->tpl->set_var("taxDue", formatCurrency($tdRecord["taxDue"])); $this->tpl->set_var("tdYPos", $this->formArray["tdYPosValue"]); $this->formArray["totalTaxDue"] += $tdRecord["taxDue"]; $this->tpl->parse("TDListBlock", "TDList", true); $this->formArray["tdYPosValue"]-=15; } */ } $this->setForm(); /* $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y",strtotime($this->now))); $this->tpl->set_var("Session", $this->sess->url("").$this->sess->add_query(array("rptopID"=>$this->formArray["rptopID"],"ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); */ $this->tpl->set_var("today", date("F j, Y", strtotime($this->now))); $this->setLguDetails(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $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); exit; }
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; } } } } }
function displayLandList($landList) { $landTotal = 0; if (count($landList)) { $l = 0; foreach ($landList as $key => $land) { if ($this->pl == 0) { //$this->formArray["arpNumber"] = $land->getArpNumber(); //$this->formArray["propertyIndexNumber"] = $land->getPropertyIndexNumber(); $this->formArray["octTctNumber"] = $land->getOctTctNumber(); $this->formArray["surveyNumber"] = $land->getSurveyNumber(); $this->formArray["north"] = $land->getNorth(); $this->formArray["east"] = $land->getEast(); $this->formArray["south"] = $land->getSouth(); $this->formArray["west"] = $land->getWest(); $this->formArray["taxability"] = $land->getTaxability(); $this->formArray["effectivity"] = $land->getEffectivity(); $this->formArray["memoranda"] = $land->getMemoranda(); if (is_a($land->propertyAdministrator, Person)) { $this->formArray["administrator"] = $land->propertyAdministrator->getFullName(); if (is_a($land->propertyAdministrator->addressArray[0], "address")) { $address1 = $land->propertyAdministrator->addressArray[0]->getNumber(); $address1 .= " " . $land->propertyAdministrator->addressArray[0]->getStreet(); $address1 .= ", " . $land->propertyAdministrator->addressArray[0]->getBarangay(); $address2 = $land->propertyAdministrator->addressArray[0]->getDistrict(); $address2 .= ", " . $land->propertyAdministrator->addressArray[0]->getMunicipalityCity(); $address2 .= ", " . $land->propertyAdministrator->addressArray[0]->getProvince(); $this->formArray["adminAddress1"] = $address1; $this->formArray["adminAddress2"] = $address2; } $this->formArray["adminTelno"] = $land->propertyAdministrator->getTelephone(); } // recommendingApproval if (is_numeric($land->recommendingApproval)) { $recommendingApproval = new Person(); $recommendingApproval->selectRecord($land->recommendingApproval); $this->formArray["recommendingApproval"] = $recommendingApproval->getFullName(); $this->recommendingApproval = $recommendingApproval->getFullName(); } else { $recommendingApproval = $land->recommendingApproval; $this->formArray["recommendingApproval"] = $recommendingApproval; $this->recommendingApproval = $recommendingApproval; } $this->formArray["dateRecommendingApproval"] = $land->getRecommendingApprovalDate(); // approvedBy if (is_numeric($land->approvedBy)) { $approvedBy = new Person(); $approvedBy->selectRecord($land->approvedBy); $this->formArray["approvedBy"] = $approvedBy->getFullName(); $this->approvedBy = $approvedBy->getFullName(); } else { $approvedBy = $land->approvedBy; $this->formArray["approvedBy"] = $approvedBy; $this->approvedBy = $approvedBy; } $this->formArray["dateApprovedBy"] = $land->getApprovedByDate(); // appraisedBy (assessedBy) if (is_numeric($land->appraisedBy)) { $appraisedBy = new Person(); $appraisedBy->selectRecord($land->appraisedBy); $this->formArray["assessedBy"] = $appraisedBy->getFullName(); $this->appraisedBy = $appraisedBy->getFullName(); } else { $appraisedBy = $land->appraisedBy; $this->formArray["assessedBy"] = $appraisedBy; $this->appraisedBy = $appraisedBy; } $this->formArray["dateAssessedBy"] = $land->getAppraisedByDate(); } if ($l < 9) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $this->formArray["classification" . ($l + 1)] = $landClasses->getDescription(); } else { $this->formArray["classification" . ($l + 1)] = $land->getClassification(); } // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $this->formArray["subClass" . ($l + 1)] = $landSubclasses->getDescription(); } else { $this->formArray["subClass" . ($l + 1)] = $land->getSubClass(); } $this->formArray["area" . ($l + 1)] = $land->getArea() . " " . $this->getUnit($land->getUnit); // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $this->formArray["landActualUse" . ($l + 1)] = $landActualUses->getDescription(); } else { $this->formArray["landActualUse" . ($l + 1)] = $land->getActualUse(); } $this->formArray["unitValue" . ($l + 1)] = $land->getUnitValue(); $this->formArray["landMrktVal" . ($l + 1)] = $land->getMarketValue(); $landTotal = $landTotal + toFloat($land->getMarketValue()); } if ($this->pl < 6) { $this->formArray["valAdjFacMrktVal" . ($this->pl + 1)] = $land->getMarketValue(); $this->formArray["adjFacTxt" . ($this->pl + 1)] = $land->getAdjustmentFactor(); $this->formArray["adjFacInt" . ($this->pl + 1)] = "L"; $this->formArray["adjustment" . ($this->pl + 1)] = $land->getPercentAdjustment(); $this->formArray["valueAdjustment" . ($this->pl + 1)] = $land->getValueAdjustment(); $this->formArray["valAdjFacAdjMrktVal" . ($this->pl + 1)] = $land->getAdjustedMarketValue(); $this->formArray["valAdjFacTotal"] = $this->formArray["valAdjFacTotal"] + toFloat($land->getAdjustedMarketValue()); } if ($this->pl < 5) { $this->formArray["kind" . ($this->pl + 1)] = "Land"; $this->formArray["propertyActualUse" . ($this->pl + 1)] = $land->getActualUse(); $this->formArray["propertyAdjMrktVal" . ($this->pl + 1)] = $land->getAdjustedMarketValue(); $this->formArray["level" . ($this->pl + 1)] = $land->getAssessmentLevel(); $this->formArray["assessedValue" . ($this->pl + 1)] = $land->getAssessedValue(); $this->formArray["propertyAdjMrktValTotal"] = $this->formArray["propertyAdjMrktValTotal"] + toFloat($land->getAdjustedMarketValue()); $this->formArray["propertyTotal"] = $this->formArray["propertyTotal"] + toFloat($land->getAssessedValue()); } $l++; $this->pl++; } } $this->formArray["landTotal"] = $landTotal; }
function updateStatus($statusIDArray = "") { $rows = 0; $this->selectRecords(); foreach ($this->arrayList as $key => $value) { $value->status = "inactive"; $value->updateRecord(); } foreach ($statusIDArray as $key => $value) { $landActualUses = new LandActualUses(); $landActualUses->selectRecord($value); $landActualUses->status = "active"; $landActualUses->updateRecord(); $rows++; } return $rows; }
function displayLandList($landList) { if (count($landList)) { $land = $landList[0]; $this->tpl->set_var("land[propertyID]", $this->htmlProperty("propertyID", $land->getPropertyID())); $this->tpl->set_var("land[octTctNumber]", $this->htmlProperty("octTctNumber", $land->getOctTctNumber())); $this->tpl->set_var("land[surveyNumber]", $this->htmlProperty("surveyNumber", $land->getSurveyNumber())); $this->tpl->set_var("land[north]", $this->htmlProperty("north", $land->getNorth())); $this->tpl->set_var("land[south]", $this->htmlProperty("south", $land->getSouth())); $this->tpl->set_var("land[east]", $this->htmlProperty("east", $land->getEast())); $this->tpl->set_var("land[west]", $this->htmlProperty("west", $land->getWest())); $this->tpl->set_var("land[description]", $this->htmlProperty("description", $land->getKind())); foreach ($land as $lkey => $lvalue) { if (is_numeric($lvalue)) { switch ($lkey) { case "classification": $landClasses = new LandClasses(); $landClasses->selectRecord($lvalue); $this->tpl->set_var("land[classification]", $this->htmlProperty("classification", $landClasses->getDescription())); break; case "subClass": $landSubclasses = new LandSubclasses(); $landSubclasses->selectRecord($lvalue); $this->tpl->set_var("land[subClass]", $this->htmlProperty("subClass", $landSubclasses->getDescription())); break; case "actualUse": $landActualUses = new LandActualUses(); $landActualUses->selectRecord($lvalue); $this->tpl->set_var("land[actualUse]", $this->htmlProperty("actualUse", $landActualUses->getDescription())); break; } } } $this->tpl->set_var("land[area]", $this->htmlProperty("area", $land->getArea() . " " . $land->getUnit())); } }
function Main() { $this->formArray['currentDate'] = date("F d, Y"); $MunicipalityCityDetails = new SoapObject(NCCBIZ . "MunicipalityCityDetails.php", "urn:Object"); #test values //$this->formArray['municipalityCityID']=1; if (!($xmlStr = $MunicipalityCityDetails->getMunicipalityCityDetails($this->formArray['municipalityCityID']))) { #echo($xmlStr); //exit("xml failed for municipality"); header("Location: " . $this->sess->url("ViewSOA.php") . "&status=2"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error xmlDoc"; } else { $MunicipalityCity = new MunicipalityCity(); $MunicipalityCity->parseDomDocument($domDoc); $this->formArray['municipality'] = $MunicipalityCity->getDescription(); } } #test values //$this->formArray['ownerID']=5; #echo("ownerID=".$this->formArray['ownerID']."<br>"); // $this->displayOwnerList($this->formArray['ownerID']); #test values //$this->formArray["rptopID"]=15; if ($this->formArray['personID'] != "") { $person = new Person(); $person->selectRecord($this->formArray['personID']); $this->tpl->set_var(ownerName, $person->getFullName()); $this->tpl->set_var(ownerNo, $person->getTin()); $address = $person->addressArray[0]; $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince()); $db = new DB_RPTS(); $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['personID']; $db->query($sql); } else { $company = new Company(); $company->selectRecord($this->formArray['companyID']); $this->tpl->set_var(ownerName, $company->getCompanyName()); $this->tpl->set_var(ownerNo, $company->getCompanyID()); $address = $company->addressArray[0]; $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince()); $db = new DB_RPTS(); $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['companyID']; $db->query($sql); } /*$person = new Person(); $person->selectRecord($this->formArray['personID']); $this->tpl->set_var(ownerName,$person->getFullName()); $this->tpl->set_var(ownerNo,$person->getTin()); $address = $person->addressArray[0]; $this->tpl->set_var(ownerAddress,$address->getNumber() ." ".$address->getStreet()." ".$address->getBarangay()." ".$address->getDistrict()." ".$address->getMunicipalitycity()." ".$address->getProvince()); $db = new DB_RPTS(); $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=".$this->formArray['personID']; $db->query($sql);*/ $this->tpl->set_block("rptsTemplate", "ROW", "RowBlk"); for ($i = 0; $db->next_record(); $i++) { $rptopID = $db->f("rptopID"); $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($rptopID))) { // exit("xml failed for RPTOP"); header("Location: " . $this->sess->url("ViewSOA.php") . "&status=1"); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $rptop = new RPTOP(); $td = new TD(); $rptop->parseDomDocument($domDoc); foreach ($rptop as $key => $value) { $this->formArray['payableYear'] = $rptop->getTaxableYear(); $rptopID = $rptop->getRptopID(); if ($key == "tdArray") { $tdCtr = 0; if (count($value)) { foreach ($value as $tkey => $tvalue) { $td->selectRecord($tvalue->getTdID()); $assessedValue = number_format($td->getAssessedValue(), 2, ".", ""); $propertyType = $td->getPropertyType(); $TaxDeclarationNumber = $td->getTaxDeclarationNumber(); // $this->tpl->set_var(kind,$propertyType); // $this->tpl->set_var(currentTDNo,$TaxDeclarationNumber); /* $dues = new Dues(); $dues->create($td->getTdID(), "","","","2003"); $this->tpl->set_var(basic,$dues->getBasic()); $totBasic += $dues->getBasic(); $this->tpl->set_var(sef,$dues->getSEF()); $totSEF += $dues->getSEF(); $this->tpl->set_var(total,$dues->getSEF()+$dues->getBasic()); $totTaxDue += $dues->getSEF()+$dues->getBasic();*/ $afsID = $td->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); $od = new OD(); $od->selectRecord($afs->getOdID()); $addr = $od->getLocationAddress(); if (count($addr)) { $location = $addr->getFullAddress(); // $this->tpl->set_var(location,$addr->getFullAddress()); $munCityID = $addr->getMunicipalityCityID(); // if($munCityID == $this->formArray['municipalityCityID']) // $this->tpl->set_var(municipality,$addr->getMunicipalityCity()); } if (count($afs->landArray)) { foreach ($afs->landArray as $afsKey => $afsValue) { $actualUse = $afsValue->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); //$this->tpl->set_var("class",$landActualUses->getCode()); $Code = $landActualUses->getCode(); } } if (count($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $afsKey => $afsValue) { $actualUse = $afsValue->getActualUse(); $improvementsBuildingsActualUses = new improvementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); //$this->tpl->set_var("class",$improvementsBuildingsActualUses->getCode()); $Code = $improvementsBuildingsActualUses->getCode(); } } //echo $afs->get // echo $munCityID ."==". $this->formArray['municipalityCityID']."<br>"; if ($munCityID == $this->formArray['municipalityCityID']) { $this->tpl->set_var(location, $location); $this->tpl->set_var("class", $Code); $this->tpl->set_var(kind, $propertyType); $this->tpl->set_var(currentTDNo, $TaxDeclarationNumber); $this->tpl->set_var(municipality, $addr->getMunicipalityCity()); $dues = new Dues(); $dues->create($td->getTdID(), "", "", "", "2003"); $totTaxDue += $dues->getSEF() + $dues->getBasic(); $basic = number_format($dues->getBasic(), "2", ".", ""); $this->tpl->set_var(basic, $basic); $totBasic += $basic; $sef = number_format($dues->getSEF(), "2", ".", ""); $this->tpl->set_var(sef, $sef); $totSEF += number_format($sef, "2", ".", ""); $this->tpl->set_var(total, number_format($sef + $basic, "2", ".", "")); $this->tpl->set_var(marketValue, number_format($afs->getTotalMarketValue(), 2)); $totMarketValue += $afs->getTotalMarketValue(); $this->tpl->set_var(assessedValue, number_format($afs->getTotalAssessedValue(), 2)); $totAssessedValue += $afs->getTotalAssessedValue(); $pIndexNo = $afs->getPropertyIndexNumber(); if ($pIndexNo == "") { $pIndexNo = "No value specified"; } $this->tpl->set_var(pin, $pIndexNo); //echo $afs->getTotalMarketValue(); /* if(count($afs->landArray)){ foreach($afs->landArray as $afsKey => $afsValue){ $this->tpl->set_var(pin,$afsValue->getPropertyIndexNumber()); } } */ $this->tpl->parse("RowBlk", "ROW", true); } //else{ // $this->tpl->set_var("RowBlk",""); // } } #end foreach($value) } #end if coun value $this->tpl->set_var(totalMarketValue, number_format($totMarketValue, 2)); $this->tpl->set_var(totalAssessedValue, number_format($totAssessedValue, 2)); $this->tpl->set_var(totalBasic, number_format($totBasic, 2)); $this->tpl->set_var(totalSEF, number_format($totSEF, 2)); $this->tpl->set_var(totalTaxDue, number_format($totTaxDue, 2)); } } } // $this->tpl->parse("RowBlk","ROW",true); } } // $owner /* $RPTOPDetails = new SoapObject(NCCBIZ."RPTOPDetails.php", "urn:Object"); if (!$xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"])){ //exit("xml failed for RPTOP"); header("Location: ".$this->sess->url("ViewSOA.php")."&status=1"); } else{ //echo $xmlStr; if(!$domDoc = domxml_open_mem($xmlStr)) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $rptop = new RPTOP; $td = new TD(); $rptop->parseDomDocument($domDoc); $status_report = ""; foreach($rptop as $key => $value){ $this->formArray['payableYear'] = $rptop->getTaxableYear(); $rptopID = $rptop->getRptopID(); if($key=="tdArray"){ $tdCtr = 0; if (count($value)){ $this->tpl->set_block("rptsTemplate","ROW","RowBlk"); foreach($value as $tkey => $tvalue){ $td->selectRecord($tvalue->getTdID()); $assessedValue = number_format($td->getAssessedValue(),2,".",""); $propertyType = $td->getPropertyType(); $TaxDeclarationNumber = $td->getTaxDeclarationNumber(); //$tdCtr++; $this->tpl->set_var(kind,$propertyType); $this->tpl->set_var(currentTDNo,$TaxDeclarationNumber); /* $dues = new Dues(); $dues->create($td->getTdID(), "","","","2003"); $this->tpl->set_var(basic,$dues->getBasic()); $totBasic += $dues->getBasic(); $this->tpl->set_var(sef,$dues->getSEF()); $totSEF += $dues->getSEF(); $this->tpl->set_var(total,$dues->getSEF()+$dues->getBasic()); $totTaxDue += $dues->getSEF()+$dues->getBasic();*/ /* $afsID = $td->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); $od = new OD(); $od->selectRecord($afs->getOdID()); $addr = $od->getLocationAddress(); if(count($addr)){ $this->tpl->set_var(location,$addr->getFullAddress()); $munCityID = $addr->getMunicipalityCityID(); if($munCityID == $this->formArray['municipalityCityID']) $this->tpl->set_var(municipality,$addr->getMunicipalityCity()); } if(count($afs->landArray)){ foreach($afs->landArray as $afsKey => $afsValue){ $actualUse = $afsValue->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $this->tpl->set_var("class",$landActualUses->getCode()); } } if(count($afs->improvementsBuildingsArray)){ foreach($afs->improvementsBuildingsArray as $afsKey => $afsValue){ $actualUse = $afsValue->getActualUse(); $improvementsBuildingsActualUses = new improvementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $this->tpl->set_var("class",$improvementsBuildingsActualUses->getCode()); } } //echo $afs->get if($munCityID == $this->formArray['municipalityCityID']){ $dues = new Dues(); $dues->create($td->getTdID(), "","","","2003"); $this->tpl->set_var(basic,number_format($dues->getBasic(),"2",".","")); $totBasic += $dues->getBasic(); $this->tpl->set_var(sef,number_format($dues->getSEF(),"2",".","")); $totSEF += $dues->getSEF(); $this->tpl->set_var(total,number_format($dues->getSEF()+$dues->getBasic(),"2",".","")); $pIndexNo = $afs->getPropertyIndexNumber(); if($pIndexNo==""){ $pIndexNo = "No value specified"; } $this->tpl->set_var(pin,$pIndexNo); $this->tpl->set_var(marketValue,$afs->getTotalMarketValue()); $totMarketValue += $afs->getTotalMarketValue(); $this->tpl->set_var(assessedValue,$afs->getTotalAssessedValue()); $totAssessedValue += $afs->getTotalAssessedValue(); //echo $afs->getTotalMarketValue(); /* if(count($afs->landArray)){ foreach($afs->landArray as $afsKey => $afsValue){ $this->tpl->set_var(pin,$afsValue->getPropertyIndexNumber()); } } */ /* $this->tpl->parse("RowBlk","ROW",true); }else{ $this->tpl->set_var("RowBlk",""); } }#end foreach($value) }#end if coun value // $this->tpl->set_block("rptsTemplate","STAT",sBlk); // $this->tpl->set_var(status_report,$status_report); // $this->tpl->parse(sBlk,"STAT",true); $this->tpl->set_var(totalMarketValue,$totMarketValue); $this->tpl->set_var(totalAssessedValue,$totAssessedValue); $this->tpl->set_var(totalBasic,$totBasic); $this->tpl->set_var(totalSEF,$totSEF); $this->tpl->set_var(totalTaxDue,$totTaxDue); } } } }*/ $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { $this->formArray['currentDate'] = date("F d, Y"); $MunicipalityCityDetails = new SoapObject(NCCBIZ . "MunicipalityCityDetails.php", "urn:Object"); #test values //$this->formArray['municipalityCityID']=1; if (!($xmlStr = $MunicipalityCityDetails->getMunicipalityCityDetails($this->formArray['municipalityCityID']))) { #echo($xmlStr); exit("xml failed for municipality"); //header("Location: ".$this->sess->url("ViewSOA.php")."&status=2"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error xmlDoc"; } else { $MunicipalityCity = new MunicipalityCity(); $MunicipalityCity->parseDomDocument($domDoc); $this->formArray['municipality'] = $MunicipalityCity->getDescription(); } } if ($this->formArray['personID'] != "") { $person = new Person(); $person->selectRecord($this->formArray['personID']); $this->tpl->set_var(ownerName, $person->getFullName()); $this->tpl->set_var(ownerNo, $person->getTin()); $address = $person->addressArray[0]; if (is_object($address)) { $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince()); } else { $this->tpl->set_var(ownerAddress, ""); } $db = new DB_RPTS(); $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['personID']; $db->query($sql); } else { $company = new Company(); $company->selectRecord($this->formArray['companyID']); $this->tpl->set_var(ownerName, $company->getCompanyName()); $this->tpl->set_var(ownerNo, $company->getCompanyID()); $address = $company->addressArray[0]; $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince()); $db = new DB_RPTS(); $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['companyID']; $db->query($sql); } $ypos = 325; $this->tpl->set_block("rptsTemplate", "ROW", "RowBlk"); for ($i = 0; $db->next_record(); $i++) { $rptopID = $db->f("rptopID"); $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($rptopID))) { // exit("xml failed for RPTOP"); header("Location: " . $this->sess->url("ViewSOA.php") . "&status=1"); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $rptop = new RPTOP(); $td = new TD(); $rptop->parseDomDocument($domDoc); foreach ($rptop as $key => $value) { $this->formArray['payableYear'] = $rptop->getTaxableYear(); $rptopID = $rptop->getRptopID(); if ($key == "tdArray") { $tdCtr = 0; if (count($value)) { foreach ($value as $tkey => $tvalue) { $td->selectRecord($tvalue->getTdID()); $assessedValue = number_format($td->getAssessedValue(), 2, ".", ""); $propertyType = $td->getPropertyType(); $TaxDeclarationNumber = $td->getTaxDeclarationNumber(); $afsID = $td->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); $od = new OD(); $od->selectRecord($afs->getOdID()); $addr = $od->getLocationAddress(); if (count($addr)) { $location = strtoupper($addr->getNumber() . " " . substr($addr->getBarangay(), 0, 4) . " " . substr($addr->getMunicipalityCity(), 0, 3) . " " . substr($addr->getProvince(), 0, 3)); $munCityID = $addr->getMunicipalityCityID(); } if (count($afs->landArray)) { foreach ($afs->landArray as $afsKey => $afsValue) { $actualUse = $afsValue->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $Code = $landActualUses->getCode(); } } if (count($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $afsKey => $afsValue) { $actualUse = $afsValue->getActualUse(); $improvementsBuildingsActualUses = new improvementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $Code = $improvementsBuildingsActualUses->getCode(); } } if ($munCityID == $this->formArray['municipalityCityID']) { $this->tpl->set_var(location, $location); $this->tpl->set_var("class", $Code); $this->tpl->set_var(kind, strtoupper(substr($propertyType, 0, 4))); $this->tpl->set_var(currentTDNo, $TaxDeclarationNumber); $this->tpl->set_var(municipality, $addr->getMunicipalityCity()); //$dues = new Dues(); //$dues->create($td->getTdID(),"2003"); //$totTaxDue += $dues->getSEF()+$dues->getBasic(); $dues = new Dues($tvalue->getTdID(), $rptop->getTaxableYear(), $assessedValue); $paymentPeriod = $dues->getPaymentMode(); $totalTaxDue = $dues->getPaidBasic($paymentPeriod) + $dues->getPaidSEF($paymentPeriod) + $dues->getPaidIdle($paymentPeriod); if ($dues->getAmnesty()) { $dues->setPctPenalty(0.0); } else { $totalTaxDue += $dues->getPenalty($paymentPeriod); } if ($dues->getIsDiscount()) { $taxDue->setDiscount($totalTaxDue); $totalTaxDue -= $dues->getDiscount(); } $interest = $dues->getPctPenalty(); if ($interest > 0 && $paymentPeriod != "Annual") { $paymentPeriod = "Annual"; } $basic = number_format($dues->getPaidBasic(), "2", ".", ""); $this->tpl->set_var(basic, $basic); $totBasic += $basic; $sef = number_format($dues->getPaidSEF(), "2", ".", ""); $this->tpl->set_var(sef, $sef); $totSEF += number_format($sef, "2", ".", ""); $this->tpl->set_var(total, number_format($sef + $basic, "2", ".", "")); $this->tpl->set_var(marketValue, number_format($afs->getTotalMarketValue(), 2)); $totMarketValue += $afs->getTotalMarketValue(); $this->tpl->set_var(assessedValue, number_format($afs->getTotalAssessedValue(), 2)); $totAssessedValue += $afs->getTotalAssessedValue(); $pIndexNo = $afs->getPropertyIndexNumber(); if ($pIndexNo == "") { $pIndexNo = "No value specified"; } $ypos = $ypos - 10; $this->tpl->set_var(ypos, $ypos); $this->tpl->set_var(pin, $pIndexNo); $this->tpl->parse("RowBlk", "ROW", true); } } #end foreach($value) } #end if coun value $this->tpl->set_var(totalMarketValue, number_format($totMarketValue, 2)); $this->tpl->set_var(totalAssessedValue, number_format($totAssessedValue, 2)); $this->tpl->set_var(totalBasic, number_format($totBasic, 2)); $this->tpl->set_var(totalSEF, number_format($totSEF, 2)); $this->tpl->set_var(totalTaxDue, number_format($totalTaxDue, 2)); } } } } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("")); /* $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); */ $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $rptrpdf = new PDFWriter(); $rptrpdf->setOutputXML($this->tpl->get('templatePage'), "string"); $rptrpdf->writePDF("viewSOA.pdf"); }
function CreateNewRPU_AFS_TDGenRevBrgy($odID, $userID = "", $transactionCode = "", $copyOwner = true, $copyAFS = true, $copyTD = true) { $link = mysql_connect(MYSQLDBHOST, MYSQLDBUSER, MYSQLDBPWD); mysql_select_db(MYSQLDBNAME, $link); $sql = "select Person.firstName, Person.lastName from Person, Owner, OwnerPerson " . "where Person.personID = OwnerPerson.personID and OwnerPerson.ownerID = Owner.ownerID and Owner.odID = " . $odID; $rs = mysql_query($sql, $link); $prevowners = ''; while ($row = mysql_fetch_assoc($rs)) { $prevowners .= $row['firstName'] . ' ' . $row['lastName'] . ', '; } $prevowners = substr($prevowners, 0, strlen($prevowners) - 2); $sql = "select AFS.totalAssessedValue from AFS where AFS.odID = " . $odID; $rs = mysql_query($sql, $link); $prevassdval = 0; if ($row = mysql_fetch_assoc($rs)) { $prevassdval = $row['totalAssessedValue']; } $od = new OD(); $od->selectRecord($odID); unset($od->oldODArray); $od->setTransactionCode($transactionCode); $od->setOldODArray($odID); // create new OD $ownerID = $od->owner->getOwnerID(); $newOdID = $od->insertRecord(); $newOwnerID = $od->newOwnerID; $od->setDomDocument(); // associate existing Owner to new OD $owner = new Owner(); $owner->selectRecord($ownerID); if (count($owner->personArray)) { foreach ($owner->personArray as $personKey => $personValue) { if ($copyOwner) { $owner->insertOwnerPerson($newOwnerID, $personValue->getPersonID()); } } } if (count($owner->companyArray)) { foreach ($owner->companyArray as $companyKey => $companyValue) { if ($copyOwner) { $owner->insertOwnerCompany($newOwnerID, $companyValue->getCompanyID()); } } } // create new AFS and associate existing properties to new AFS $afs = new AFS(); $afsID = $afs->checkAfsID($odID); $afs->selectRecord($afsID); $afs->setOdID($newOdID); $afs->effectivity = date("Y") + 1; // new arpNumber is blank //$afs->arpNumber = ""; // retain PIN except for Consolidation and Subdivision //if($transactionCode=="SD" || $transactionCode=="CS"){ $afs->propertyIndexNumber = ""; //} $afs->setDomDocument(); $newAFSID = $afs->insertRecord(); $afs->arpNumber = '(' . $newAFSID . ')'; $afs->updateRecord(); if ($copyAFS) { if ($copyTD) { $td = new TD(); $td->taxDeclarationNumber = $afs->arpNumber; $td->afsID = $newAFSID; $td->previousOwner = $prevowners; $td->previousAssessedValue = $prevassdval; $td->setDomDocument(); $newTDID = $td->insertRecord(); } if (count($afs->landArray)) { foreach ($afs->landArray as $landKey => $landValue) { $landValue->setPropertyID(""); $landValue->setAfsID($newAFSID); $landValue->propertyAdministrator->setPersonID(""); // set unitValue from SubClass $landSubclasses = new LandSubclasses(); $landSubclasses->selectRecord(intVal($landValue->subClass)); $landValue->setUnitValue($landSubclasses->getValue()); // set assessmentLevel from ActualUse $landActualUses = new LandActualUses(); $landActualUses->selectRecord(intVal($landValue->actualUse)); $landValue->setAssessmentLevel($landActualUses->getValue()); $landValue->calculateMarketValue(); $landValue->calculateValueAdjustment(); $landValue->calculateAdjustedMarketValue(); $landValue->calculateAssessedValue(); $landValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $landValue->appraisedByDate = ""; $landValue->recommendingApprovalDate = ""; $landValue->approvedByDate = ""; $newP = $landValue->insertRecord(); } } if (count($afs->plantsTreesArray)) { foreach ($afs->plantsTreesArray as $plantsTreesKey => $plantsTreesValue) { $plantsTreesValue->setPropertyID(""); $plantsTreesValue->setAfsID($newAFSID); $plantsTreesValue->propertyAdministrator->setPersonID(""); // set unitPrice from ProductClass $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord(intVal($plantsTreesValue->productClass)); $plantsTreesValue->setUnitPrice($plantsTreesClasses->getValue()); // set assessmentLevel from ActualUse $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord(intVal($plantsTreesValue->actualUse)); $plantsTreesValue->setAssessmentLevel($plantsTreesActualUses->getValue()); $plantsTreesValue->calculateMarketValue(); $plantsTreesValue->calculateValueAdjustment(); $plantsTreesValue->calculateAdjustedMarketValue(); $plantsTreesValue->calculateAssessedValue(); $plantsTreesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $plantsTreesValue->appraisedByDate = ""; $plantsTreesValue->recommendingApprovalDate = ""; $plantsTreesValue->approvedByDate = ""; $newP = $plantsTreesValue->insertRecord(); } } if (count($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $improvementsBuildingsKey => $improvementsBuildingsValue) { $improvementsBuildingsValue->setPropertyID(""); $improvementsBuildingsValue->setAfsID($newAFSID); $improvementsBuildingsValue->propertyAdministrator->setPersonID(""); // set unitValue from BuildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); $improvementsBuildingsClasses->selectRecord(intVal($improvementsBuildingsValue->buildingClassification)); $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue()); // set assessmentLevel from ActualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord(intVal($improvementsBuildingsValue->actualUse)); $improvementsBuildingsValue->setAssessmentLevel($improvementsBuildingsActualUses->getValue()); $improvementsBuildingsValue->calculateMarketValue(); $improvementsBuildingsValue->calculateAccumulatedDepreciation(); $improvementsBuildingsValue->calculatedDepreciatedMarketValue(); $improvementsBuildingsValue->calculateAdjustedMarketValue(); $improvementsBuildingsValue->calculateAssessedValue(); $improvementsBuildingsValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $improvementsBuildingsValue->appraisedByDate = ""; $improvementsBuildingsValue->recommendingApprovalDate = ""; $improvementsBuildingsValue->approvedByDate = ""; $newP = $improvementsBuildingsValue->insertRecord(); } } if (count($afs->machineriesArray)) { foreach ($afs->machineriesArray as $machineriesKey => $machineriesValue) { $machineriesValue->setPropertyID(""); $machineriesValue->setAfsID($newAFSID); $machineriesValue->propertyAdministrator->setPersonID(""); // set assessmentLevel from ActualUse $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord(intVal($machineriesValue->actualUse)); $machineriesValue->setAssessmentLevel($machineriesActualUses->getValue()); $machineriesValue->calculateMarketValue(); $machineriesValue->calculateDepreciatedMarketValue(); $machineriesValue->calculateAdjustedMarketValue(); $machineriesValue->calculateAssessedValue(); $machineriesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $machineriesValue->appraisedByDate = ""; $machineriesValue->recommendingApprovalDate = ""; $machineriesValue->approvedByDate = ""; $newP = $machineriesValue->insertRecord(); } } } $sql = "update AFS set archive = 'true' where AFS.odID = " . $odID; mysql_query($sql, $link); $sql = "update OD set archive = 'true' where OD.odID = " . $odID; mysql_query($sql, $link); $sql = "update TD set archive = 'true' where TD.afsID = " . $afsID; mysql_query($sql, $link); mysql_close($link); return $newOdID; echo "OD - " . $odID . "->" . $newOdID . "<br>"; echo "Owner - " . $ownerID . "->" . $newOwnerID . "<br>"; echo "AFS - " . $afsID . "->" . $newAFSID . "<br>" . $newP; }
function displayLandList($landList) { if (count($landList)) { // NCC Modification checked and implemented by K2 : November 21, 2005 // details: // added lines 145 to 151 with lines 146 and 147 commented out $items = ''; //$offset = 470; //$fp = fopen("/home/site/log/td.log","w+"); $mv = 0; $al = 0; $av = 0; foreach ($landList as $lkey => $land) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $landClassesDescription = $landClasses->getDescription(); $landClassesCode = $landClasses->getCode(); } else { $landClassesDescription = $land->getClassification(); $landClassesCode = $land->getClassification(); } // just in case subClass and actualUse needs to be drawn from land // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $landSubclassesDescription = $landSubclasses->getDescription(); $landSubclassesCode = $landSubclasses->getCode(); } else { $landSubclassesDescription = $land->getSubClass(); $landSubclassesCode = $land->getSubClass(); } // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $landActualUsesDescription = $landActualUses->getDescription(); $landActualUsesCode = $landActualUses->getCode(); $landActualUsesReportCode = $landActualUses->getReportCode(); } else { $landActualUsesDescription = $land->getActualUse(); $landActualUsesCode = $land->getActualUse(); $landActualUsesReportCode = $landActualUses->getReportCode(); } // NCC Modification checked and implemented by K2 : November 21, 2005 // details: // - changed `if($this->formArray["p"] <= 3)` to `if(...<=10)` in line 200 // - opted not to comment out if() line as done in NCC version // - added lines 201 to 228 // - added lines 255 to 275 commenting out lines 273 and 274 if ($this->formArray["p"] <= 10) { $lvl = number_format($land->getAssessmentLevel(), 2); if ($al != $lvl) { if ($av > 0) { $this->formArray["ypos"] -= 13; $offset = $this->formArray["ypos"]; $items .= "<textitem xpos=\"25\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"left\">" . "Land" . "</textitem>"; $items .= "<textitem xpos=\"115\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"9\" align=\"left\">" . $ld . "</textitem>"; $items .= "<textitem xpos=\"337\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($mv, 2) . "</textitem>"; // danny : changed $al to $lvl and added '%' suffix in xml $items .= "<textitem xpos=\"430\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . $lvl . "%</textitem>"; $items .= "<textitem xpos=\"558\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($av, 2) . "</textitem>"; $offsetx = $offset - 3; $items .= "<lineitem x1=\"25\" y1=\"" . $offsetx . "\" x2=\"105\" y2=\"" . $offsetx . "\">blurb</lineitem>"; $items .= "<lineitem x1=\"115\" y1=\"" . $offsetx . "\" x2=\"228\" y2=\"" . $offsetx . "\">blurb</lineitem>"; $items .= "<lineitem x1=\"244\" y1=\"" . $offsetx . "\" x2=\"337\" y2=\"" . $offsetx . "\">blurb</lineitem>"; $items .= "<lineitem x1=\"358\" y1=\"" . $offsetx . "\" x2=\"445\" y2=\"" . $offsetx . "\">blurb</lineitem>"; $items .= "<lineitem x1=\"457\" y1=\"" . $offsetx . "\" x2=\"558\" y2=\"" . $offsetx . "\">blurb</lineitem>"; } $av = 0; $mv = 0; // danny = changed `$al = $lvl` back to 0 .. don't understand why $al's need to be compared. $al = 0; } $ld = $landClassesDescription; $mv += $land->getAdjustedMarketValue(); $av += un_number_format($land->getAssessedValue()); $p = $this->formArray["p"]; $this->formArray["kind" . $p] = $land->getKind(); $this->formArray["classification" . $p] = $landClassesDescription; $this->formArray["landActualUse" . $p] = $land->getActualUse(); $this->formArray["marketValue" . $p] = formatCurrency($land->getMarketValue()); $this->formArray["assessmentLevel" . $p] = $land->getAssessmentLevel(); $this->formArray["assessedValue" . $p] = formatCurrency($land->getAssessedValue()); } else { if ($this->formArray["p"] > 10) { $this->formArray["othersCount"]++; $this->formArray["othersMV"] += toFloat($land->getMarketValue()); $this->formArray["othersAV"] += toFloat($land->getAssessedValue()); $this->formArray["kindOthers"] = "Plus " . $this->formArray["othersCount"] . " other(s): P" . formatCurrency($this->formArray["othersMV"]) . " (MV), P" . formatCurrency($this->formArray["othersAV"]) . " (AV)"; /* if($this->formArray["kindOthers"]!="") $this->formArray["kindOthers"] .= "; "; if($this->formArray["kindOthers"]==""){ $this->formArray["kindOthers"] = "Others: "; } $this->formArray["kindOthers"] .= $land->getKind(); $this->formArray["kindOthers"] .= " MV=P".formatCurrency($land->getMarketValue()); $this->formArray["kindOthers"] .= " AV=P".formatCurrency($land->getAssessedValue()); */ } } $this->formArray["totalMarketValue"] += toFloat($land->getMarketValue()); $this->formArray["totalAssessedValue"] += toFloat($land->getAssessedValue()); $this->formArray["p"]++; } if ($av > 0) { $this->formArray["ypos"] -= 13; $offset = $this->formArray["ypos"]; $items .= "<textitem xpos=\"25\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"left\">" . "Land" . "</textitem>"; $items .= "<textitem xpos=\"115\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"9\" align=\"left\">" . $ld . "</textitem>"; $items .= "<textitem xpos=\"337\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($mv, 2) . "</textitem>"; $items .= "<textitem xpos=\"430\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . $lvl . "%</textitem>"; $items .= "<textitem xpos=\"558\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($av, 2) . "</textitem>"; $offsetx = $offset - 3; $items .= "<lineitem x1=\"25\" y1=\"" . $offsetx . "\" x2=\"105\" y2=\"" . $offsetx . "\">blurb</lineitem>"; $items .= "<lineitem x1=\"115\" y1=\"" . $offsetx . "\" x2=\"228\" y2=\"" . $offsetx . "\">blurb</lineitem>"; $items .= "<lineitem x1=\"244\" y1=\"" . $offsetx . "\" x2=\"337\" y2=\"" . $offsetx . "\">blurb</lineitem>"; $items .= "<lineitem x1=\"358\" y1=\"" . $offsetx . "\" x2=\"445\" y2=\"" . $offsetx . "\">blurb</lineitem>"; $items .= "<lineitem x1=\"457\" y1=\"" . $offsetx . "\" x2=\"558\" y2=\"" . $offsetx . "\">blurb</lineitem>"; } //fwrite($fp,$items."\r\n"); //fclose($fp); $this->formArray["landitems"] = $items; } }
function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList) { $totalMarketValue = 0; $totalAssessedValue = 0; $i = 0; if (count($landList)) { foreach ($landList as $key => $land) { if ($i < 4) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $landClassesDescription = $landClasses->getDescription(); $landClassesCode = $landClasses->getCode(); } else { $landClassesDescription = $land->getClassification(); $landClassesCode = $land->getClassification(); } // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $landSubclassesDescription = $landSubclasses->getDescription(); $landSubclassesCode = $landSubclasses->getCode(); } else { $landSubclassesDescription = $land->getSubClass(); $landSubclassesCode = $land->getSubClass(); } // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $landActualUsesDescription = $landActualUses->getDescription(); $landActualUsesCode = $landActualUses->getCode(); } else { $landActualUsesDescription = $land->getActualUse(); $landActualUsesCode = $land->getActualUse(); } $this->formArray["propertyKind" . ($i + 1)] = "Land"; $this->formArray["propertyActualUse" . ($i + 1)] = $landActualUsesDescription; $this->formArray["propertyMarketValue" . ($i + 1)] = $land->getMarketValue(); $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $land->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . ($i + 1)] = $land->getAssessedValue(); $totalMarketValue += toFloat($land->getMarketValue()); $totalAssessedValue += toFloat($land->getAssessedValue()); $i++; } } } if (count($plantsTreesList)) { foreach ($plantsTreesList as $key => $plantsTrees) { if ($i < 4) { // productClass $plantsTreesClasses = new PlantsTreesClasses(); if (is_numeric($plantsTrees->getProductClass())) { $plantsTreesClasses->selectRecord($plantsTrees->getProductClass()); $plantsTreesClassesDescription = $plantsTreesClasses->getDescription(); $plantsTreesClassesCode = $plantsTreesClasses->getCode(); } else { $plantsTreesClassesDescription = $plantsTrees->getProductClass(); $plantsTreesClassesCode = $plantsTrees->getProductClass(); } // actualUse $plantsTreesActualUses = new PlantsTreesActualUses(); if (is_numeric($plantsTrees->getActualUse())) { $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse()); $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription(); $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode(); } else { $plantsTreesActualUsesDescription = $plantsTrees->getActualUse(); $plantsTreesActualUsesCode = $plantsTrees->getActualUse(); } $this->formArray["propertyKind" . ($i + 1)] = "PlantsTrees"; $this->formArray["propertyActualUse" . ($i + 1)] = $plantsTreesActualUsesDescription; $this->formArray["propertyMarketValue" . ($i + 1)] = $plantsTrees->getMarketValue(); $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $plantsTrees->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . ($i + 1)] = $plantsTrees->getAssessedValue(); $totalMarketValue += toFloat($plantsTrees->getMarketValue()); $totalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $i++; } } } if (count($improvementsBuildingsList)) { foreach ($improvementsBuildingsList as $key => $improvementsBuildings) { if ($i < 4) { // buildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); if (is_numeric($improvementsBuildings->getBuildingClassification())) { $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification()); $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription(); $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode(); } else { $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification(); $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification(); } // actualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); if (is_numeric($improvementsBuildings->getActualUse())) { $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse()); $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription(); $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode(); } else { $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse(); } $this->formArray["propertyKind" . ($i + 1)] = "ImprovementsBuildings"; $this->formArray["propertyActualUse" . ($i + 1)] = $improvementsBuildingsActualUsesDescription; $this->formArray["propertyMarketValue" . ($i + 1)] = $improvementsBuildings->getMarketValue(); $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $improvementsBuildings->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . ($i + 1)] = $improvementsBuildings->getAssessedValue(); $totalMarketValue += toFloat($improvementsBuildings->getMarketValue()); $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $i++; } } } if (count($machineriesList)) { foreach ($machineriesList as $key => $machineries) { if ($i < 4) { // kind $machineriesClasses = new MachineriesClasses(); if (is_numeric($machineries->getKind())) { $machineriesClasses->selectRecord($machineries->getKind()); $machineriesClassesDescription = $machineriesClasses->getDescription(); $machineriesClassesCode = $machineriesClasses->getCode(); } else { $machineriesClassesDescription = $machineries->getKind(); $machineriesClassesCode = $machineries->getActualUse(); } // actualUse $machineriesActualUses = new MachineriesActualUses(); if (is_numeric($machineries->getActualUse())) { $machineriesActualUses->selectRecord($machineries->getActualUse()); $machineriesActualUsesDescription = $machineriesActualUses->getDescription(); $machineriesActualUsesCode = $machineriesActualUses->getCode(); } else { $machineriesActualUsesDescription = $machineries->getActualUse(); $machineriesActualUsesCode = $machineries->getActualUse(); } $this->formArray["propertyKind" . ($i + 1)] = "Machineries"; $this->formArray["propertyActualUse" . ($i + 1)] = $machineriesActualUsesDescription; $this->formArray["propertyMarketValue" . ($i + 1)] = $machineries->getMarketValue(); $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $machineries->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . ($i + 1)] = $machineries->getAssessedValue(); $totalMarketValue += toFloat($machineries->getMarketValue()); $totalAssessedValue += toFloat($machineries->getAssessedValue()); $i++; } } } $this->formArray["totalMarketValue"] = $totalMarketValue; $this->formArray["totalAssessedValue"] = $totalAssessedValue; $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue); }
function Main() { $this->displayLGUName(); $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { //echo($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error xmlDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domdoc } else { $this->displayOwnerList($domDoc); } } } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->formArray["municipalAssessor"] = $cityAssessor->getName(); } else { $cityAssessor = $value; $this->formArray["municipalAssessor"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->formArray["municipalTreasurer"] = $cityTreasurer->getName(); } else { $cityTreasurer = $value; $this->formArray["municipalTreasurer"] = $cityTreasurer; } break; case "tdArray": $tdCtr = 1; $tdContinuousCtr = 1; if (count($value)) { $this->tdPagingArray["tdCount"] = count($value); $this->tdPagingArray["tdPageRecordsCounter"] = 1; $this->tdPagingArray["tdTotalPages"] = ceil($this->tdPagingArray["tdCount"] / $this->tdPagingArray["tdPageBy"]); $this->tdPagingArray["tdPageNumber"] = 1; $this->tpl->set_block("rptsTemplate", "Page", "PageBlock"); $this->tpl->set_block("Page", "FirstPageText", "FirstPageTextBlock"); $this->tpl->set_block("Page", "ContinuedFromPreviousPageText", "ContinuedFromPreviousPageTextBlock"); $this->tpl->set_block("Page", "ContinuedNextPageText", "ContinuedNextPageTextBlock"); $this->tpl->set_block("Page", "Totals", "TotalsBlock"); foreach ($value as $tkey => $tvalue) { $this->formArray["arpNumber" . $tdCtr] = $tvalue->getTaxDeclarationNumber(); // word wrap arpNumber if (strlen($this->formArray["arpNumber" . $tdCtr]) > 13) { $this->formArray["arpNumber" . $tdCtr . "a"] = substr($this->formArray["arpNumber" . $tdCtr], 0, 12); $this->formArray["arpNumber" . $tdCtr . "b"] = substr($this->formArray["arpNumber" . $tdCtr], 12); $this->formArray["arpNumber" . $tdCtr] = ""; } $this->formArray["afsID"] = $tvalue->getAfsID(); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["odID"] = $afs->getOdID(); $od = new OD(); $od->selectRecord($this->formArray["odID"]); $locationNumber = $od->locationAddress->getNumber(); $locationStreet = $od->locationAddress->getStreet(); $locationBarangay = $od->locationAddress->getBarangay(); $locationDistrict = $od->locationAddress->getDistrict(); $locationMunicipalityCity = $od->locationAddress->getMunicipalityCity(); $locationProvince = $od->locationAddress->getProvince(); $this->formArray["location" . $tdCtr] = $locationNumber . " " . $locationStreet . " " . $locationBarangay; // word wrap location if (strlen($this->formArray["location" . $tdCtr]) > 26) { $this->formArray["location" . $tdCtr . "a"] = $locationNumber . " " . $locationStreet; $this->formArray["location" . $tdCtr . "b"] = $locationBarangay; $this->formArray["location" . $tdCtr] = ""; } $this->formArray["province"] = $locationProvince; $this->formArray["municipalityCity"] = strtoupper($locationMunicipalityCity); $this->formArray["area" . $tdCtr] = $od->getLandArea(); $this->formArray["lotNo" . $tdCtr] = $od->getLotNumber(); $this->formArray["pin" . $tdCtr] = $afs->getPropertyIndexNumber(); // word wrap pin if (strlen($this->formArray["pin" . $tdCtr]) > 13) { $this->formArray["pin" . $tdCtr . "a"] = substr($this->formArray["pin" . $tdCtr], 0, 12); $this->formArray["pin" . $tdCtr . "b"] = substr($this->formArray["pin" . $tdCtr], 12); $this->formArray["pin" . $tdCtr] = ""; } $landList = $afs->getLandArray(); $plantsTreesList = $afs->getPlantsTreesArray(); $improvementsBuildingsList = $afs->getImprovementsBuildingsArray(); $machineriesList = $afs->getMachineriesArray(); $kind = ""; $actualUse = ""; if (count($landList)) { $kind = "Land"; $land = $landList[0]; $actualUse = $land->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $actualUse = $landActualUses->getDescription(); $actualUseReportCode = $landActualUses->getReportCode(); } else { if (count($plantsTreesList)) { $kind = "Land"; $plantsTrees = $plantsTreesList[0]; $actualUse = $plantsTrees->getActualUse(); $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord($actualUse); $actualUse = $plantsTreesActualUses->getDescription(); $actualUseReportCode = $plantsTreesActualUses->getReportCode(); } else { if (count($improvementsBuildingsList)) { $kind = "Improvements/Buildings"; $improvementsBuildings = $improvementsBuildingsList[0]; $actualUse = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $actualUse = $improvementsBuildingsActualUses->getDescription(); $actualUseReportCode = $improvementsBuildingsActualUses->getReportCode(); } else { if (count($machineriesList)) { $kind = "Machineries"; $machineries = $machineriesList[0]; $actualUse = $machineries->getActualUse(); $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord($actualUse); $actualUse = $machineriesActualUses->getDescription(); $actualUseReportCode = $machineriesActualUses->getReportCode(); } } } } eval(REPORT_CODE_LIST); foreach ($reportCodeList as $key => $reportCode) { if ($reportCode["code"] == $actualUseReportCode) { $reportCodeDescription = $reportCode["description"]; break; } } $this->formArray["classification" . $tdCtr] = $reportCodeDescription; $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["marketValue" . $tdCtr] += $afs->getTotalMarketValue(); $this->formArray["assessedValue" . $tdCtr] += $afs->getTotalAssessedValue(); $this->formArray["totalMarketValue"] += $this->formArray["marketValue"]; $this->formArray["totalAssessedValue"] += $this->formArray["assessedValue"]; // grab Due from tdID $this->formArray["totalTaxDue"] = 0.0; $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDueFromTdID($tvalue->getTdID()))) { $this->formArray["basic" . $tdCtr] = ""; $this->formArray["sef" . $tdCtr] = ""; $this->formArray["totalTax" . $tdCtr] = ""; $this->formArray["totalBasic"] += 0; $this->formArray["totalSef"] += 0; $this->formArray["totalTaxes"] += 0; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->formArray["basic" . $tdCtr] = ""; $this->formArray["sef" . $tdCtr] = ""; $this->formArray["totalTax" . $tdCtr] = ""; $this->formArray["totalBasic"] += 0; $this->formArray["totalSef"] += 0; $this->formArray["totalTaxes"] += 0; } else { $due = new Due(); $due->parseDomDocument($domDoc); $this->formArray["basic" . $tdCtr] = $due->getBasicTax(); $this->formArray["sef" . $tdCtr] = $due->getSEFTax(); $this->formArray["totalTax" . $tdCtr] = $due->getTaxDue(); //WRONG CODE --------------------------------------------------> //$this->formArray["totalBasic"] += $due->getBasicTax(); //$this->formArray["totalSef"] += $due->getSEFTax(); //$this->formArray["totalTaxes"] += $due->getTaxDue(); //-------------------------------------------------------------> } } } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; //NEW CODE - Argao----Added on 03152008--------------------------------------------> //Computes Grand Totals on Basic, SEF and Total-----By CHT $this->formArray["totalBasic"] = $this->formArray["totalAssessedValue"] * 0.01; $this->formArray["totalSef"] = $this->formArray["totalAssessedValue"] * 0.01; $this->formArray["totalTaxes"] = $this->formArray["totalBasic"] + $this->formArray["totalSef"]; //---------------------------------------------------------------------------------> if ($this->tdPagingArray["tdPageRecordsCounter"] == $this->tdPagingArray["tdPageBy"]) { // if 6 $this->setForm(); $this->resetTDPageRecords(); $this->tpl->set_var("tdPageNumber", $this->tdPagingArray["tdPageNumber"]); $this->tpl->set_var("tdTotalPages", $this->tdPagingArray["tdTotalPages"]); if ($this->tdPagingArray["tdPageNumber"] > 1) { $this->tpl->set_var("FirstPageTextBlock", ""); $this->tpl->parse("ContinuedFromPreviousPageTextBlock", "ContinuedFromPreviousPageText", true); } else { if ($this->tdPagingArray["tdPageNumber"] == 1) { $this->tpl->parse("FirstPageTextBlock", "FirstPageText", true); $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", ""); } } if ($this->tdPagingArray["tdTotalPages"] > 1 && $this->tdPagingArray["tdPageNumber"] < $this->tdPagingArray["tdTotalPages"]) { $this->tpl->parse("ContinuedNextPageTextBlock", "ContinuedNextPageText", true); } else { if ($this->tdPagingArray["tdTotalPages"] == 1) { $this->tpl->set_var("ContinuedNextPageTextBlock", ""); } } if ($this->tdPagingArray["tdTotalPages"] == $this->tdPagingArray["tdPageNumber"]) { $this->tpl->parse("TotalsBlock", "Totals", true); } else { $this->tpl->set_var("TotalsBlock", ""); } $this->tpl->parse("PageBlock", "Page", true); $this->tpl->set_var("FirstPageTextBlock", ""); $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", ""); $this->tpl->set_var("ContinuedNextPageTextBlock", ""); $this->tpl->set_var("TotalsBlock", ""); $this->tdPagingArray["tdPageNumber"]++; $this->formArray["pageNumber"]++; // reset counter $this->tdPagingArray["tdPageRecordsCounter"] = 0; $tdCtr = 0; } else { if ($tdContinuousCtr == $this->tdPagingArray["tdCount"]) { // if this is the last record, and count is still not 6 $this->setForm(); $this->resetTDPageRecords(); $this->tpl->set_var("tdPageNumber", $this->tdPagingArray["tdPageNumber"]); $this->tpl->set_var("tdTotalPages", $this->tdPagingArray["tdTotalPages"]); if ($this->tdPagingArray["tdPageNumber"] > 1) { $this->tpl->set_var("FirstPageTextBlock", ""); $this->tpl->parse("ContinuedFromPreviousPageTextBlock", "ContinuedFromPreviousPageText", true); } else { if ($this->tdPagingArray["tdPageNumber"] == 1) { $this->tpl->parse("FirstPageTextBlock", "FirstPageText", true); $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", ""); } } if ($this->tdPagingArray["tdTotalPages"] > 1 && $this->tdPagingArray["tdPageNumber"] < $this->tdPagingArray["tdTotalPages"]) { $this->tpl->parse("ContinuedNextPageTextBlock", "ContinuedNextPageText", true); } else { if ($this->tdPagingArray["tdTotalPages"] == 1) { $this->tpl->set_var("ContinuedNextPageTextBlock", ""); } } if ($this->tdPagingArray["tdTotalPages"] == $this->tdPagingArray["tdPageNumber"]) { $this->tpl->parse("TotalsBlock", "Totals", true); } else { $this->tpl->set_var("TotalsBlock", ""); } $this->tpl->parse("PageBlock", "Page", true); $this->tpl->set_var("FirstPageTextBlock", ""); $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", ""); $this->tpl->set_var("ContinuedNextPageTextBlock", ""); $this->tpl->set_var("TotalsBlock", ""); $this->tdPagingArray["tdPageNumber"]++; $this->formArray["pageNumber"]++; } } $tdCtr++; $tdContinuousCtr++; $this->tdPagingArray["tdPageRecordsCounter"]++; } } break; default: $this->formArray[$key] = $value; } } unset($rptop); } } $this->tpl->set_block("rptsTemplate", "Totals", "TotalsBlock"); $this->tpl->set_var("TotalsBlock", ""); //$this->setForm(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); // print_r($this->tpl->get("templatePage")); // exit; $testpdf = new PDFWriter(); $testpdf->setOutputXML($this->tpl->get("templatePage"), "test"); if (isset($this->formArray["print"])) { $testpdf->writePDF($name); //,$this->formArray["print"]); } else { $testpdf->writePDF($name); } //header("location: ".$testpdf->pdfPath); }
function displayPlantsTreesList($plantsTreesList) { $this->tpl->set_block("rptsTemplate", "PlantsTreesDBEmpty", "PlantsTreesDBEmptyBlock"); $this->tpl->set_var("PlantsTreesDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "defaultPlantsTreesList", "defaultPlantsTreesListBlock"); $this->tpl->set_block("rptsTemplate", "togglePlantsTreesList", "togglePlantsTreesListBlock"); if (count($plantsTreesList)) { //$this->tpl->set_block("rptsTemplate", "hidePlantsTreesList", "hidePlantsTreesListBlock"); $this->tpl->set_block("rptsTemplate", "PlantsTreesList", "PlantsTreesListBlock"); $i = 0; $totalMarketValue = 0; $totalAssessedValue = 0; foreach ($plantsTreesList as $key => $value) { $totalMarketValue += tofloat($value->getAdjustedMarketValue()); $totalAssessedValue += tofloat($value->getAssessedValue()); $this->displayDetails($value); foreach ($value as $lkey => $lvalue) { if (is_numeric($lvalue)) { switch ($lkey) { case "productClass": $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord($lvalue); $this->tpl->set_var("productClass", $plantsTreesClasses->getDescription()); break; case "actualUse": $plantsTreesActualUses = new LandActualUses(); $plantsTreesActualUses->selectRecord($lvalue); $this->tpl->set_var("actualUse", $plantsTreesActualUses->getDescription()); break; } } } $this->tpl->set_var("ctr", $i); $this->tpl->parse("defaultPlantsTreesListBlock", "defaultPlantsTreesList", true); $this->tpl->parse("togglePlantsTreesListBlock", "togglePlantsTreesList", true); //$this->tpl->parse("hidePlantsTreesListBlock", "hidePlantsTreesList", true); $this->tpl->parse("PlantsTreesListBlock", "PlantsTreesList", true); $i++; } $this->formArray["totalMarketValue"] += $totalMarketValue; $this->formArray["totalAssessedValue"] += $totalAssessedValue; $this->formArray["plantTotalMarketValue"] = $totalMarketValue; $this->formArray["plantTotalAssessedValue"] = $totalAssessedValue; $this->tpl->set_var("plantsTreesCtr", $i); } else { $this->tpl->set_var("defaultPlantsTreesListBlock", ""); $this->tpl->set_var("togglePlantsTreesListBlock", ""); } }
function CreateNewRPU_AFS_TD($odID, $userID = "", $transactionCode = "", $copyOwner = true, $copyAFS = true, $copyTD = false) { $od = new OD(); $od->selectRecord($odID); unset($od->oldODArray); $od->setTransactionCode($transactionCode); $od->setOldODArray($odID); // create new OD $ownerID = $od->owner->getOwnerID(); $newOdID = $od->insertRecord(); $newOwnerID = $od->newOwnerID; $od->setDomDocument(); // associate existing Owner to new OD $owner = new Owner(); $owner->selectRecord($ownerID); if (count($owner->personArray)) { foreach ($owner->personArray as $personKey => $personValue) { if ($copyOwner) { $owner->insertOwnerPerson($newOwnerID, $personValue->getPersonID()); } } } if (count($owner->companyArray)) { foreach ($owner->companyArray as $companyKey => $companyValue) { if ($copyOwner) { $owner->insertOwnerCompany($newOwnerID, $companyValue->getCompanyID()); } } } // create new AFS and associate existing properties to new AFS $afs = new AFS(); $afsID = $afs->checkAfsID($odID); $afs->selectRecord($afsID); $afs->setOdID($newOdID); $afs->effectivity = date("Y") + 1; // new arpNumber is blank $afs->arpNumber = ""; // retain PIN except for Consolidation and Subdivision if ($transactionCode == "SD" || $transactionCode == "CS") { $afs->propertyIndexNumber = ""; } $afs->setDomDocument(); if ($copyAFS) { $newAfsID = $afs->insertRecord(); if (count($afs->landArray)) { foreach ($afs->landArray as $landKey => $landValue) { $landValue->setPropertyID(""); $landValue->setAfsID($newAfsID); if (is_object($landValue->propertyAdministrator)) { $landValue->propertyAdministrator->setPersonID(""); } else { $landValue->propertyAdministrator = new Person(); $landValue->propertyAdministrator->setPersonID(""); } // set unitValue from SubClass $landSubclasses = new LandSubclasses(); $landSubclasses->selectRecord(intVal($landValue->subClass)); $landValue->setUnitValue($landSubclasses->getValue()); // set assessmentLevel from ActualUse $landActualUses = new LandActualUses(); $landActualUses->selectRecord(intVal($landValue->actualUse)); $landValue->setAssessmentLevel($landActualUses->getValue()); $landValue->calculateMarketValue(); $landValue->calculateValueAdjustment(); $landValue->calculateAdjustedMarketValue(); $landValue->calculateAssessedValue(); $newP = $landValue->insertRecord(); } } if (count($afs->plantsTreesArray)) { foreach ($afs->plantsTreesArray as $plantsTreesKey => $plantsTreesValue) { $plantsTreesValue->setPropertyID(""); $plantsTreesValue->setAfsID($newAfsID); if (is_object($plantsTreesValue->propertyAdministrator)) { $plantsTreesValue->propertyAdministrator->setPersonID(""); } else { $plantsTreesValue->propertyAdministrator = new Person(); $plantsTreesValue->propertyAdministrator->setPersonID(""); } // set unitPrice from ProductClass $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord(intVal($plantsTreesValue->productClass)); $plantsTreesValue->setUnitPrice($plantsTreesClasses->getValue()); // set assessmentLevel from ActualUse $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord(intVal($plantsTreesValue->actualUse)); $plantsTreesValue->setAssessmentLevel($plantsTreesActualUses->getValue()); $plantsTreesValue->calculateMarketValue(); $plantsTreesValue->calculateValueAdjustment(); $plantsTreesValue->calculateAdjustedMarketValue(); $plantsTreesValue->calculateAssessedValue(); $newP = $plantsTreesValue->insertRecord(); } } if (count($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $improvementsBuildingsKey => $improvementsBuildingsValue) { $improvementsBuildingsValue->setPropertyID(""); $improvementsBuildingsValue->setAfsID($newAfsID); if (is_object($improvementsBuildingsValue->propertyAdministrator)) { $improvementsBuildingsValue->propertyAdministrator->setPersonID(""); } else { $improvementsBuildingsValue->propertyAdministrator = new Person(); $improvementsBuildingsValue->propertyAdministrator->setPersonID(""); } // set unitValue from BuildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); $improvementsBuildingsClasses->selectRecord(intVal($improvementsBuildingsValue->buildingClassification)); $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue()); // this if() line added : November 05 2004: // if master table unit value is not 0, update this unit value with the master table unit value // otherwise, retain this unit value as it is the old one. if ($improvementsBuildingsClasses->getValue() != 0) { $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue()); } // set assessmentLevel from ActualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord(intVal($improvementsBuildingsValue->actualUse)); $improvementsBuildingsValue->setAssessmentLevel($improvementsBuildingsActualUses->getValue()); $improvementsBuildingsValue->calculateMarketValue(); $improvementsBuildingsValue->calculateAccumulatedDepreciation(); $improvementsBuildingsValue->calculatedDepreciatedMarketValue(); $improvementsBuildingsValue->calculateAdjustedMarketValue(); $improvementsBuildingsValue->calculateAssessedValue(); $newP = $improvementsBuildingsValue->insertRecord(); } } if (count($afs->machineriesArray)) { foreach ($afs->machineriesArray as $machineriesKey => $machineriesValue) { $machineriesValue->setPropertyID(""); $machineriesValue->setAfsID($newAfsID); if (is_object($machineriesValue->propertyAdministrator)) { $machineriesValue->propertyAdministrator->setPersonID(""); } else { $machineriesValue->propertyAdministrator = new Person(); $machineriesValue->propertyAdministrator->setPersonID(""); } // set assessmentLevel from ActualUse $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord(intVal($machineriesValue->actualUse)); $machineriesValue->setAssessmentLevel($machineriesActualUses->getValue()); $machineriesValue->calculateMarketValue(); $machineriesValue->calculateDepreciatedMarketValue(); $machineriesValue->calculateAdjustedMarketValue(); $machineriesValue->calculateAssessedValue(); $newP = $machineriesValue->insertRecord(); } } } return $newOdID; }
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; }
function getLandActualUsesText($landActualUsesID) { $LandActualUsesDetails = new SoapObject(NCCBIZ . "LandActualUsesDetails.php", "urn:Object"); if (!($xmlStr = $LandActualUsesDetails->getLandActualUsesDetails($landActualUsesID))) { return $landActualUsesID; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { return $landActualUsesID; } else { $landActualUses = new LandActualUses(); $landActualUses->parseDomDocument($domDoc); return $landActualUses->getDescription(); } } }
function Main() { switch ($this->formArray["formAction"]) { case "edit": $this->tpl->set_var("MessageBlock", ""); $LandActualUsesDetails = new SoapObject(NCCBIZ . "LandActualUsesDetails.php", "urn:Object"); if (!($xmlStr = $LandActualUsesDetails->getLandActualUsesDetails($this->formArray["landActualUsesID"]))) { $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 { $landActualUses = new LandActualUses(); $landActualUses->parseDomDocument($domDoc); $this->formArray["landActualUsesID"] = $landActualUses->getLandActualUsesID(); $this->formArray["code"] = $landActualUses->getCode(); $this->formArray["reportCode"] = $landActualUses->getReportCode(); $this->formArray["description"] = $landActualUses->getDescription(); $this->formArray["value"] = $landActualUses->getValue(); $this->formArray["status"] = $landActualUses->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", ""); } $LandActualUsesEncode = new SoapObject(NCCBIZ . "LandActualUsesEncode.php", "urn:Object"); if ($this->formArray["landActualUsesID"] != "") { $LandActualUsesDetails = new SoapObject(NCCBIZ . "LandActualUsesDetails.php", "urn:Object"); if (!($xmlStr = $LandActualUsesDetails->getLandActualUsesDetails($this->formArray["landActualUsesID"]))) { 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 { $landActualUses = new LandActualUses(); $landActualUses->parseDomDocument($domDoc); $landActualUses->setLandActualUsesID($this->formArray["landActualUsesID"]); $landActualUses->setCode($this->formArray["code"]); $landActualUses->setReportCode($this->formArray["reportCode"]); $landActualUses->setDescription($this->formArray["description"]); $landActualUses->setValue($this->formArray["value"]); $landActualUses->setStatus($this->formArray["status"]); $landActualUses->setDomDocument(); $doc = $landActualUses->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $LandActualUsesEncode->updateLandActualUses($xmlStr))) { exit("error update"); } } } } else { $landActualUses = new LandActualUses(); $landActualUses->setLandActualUsesID($this->formArray["landActualUsesID"]); $landActualUses->setCode($this->formArray["code"]); $landActualUses->setReportCode($this->formArray["reportCode"]); $landActualUses->setDescription($this->formArray["description"]); $landActualUses->setValue($this->formArray["value"]); $landActualUses->setStatus($this->formArray["status"]); $landActualUses->setDomDocument(); $doc = $landActualUses->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $LandActualUsesEncode->saveLandActualUses($xmlStr))) { exit("error save"); } } $this->formArray["landActualUsesID"] = $ret; header("location: LandActualUsesClose.php" . $this->sess->url("") . $this->sess->add_query(array("landActualUsesID" => $ret))); //header("location: LandActualUsesEncode.php"); exit; break; case "cancel": header("location: LandActualUsesClose.php" . $this->sess->url("") . $this->sess->add_query(array("landActualUsesID" => $ret))); //header("location: LandActualUsesList.php"); exit; break; default: $this->tpl->set_block("rptsTemplate", "LandActualUsesID", "LandActualUsesIDBlock"); $this->tpl->set_var("LandActualUsesIDBlock", ""); $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"); }
function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList) { $totalMarketValue = 0; $totalAssessedValue = 0; $nLandTotalAssessedValue = 0; $nLandTotalAdjustedMarketValue = 0; $nPlantsTotalAssessedValue = 0; $nPlantsTotalAdjustedMarketValue = 0; $nBuildingsTotalAssessedValue = 0; $nBuildingsTotalAdjustedMarketValue = 0; $nMachineriesTotalAssessedValue = 0; $nMachineriesTotalAdjustedMarketValue = 0; $swornLandTotal = 0; $swornImprovementTotal = 0; $swornOverallTotal = 0; $i = 1; $flag = 0; $counter = 0; if (count($landList)) { foreach ($landList as $key => $land) { if ($i < 5) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $landClassesDescription = $landClasses->getDescription(); $landClassesCode = $landClasses->getCode(); } else { $landClassesDescription = $land->getClassification(); $landClassesCode = $land->getClassification(); } // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $landSubclassesDescription = $landSubclasses->getDescription(); $landSubclassesCode = $landSubclasses->getCode(); } else { $landSubclassesDescription = $land->getSubClass(); $landSubclassesCode = $land->getSubClass(); } // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $landActualUsesDescription = $landActualUses->getDescription(); $landActualUsesCode = $landActualUses->getCode(); } else { $landActualUsesDescription = $land->getActualUse(); $landActualUsesCode = $land->getActualUse(); } // add pre new hehe if ($landActualUsesCode == "RES" || $landActualUsesCode == "COM" || $landActualUsesCode == "IND" || $landActualUsesCode == "MI" || $landActualUsesCode == "TI" || $landActualUsesCode == "SP") { $tempname = $landActualUsesDescription; $counter += 1; } // end of add hehe $totalMarketValue += toFloat($land->getAdjustedMarketValue()); $totalAssessedValue += toFloat($land->getAssessedValue()); $nLandTotalAssessedValue += toFloat($land->getAssessedValue()); $nLandTotalAdjustedMarketValue += toFloat($land->getAdjustedMarketValue()); $swornLandTotal += toFloat($land->getAdjustedMarketValue()); $swornOverallTotal += toFloat($land->getAdjustedMarketValue()); // $this->formArray["propertyKind".($i)] = "Land"; // $this->formArray["propertyActualUse".($i)] = $landActualUsesDescription; // $this->formArray["propertyMarketValue".($i)] = $land->getAdjustedMarketValue(); // $this->formArray["propertyAssessmentLevel".($i)] = $land->getAssessmentLevel(); // $this->formArray["propertyAssessedValue".($i)] = $land->getAssessedValue(); // $totalMarketValue+=toFloat($land->getAdjustedMarketValue()); // $totalAssessedValue+=toFloat($land->getAssessedValue()); //$i++; } } //} // display the summary of lands value if ($counter > 0) { $this->formArray["propertyActualUse" . $i] = $tempname; } else { $this->formArray["propertyActualUse" . $i] = "Agricultural"; } $this->formArray["propertyKind" . $i] = "Land"; // $this->formArray["propertyActualUse".($i)] = "Agricultural"; $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $land->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue; $i++; // end of summary of lands } if (count($plantsTreesList)) { foreach ($plantsTreesList as $key => $plantsTrees) { if ($i < 5) { // productClass $plantsTreesClasses = new PlantsTreesClasses(); if (is_numeric($plantsTrees->getProductClass())) { $plantsTreesClasses->selectRecord($plantsTrees->getProductClass()); $plantsTreesClassesDescription = $plantsTreesClasses->getDescription(); $plantsTreesClassesCode = $plantsTreesClasses->getCode(); } else { $plantsTreesClassesDescription = $plantsTrees->getProductClass(); $plantsTreesClassesCode = $plantsTrees->getProductClass(); } // actualUse $plantsTreesActualUses = new PlantsTreesActualUses(); if (is_numeric($plantsTrees->getActualUse())) { $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse()); $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription(); $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode(); } else { $plantsTreesActualUsesDescription = $plantsTrees->getActualUse(); $plantsTreesActualUsesCode = $plantsTrees->getActualUse(); } //$this->formArray["propertyKind".($i+1)] = "PlantsTrees"; //$this->formArray["propertyActualUse".($i+1)] =$plantsTreesActualUsesDescription; //$this->formArray["propertyMarketValue".($i+1)] =$plantsTrees->getAdjustedMarketValue(); //$this->formArray["propertyAssessmentLevel".($i+1)] = $plantsTrees->getAssessmentLevel(); //$this->formArray["propertyAssessedValue".($i+1)] = $plantsTrees->getAssessedValue(); $totalMarketValue += toFloat($plantsTrees->getAdjustedMarketValue()); $totalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $nPlantsTotalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $nPlantsTotalAdjustedMarketValue += toFloat($plantsTrees->getAdjustedMarketValue()); $swornLandTotal += toFloat($plantsTrees->getAdjustedMarketValue()); $swornOverallTotal += toFloat($plantsTrees->getAdjustedMarketValue()); //$i++; } } $this->formArray["propertyKind" . $i] = "PlantTrees"; $this->formArray["propertyActualUse" . $i] = $plantsTreesActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nPlantsTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $plantsTrees->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nPlantsTotalAssessedValue; $i++; // additional new line for total of LAND AND PLANT TREES // $nSwornLandTotal =$nPlantsTotalAdjustedMarketValue + $nLandTotalAdjustedMarketValue; // $this->formArray["swornLandTotal"] =$nSwornLandTotal; //number_format($nSwornLandTotal,2); // END } if (count($improvementsBuildingsList)) { foreach ($improvementsBuildingsList as $key => $improvementsBuildings) { if ($i < 5) { // buildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); if (is_numeric($improvementsBuildings->getBuildingClassification())) { $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification()); $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription(); $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode(); } else { $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification(); $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification(); } // actualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); if (is_numeric($improvementsBuildings->getActualUse())) { $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse()); $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription(); $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode(); } else { $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse(); } //$this->formArray["propertyKind".($i+1)] = "ImprovementsBuildings"; //$this->formArray["propertyActualUse".($i+1)] = $improvementsBuildingsActualUsesDescription; //$this->formArray["propertyMarketValue".($i+1)] = $improvementsBuildings->getAdjustedMarketValue(); //$this->formArray["propertyAssessmentLevel".($i+1)] = $improvementsBuildings->getAssessmentLevel(); //$this->formArray["propertyAssessedValue".($i+1)] = $improvementsBuildings->getAssessedValue(); $totalMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue()); $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $nBuildingsTotalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $nBuildingsTotalAdjustedMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue()); $swornImprovementTotal += toFloat($improvementsBuildings->getAdjustedMarketValue()); $swornOverallTotal += toFloat($improvementsBuildings->getAdjustedMarketValue()); // $i++; } } $this->formArray["propertyKind" . $i] = "ImprovementsBuildings"; $this->formArray["propertyActualUse" . $i] = $improvementsBuildingsActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nBuildingsTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $improvementsBuildings->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nBuildingsTotalAssessedValue; $i++; } if (count($machineriesList)) { foreach ($machineriesList as $key => $machineries) { if ($i < 5) { // kind $machineriesClasses = new MachineriesClasses(); if (is_numeric($machineries->getKind())) { $machineriesClasses->selectRecord($machineries->getKind()); $machineriesClassesDescription = $machineriesClasses->getDescription(); $machineriesClassesCode = $machineriesClasses->getCode(); } else { $machineriesClassesDescription = $machineries->getKind(); $machineriesClassesCode = $machineries->getActualUse(); } // actualUse $machineriesActualUses = new MachineriesActualUses(); if (is_numeric($machineries->getActualUse())) { $machineriesActualUses->selectRecord($machineries->getActualUse()); $machineriesActualUsesDescription = $machineriesActualUses->getDescription(); $machineriesActualUsesCode = $machineriesActualUses->getCode(); } else { $machineriesActualUsesDescription = $machineries->getActualUse(); $machineriesActualUsesCode = $machineries->getActualUse(); } //$this->formArray["propertyKind".($i+1)] = "Machineries"; //$this->formArray["propertyActualUse".($i+1)] = $machineriesActualUsesDescription; //$this->formArray["propertyMarketValue".($i+1)] = $machineries->getAdjustedMarketValue(); //$this->formArray["propertyAssessmentLevel".($i+1)] = $machineries->getAssessmentLevel(); //$this->formArray["propertyAssessedValue".($i+1)] = $machineries->getAssessedValue(); $totalMarketValue += toFloat($machineries->getAdjustedMarketValue()); $totalAssessedValue += toFloat($machineries->getAssessedValue()); $nMachineriesTotalAssessedValue += toFloat($machineries->getAssessedValue()); $nMachineriesTotalAdjustedMarketValue += toFloat($machineries->getAdjustedMarketValue()); $swornImprovementTotal += toFloat($machineries->getAdjustedMarketValue()); $swornOverallTotal += toFloat($machineries->getAdjustedMarketValue()); // $i++; } } $this->formArray["propertyKind" . $i] = "Machineries"; $this->formArray["propertyActualUse" . $i] = $machineriesActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nMachineriesTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $machineries->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nMachineriesTotalAssessedValue; $i++; } // add pre hehe for sworn statement total and machineries $this->formArray["swornLandTotal"] = $swornLandTotal; $this->formArray["swornImprovementTotal"] = $swornImprovementTotal; $this->formArray["swornOverallTotal"] = $swornOverallTotal; // $nSwornImprovementTotal =$nMachineriesTotalAdjustedMarketValue + $nBuildingsTotalAdjustedMarketValue; // $this->formArray["swornImprovementTotal"] =$nSwornImprovementTotal; $grandTotalArea = $findingsTotalArea + $bfindingsFloorArea; // $this->formArray["swornOverallTotal"] =$nSwornOverallTotal; // end $this->formArray["totalMarketValue"] = $totalMarketValue; $this->formArray["totalAssessedValue"] = $totalAssessedValue; $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue); }
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 displayLandList($landList) { $this->tpl->set_block("rptsTemplate", "LandDBEmpty", "LandDBEmptyBlock"); $this->tpl->set_var("LandDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "defaultLandList", "defaultLandListBlock"); $this->tpl->set_block("rptsTemplate", "toggleLandList", "toggleLandListBlock"); //echo $this->formArray["totalMarketValue"]; if (count($landList)) { //$this->tpl->set_block("rptsTemplate", "hideLandList", "hideLandListBlock"); $this->tpl->set_block("rptsTemplate", "LandList", "LandListBlock"); $i = 0; $totalMarketValue = 0; $totalAssessedValue = 0; foreach ($landList as $key => $value) { $totalMarketValue += tofloat($value->getAdjustedMarketValue()); $totalAssessedValue += tofloat($value->getAssessedValue()); $this->displayDetails($value); foreach ($value as $lkey => $lvalue) { if (is_numeric($lvalue)) { switch ($lkey) { case "classification": $landClasses = new LandClasses(); $landClasses->selectRecord($lvalue); $this->tpl->set_var("classification", $landClasses->getDescription()); break; case "subClass": $landSubclasses = new LandSubclasses(); $landSubclasses->selectRecord($lvalue); $this->tpl->set_var("subClass", $landSubclasses->getDescription()); break; case "actualUse": $landActualUses = new LandActualUses(); $landActualUses->selectRecord($lvalue); $this->tpl->set_var("actualUse", $landActualUses->getDescription()); break; } } } $this->tpl->set_var("ctr", $i); $this->tpl->parse("defaultLandListBlock", "defaultLandList", true); $this->tpl->parse("toggleLandListBlock", "toggleLandList", true); //$this->tpl->parse("hideLandListBlock", "hideLandList", true); $this->setLandListBlockPerms(); $this->tpl->parse("LandListBlock", "LandList", true); $i++; } $this->formArray["totalMarketValue"] += $totalMarketValue; $this->formArray["totalAssessedValue"] += $totalAssessedValue; $this->formArray["landTotalMarketValue"] = $totalMarketValue; $this->formArray["landTotalAssessedValue"] = $totalAssessedValue; $this->tpl->set_var("landCtr", $i); } else { $this->tpl->set_var("defaultLandListBlock", ""); $this->tpl->set_var("toggleLandListBlock", ""); } }
function displayLandList($landList) { $landTotal = 0; $finalUnit = ''; if (count($landList)) { $l = 0; $landitems = ''; $adjitems = ''; $totalarea = 0; $adjcount = $this->formArray["adjcount"]; $adjfact = ''; $percadj = 0; $markval = 0; $valuadj = 0; $adjmark = 0; $summcount = $this->formArray["summcount"]; $summuse = ''; $summadj = 0; $summlvl = 0; $summasv = 0; $mixedUnits = 0; foreach ($landList as $key => $land) { if ($this->pl == 0) { //$this->formArray["taxDeclarationNumber"] = $land->getTaxDeclarationNumber(); //$this->formArray["propertyIndexNumber"] = $land->getPropertyIndexNumber(); $this->formArray["Numberlot"] = $land->propertyAdministrator->getemail(); $this->formArray["octTctNumber"] = $land->getOctTctNumber(); $this->formArray["Numbersurvey"] = $land->getSurveyNumber(); $this->formArray["north"] = $land->getNorth(); $this->formArray["east"] = $land->getEast(); $this->formArray["south"] = $land->getSouth(); $this->formArray["west"] = $land->getWest(); //$this->formArray["taxability"] = $land->getTaxability(); //$this->formArray["effectivity"] = $land->getEffectivity(); //$this->formArray["memoranda"] = $td->getMemoranda(); if (is_a($land->propertyAdministrator, Person)) { if ($land->propertyAdministrator->getLastName() != "") { $this->formArray["administrator"] = $land->propertyAdministrator->getFullName(); } if (is_a($land->propertyAdministrator->addressArray[0], "address")) { $address1 = $land->propertyAdministrator->addressArray[0]->getNumber(); if ($address1 != "") { $address1 .= " "; } $address1 .= $land->propertyAdministrator->addressArray[0]->getStreet(); if ($address1 != "") { $address1 .= ", "; } $address1 .= $land->propertyAdministrator->addressArray[0]->getBarangay(); $address2 = $land->propertyAdministrator->addressArray[0]->getDistrict(); if ($address2 != "") { $address2 .= ", "; } $address2 .= $land->propertyAdministrator->addressArray[0]->getMunicipalityCity(); if ($address2 != "") { $address2 .= ", "; } $address2 .= $land->propertyAdministrator->addressArray[0]->getProvince(); $this->formArray["adminAddress1"] = $address1; $this->formArray["adminAddress2"] = $address2; } $this->formArray["adminTelno"] = $land->propertyAdministrator->getTelephone(); } // recommendingApproval if (is_numeric($land->recommendingApproval)) { $recommendingApproval = new Person(); $recommendingApproval->selectRecord($land->recommendingApproval); $this->formArray["recommendingApproval"] = strtoupper($recommendingApproval->getFullName()); $this->recommendingApproval = $recommendingApproval->getFullName(); } else { $recommendingApproval = $land->recommendingApproval; $this->formArray["recommendingApproval"] = strtoupper($recommendingApproval); $this->recommendingApproval = $recommendingApproval; } $this->formArray["dateRecommendingApproval"] = $land->getRecommendingApprovalDate(); // approvedBy if (is_numeric($land->approvedBy)) { $approvedBy = new Person(); $approvedBy->selectRecord($land->approvedBy); $this->formArray["approvedBy"] = strtoupper($approvedBy->getFullName()); $this->approvedBy = $approvedBy->getFullName(); } else { $approvedBy = $land->approvedBy; $this->formArray["approvedBy"] = strtoupper($approvedBy); $this->approvedBy = $approvedBy; } $this->formArray["dateApprovedBy"] = $land->getApprovedByDate(); // appraisedBy (assessedBy) if (is_numeric($land->appraisedBy)) { $appraisedBy = new Person(); $appraisedBy->selectRecord($land->appraisedBy); $this->formArray["assessedBy"] = $appraisedBy->getFullName(); $this->appraisedBy = $appraisedBy->getFullName(); } else { $appraisedBy = $land->appraisedBy; $this->formArray["assessedBy"] = $appraisedBy; $this->appraisedBy = $appraisedBy; } $this->formArray["dateAssessedBy"] = $land->getAppraisedByDate(); } // Land Appraisal $this->formArray["landstart"] -= 19; $offset = $this->formArray["landstart"]; // 5 Change to 11 if ($l < 11) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $this->formArray["classification" . ($l + 1)] = $landClasses->getDescription(); } else { $this->formArray["classification" . ($l + 1)] = $land->getClassification(); } $landitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $this->formArray["classification" . ($l + 1)] . '</textitem>' . "\r\n"; // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $this->formArray["subClass" . ($l + 1)] = $landSubclasses->getDescription(); } else { $this->formArray["subClass" . ($l + 1)] = $land->getSubClass(); } $landitems .= '<textitem xpos="125" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $this->formArray["subClass" . ($l + 1)] . '</textitem>' . "\r\n"; if (strlen($finalUnit) == 0) { if ($land->getUnit() != "square meters") { $finalUnit = "has."; } else { $finalUnit = "sqm."; } } else { if ($finalUnit != $land->getUnit()) { $mixedUnits = 1; $finalUnit = "has."; } else { $finalUnit = "sqm."; } } if ($land->getUnit() != "square meters") { $runArea = number_format((double) $land->getArea(), 4) . " has."; $totalarea += (double) $land->getArea() * 10000; } else { $runArea = number_format((double) $land->getArea(), 2) . " sqm."; $totalarea += (double) $land->getArea(); } // $this->formArray["area".($l+1)] = number_format($land->getArea(),4)." ".($land->getUnit()=="square meters")?"sqm.":"has."; $landitems .= '<textitem xpos="297" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $runArea . '</textitem>' . "\r\n"; // actualUse==========with round off========= $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $this->formArray["landActualUse" . ($l + 1)] = $landActualUses->getDescription(); } else { $this->formArray["landActualUse" . ($l + 1)] = $land->getActualUse(); } $landitems .= '<textitem xpos="305" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $this->formArray["landActualUse" . ($l + 1)] . '</textitem>' . "\r\n"; $this->formArray["unitValue" . ($l + 1)] = $land->getUnitValue(); $uvx = str_replace(',', '', $this->formArray["unitValue" . ($l + 1)]); $landitems .= '<textitem xpos="437" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($uvx, 2) . '</textitem>' . "\r\n"; $this->formArray["landMrktVal" . ($l + 1)] = number_format($land->getMarketValue(), 2); $landitems .= '<textitem xpos="540" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["landMrktVal" . ($l + 1)] . '</textitem>' . "\r\n"; $landTotal = $landTotal + toFloat($land->getMarketValue()); $landitems .= '<lineitem x1="50" y1="' . ($offset - 8) . '" x2="550" y2="' . ($offset - 8) . '">blurb</lineitem>'; } if ($this->pl < 11) { if ($percadj != (double) $land->getPercentAdjustment()) { if ($markval > 0) { $adjcount++; $this->formArray["adjstart"] -= 14; $offset = $this->formArray["adjstart"]; $adjitems .= '<textitem xpos="147" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($markval, 2) . ' (L)' . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $adjfact . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($percadj) . '%</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($valuadj, 2) . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($adjmark, 2) . '</textitem>' . "\r\n"; $adjitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>'; } $percadj = (double) $land->getPercentAdjustment(); $adjfact = $land->getAdjustmentFactor(); $markval = 0; $valuadj = 0; $adjmark = 0; } $markval += (double) $land->getMarketValue(); $valuadj += (double) $land->getValueAdjustment(); $adjmark += (double) $land->getAdjustedMarketValue(); $this->formArray["valAdjFacMrktVal" . ($this->pl + 1)] = $land->getMarketValue(); $this->formArray["adjFacTxt" . ($this->pl + 1)] = $land->getAdjustmentFactor(); $this->formArray["adjFacInt" . ($this->pl + 1)] = "L"; $this->formArray["adjustment" . ($this->pl + 1)] = $land->getPercentAdjustment(); $this->formArray["valueAdjustment" . ($this->pl + 1)] = $land->getValueAdjustment(); $this->formArray["valAdjFacAdjMrktVal" . ($this->pl + 1)] = $land->getAdjustedMarketValue(); $this->formArray["valAdjFacTotal"] = $this->formArray["valAdjFacTotal"] + toFloat($land->getAdjustedMarketValue()); } // 8 to 11 if ($this->pl < 11) { $this->formArray["kind" . ($this->pl + 1)] = "Land"; //if(is_numeric($land->getActualUse())){ $landActualUses->selectRecord($land->getActualUse()); $this->formArray["propertyActualUse" . ($this->pl + 1)] = $landActualUses->getDescription(); //} //else{ // $this->formArray["propertyActualUse".($this->pl+1)] = $land->getActualUse(); //} $this->formArray["propertyAdjMrktVal" . ($this->pl + 1)] = $land->getAdjustedMarketValue(); $this->formArray["level" . ($this->pl + 1)] = $land->getAssessmentLevel(); $this->formArray["assessedValue" . ($this->pl + 1)] = $land->getAssessedValue(); $this->formArray["propertyAdjMrktValTotal"] = $this->formArray["propertyAdjMrktValTotal"] + toFloat($land->getAdjustedMarketValue()); $this->formArray["propertyTotal"] = $this->formArray["propertyTotal"] + toFloat($land->getAssessedValue()); /* $summkind = ''; $summuse = ''; $summadj = 0; $summlvl = 0; $summasv = 0; */ //if ($summuse <> $landActualUses->getDescription()) { //Printing of Property Assessment Summ $thislvl = (double) $land->getAssessmentLevel(); $thisuse = $landActualUses->getDescription(); if ($summlvl != $thislvl || $summuse != $thisuse) { if ($summasv > 0) { $summcount++; $this->formArray["summstart"] -= 14; $offset = $this->formArray["summstart"]; $summitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . 'LAND' . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . htmlentities($summuse) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summadj, 2) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summlvl, 2) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summasv, 2) . '</textitem>' . "\r\n"; $summitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>'; } $summuse = $thisuse; $summlvl = $thislvl; $summadj = 0; $summasv = 0; } $summadj += (double) $land->getAdjustedMarketValue(); $summasv += toFloat($land->getAssessedValue()); //(double)$land->getAssessedValue(); } $l++; $this->pl++; } //This is for the Value Adjustment Factor if ($markval > 0) { $adjcount++; $this->formArray["adjstart"] -= 14; $offset = $this->formArray["adjstart"]; $adjitems .= '<textitem xpos="147" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($markval, 2) . ' (L)' . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $adjfact . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($percadj) . '%</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($valuadj, 2) . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($adjmark, 2) . '</textitem>' . "\r\n"; $adjitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>'; } //EN - This is for the Property Assesment Summary if ($summasv > 0) { //EN 20090930 change summasv to markval (reversed 20091001) $summcount++; $this->formArray["summstart"] -= 14; $offset = $this->formArray["summstart"]; $summitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . 'LAND' . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . htmlentities($summuse) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summadj, 2) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summlvl, 2) . '</textitem>' . "\r\n"; // Inserted 08222008 $summasv = round($summadj * ($summlvl / 100), -1); //EN - round to nearest ten peso 2009-09-30 //EN - change $adjmark to $summadj 2009-09-30 $summitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summasv, 2) . '</textitem>' . "\r\n"; $summitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>'; } // 5 change to 11 for ($ll = $l; $ll < 11; $ll++) { $this->formArray["landstart"] -= 19; $offset = $this->formArray["landstart"]; $landitems .= '<lineitem x1="50" y1="' . ($offset - 8) . '" x2="550" y2="' . ($offset - 8) . '">blurb</lineitem>'; } $this->formArray["adjcount"] += $adjcount; $this->formArray["adjitems"] .= $adjitems; $this->formArray["summcount"] += $summcount; $this->formArray["summitems"] .= $summitems; $this->formArray["landitems"] = $landitems; //if ($mixedUnits) { if ($finalUnit == 'has.') { $this->formArray["totalarea"] = number_format($totalarea / 10000, 4) . ' has.'; } else { $this->formArray["totalarea"] = number_format($totalarea, 2) . ' sqm.'; } // $this->formArray["totalarea"] = number_format($totalarea,4); } $this->formArray["landTotal"] = $landTotal; }
function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList) { $totalMarketValue = 0; $totalAssessedValue = 0; $totalArea = 0; // RC 20091008 $nLandTotalAssessedValue = 0; $nLandTotalAdjustedMarketValue = 0; $nLandTotalArea = 0; $nPlantsTotalAssessedValue = 0; $nPlantsTotalAdjustedMarketValue = 0; $nBuildingsTotalAssessedValue = 0; $nBuildingsTotalAdjustedMarketValue = 0; $nBuildingsTotalArea = 0; // RC 20091008 $nMachineriesTotalAssessedValue = 0; $nMachineriesTotalAdjustedMarketValue = 0; $swornLandTotal = 0; $swornImprovementTotal = 0; $swornOverallTotal = 0; $i = 1; $flag = 0; $counter = 0; $summlvl = 0; $summuse = ""; $summcla = ""; //RC 20091001 for summary total by Use & level if (count($landList)) { $this->formArray["kindIsLand"] = "X"; // RC 20091006 foreach ($landList as $key => $land) { if ($i < 5) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $landClassesDescription = $landClasses->getDescription(); $landClassesCode = $landClasses->getCode(); } else { $landClassesDescription = $land->getClassification(); $landClassesCode = $land->getClassification(); } // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $landSubclassesDescription = $landSubclasses->getDescription(); $landSubclassesCode = $landSubclasses->getCode(); } else { $landSubclassesDescription = $land->getSubClass(); $landSubclassesCode = $land->getSubClass(); } // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $landActualUsesDescription = $landActualUses->getDescription(); $landActualUsesCode = $landActualUses->getCode(); } else { $landActualUsesDescription = $land->getActualUse(); $landActualUsesCode = $land->getActualUse(); } // add pre new if ($landActualUsesCode == "RE" || $landActualUsesCode == "COM" || $landActualUsesCode == "IND" || $landActualUsesCode == "MI" || $landActualUsesCode == "TI" || $landActualUsesCode == "SP") { $tempname = $landActualUsesDescription; $counter += 1; } // end of2 add $totalMarketValue += toFloat($land->getAdjustedMarketValue()); $totalAssessedValue += toFloat($land->getAssessedValue()); $swornLandTotal += toFloat($land->getAdjustedMarketValue()); $swornOverallTotal += toFloat($land->getAdjustedMarketValue()); // display the summary of lands value if ($counter > 0) { $this->formArray["propertyActualUse" . $i] = $tempname; } else { $this->formArray["propertyActualUse" . $i] = "Agricultural"; } //RC 20091001 To properly report summary by Actual Use and Level $thislvl = $land->getAssessmentLevel(); $thisuse = $landActualUsesDescription; if ($summuse == '') { //RC first record $summlvl = $thislvl; $summuse = $thisuse; $summcla = $landClassesDescription; $nLandTotalArea = 0; $nLandTotalAssessedValue = 0; $nLandTotalAdjustedMarketValue = 0; } if ($summlvl != $thislvl || $summuse != $thisuse) { //RC print if new assessment level or new actual use $this->formArray["propertyKind" . $i] = "Land"; $this->formArray["classification" . $i] = $summcla; $this->formArray["propertyActualUse" . $i] = $summuse; $this->formArray["findingsTotalArea" . $i] = $nLandTotalArea; $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%"; $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue; $i++; $nLandTotalAssessedValue = 0; $nLandTotalAdjustedMarketValue = 0; $nLandTotalArea = 0; $summlvl = $thislvl; $summuse = $thisuse; $summcla = $landClassesDescription; } $nLandTotalAssessedValue += toFloat($land->getAssessedValue()); $nLandTotalAdjustedMarketValue += toFloat($land->getAdjustedMarketValue()); $nLandTotalArea += toFloat($land->getArea()); } } $this->formArray["propertyKind" . $i] = "Land"; $this->formArray["classification" . $i] = $summcla; $this->formArray["propertyActualUse" . $i] = $summuse; $this->formArray["findingsTotalArea" . $i] = $nLandTotalArea; $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%"; $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue; $i++; // end of summary of lands } if (count($plantsTreesList)) { $this->formArray["kindIsOthers"] = "X"; // RC 20091006 foreach ($plantsTreesList as $key => $plantsTrees) { if ($i < 5) { // productClass $plantsTreesClasses = new PlantsTreesClasses(); if (is_numeric($plantsTrees->getProductClass())) { $plantsTreesClasses->selectRecord($plantsTrees->getProductClass()); $plantsTreesClassesDescription = $plantsTreesClasses->getDescription(); $plantsTreesClassesCode = $plantsTreesClasses->getCode(); } else { $plantsTreesClassesDescription = $plantsTrees->getProductClass(); $plantsTreesClassesCode = $plantsTrees->getProductClass(); } // actualUse $plantsTreesActualUses = new PlantsTreesActualUses(); if (is_numeric($plantsTrees->getActualUse())) { $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse()); $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription(); $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode(); } else { $plantsTreesActualUsesDescription = $plantsTrees->getActualUse(); $plantsTreesActualUsesCode = $plantsTrees->getActualUse(); } //$this->formArray["propertyKind".($i+1)] = "PlantsTrees"; //$this->formArray["propertyActualUse".($i+1)] =$plantsTreesActualUsesDescription; //$this->formArray["propertyMarketValue".($i+1)] =$plantsTrees->getAdjustedMarketValue(); //$this->formArray["propertyAssessmentLevel".($i+1)] = $plantsTrees->getAssessmentLevel(); //$this->formArray["propertyAssessedValue".($i+1)] = $plantsTrees->getAssessedValue(); $totalMarketValue += toFloat($plantsTrees->getAdjustedMarketValue()); $totalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $nPlantsTotalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $nPlantsTotalAdjustedMarketValue += toFloat($plantsTrees->getAdjustedMarketValue()); $swornLandTotal += toFloat($plantsTrees->getAdjustedMarketValue()); $swornOverallTotal += toFloat($plantsTrees->getAdjustedMarketValue()); //$i++; } } $this->formArray["propertyKind" . $i] = "PlantTrees"; //inserted May 31, 2008 $this->formArray["classification" . $i] = $plantsTreesClassesDescription; $this->formArray["propertyActualUse" . $i] = $plantsTreesActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nPlantsTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $plantsTrees->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nPlantsTotalAssessedValue; $i++; // additional new line for total of LAND AND PLANT TREES // $nSwornLandTotal =$nPlantsTotalAdjustedMarketValue + $nLandTotalAdjustedMarketValue; // $this->formArray["swornLandTotal"] =$nSwornLandTotal; //number_format($nSwornLandTotal,2); // END } if (count($improvementsBuildingsList)) { $this->formArray["kindIsBuilding"] = "X"; // RC 20091006 // $this->formArray["numberOfStoreys"] = $improvementsBuildings->getNumberOfStoreys(); $nBuildingTotalArea = 0; $nBuildingTotalAssessedValue = 0; $nBuildingTotalAdjustedMarketValue = 0; foreach ($improvementsBuildingsList as $key => $improvementsBuildings) { if ($i < 5) { // buildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); if (is_numeric($improvementsBuildings->getBuildingClassification())) { $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification()); $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription(); $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode(); } else { $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification(); $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification(); } // actualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); if (is_numeric($improvementsBuildings->getActualUse())) { $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse()); $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription(); $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode(); } else { $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse(); } $totalMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue()); $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $totalArea += $improvementsBuildings->getTotalBuildingArea(); // RC 20091008 $thislvl = $improvementsBuildings->getAssessmentLevel(); $thisuse = $improvementsBuildingsActualUsesDescription; if ($summuse == '') { //RC first record $summlvl = $thislvl; $summuse = $thisuse; $summcla = $improvementsBuildingsClassesDescription; } if ($summlvl != $thislvl || $summuse != $thisuse) { //RC print if new assessment level or new actual use $this->formArray["propertyKind" . $i] = "Land"; $this->formArray["classification" . $i] = $summcla; $this->formArray["propertyActualUse" . $i] = $summuse; $this->formArray["findingsTotalArea" . $i] = $nBuildingTotalArea; $this->formArray["propertyMarketValue" . $i] = $nBuildingTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%"; $this->formArray["propertyAssessedValue" . $i] = $nBuildingTotalAssessedValue; $i++; $nBuildingTotalAssessedValue = 0; $nBuildingTotalAdjustedMarketValue = 0; $nBuildingTotalArea = 0; $summlvl = $thislvl; $summuse = $thisuse; $summcla = $improvementsBuildingsClassesDescription; } $nBuildingTotalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $nBuildingTotalAdjustedMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue()); $nBuildingTotalArea += toFloat($improvementsBuildings->getTotalBuildingArea()); $swornImprovementTotal += toFloat($improvementsBuildings->getAdjustedMarketValue()); $swornOverallTotal += toFloat($improvementsBuildings->getAdjustedMarketValue()); } } $this->formArray["propertyKind" . $i] = "ImprovementsBuildings"; $this->formArray["classification" . $i] = $improvementsBuildingsClassesDescription; $this->formArray["propertyActualUse" . $i] = $improvementsBuildingsActualUsesDescription; $this->formArray["findingsTotalArea" . $i] = $nBuildingTotalArea; $this->formArray["propertyMarketValue" . $i] = $nBuildingTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $improvementsBuildings->getAssessmentLevel() . "%"; $this->formArray["propertyAssessedValue" . $i] = $nBuildingTotalAssessedValue; $i++; $this->formArray["findingsTotalArea"] = $totalArea; //RC 20091008 } if (count($machineriesList)) { $this->formArray["kindIsMachinery"] = "X"; // RC 20091006 foreach ($machineriesList as $key => $machineries) { if ($i < 5) { // kind $machineriesClasses = new MachineriesClasses(); if (is_numeric($machineries->getKind())) { $machineriesClasses->selectRecord($machineries->getKind()); $machineriesClassesDescription = $machineriesClasses->getDescription(); $machineriesClassesCode = $machineriesClasses->getCode(); } else { $machineriesClassesDescription = $machineries->getKind(); $machineriesClassesCode = $machineries->getActualUse(); } // actualUse $machineriesActualUses = new MachineriesActualUses(); if (is_numeric($machineries->getActualUse())) { $machineriesActualUses->selectRecord($machineries->getActualUse()); $machineriesActualUsesDescription = $machineriesActualUses->getDescription(); $machineriesActualUsesCode = $machineriesActualUses->getCode(); } else { $machineriesActualUsesDescription = $machineries->getActualUse(); $machineriesActualUsesCode = $machineries->getActualUse(); } $totalMarketValue += toFloat($machineries->getAdjustedMarketValue()); $totalAssessedValue += toFloat($machineries->getAssessedValue()); $nMachineriesTotalAssessedValue += toFloat($machineries->getAssessedValue()); $nMachineriesTotalAdjustedMarketValue += toFloat($machineries->getAdjustedMarketValue()); $swornImprovementTotal += toFloat($machineries->getAdjustedMarketValue()); $swornOverallTotal += toFloat($machineries->getAdjustedMarketValue()); // $i++; } } $this->formArray["propertyKind" . $i] = "Machineries"; $this->formArray["classification" . $i] = $machineriesClassesDescription; $this->formArray["propertyActualUse" . $i] = $machineriesActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nMachineriesTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $machineries->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nMachineriesTotalAssessedValue; $i++; } // add pre hehe for sworn statement total and machineries $this->formArray["swornLandTotal"] = $swornLandTotal; $this->formArray["swornImprovementTotal"] = $swornImprovementTotal; $this->formArray["swornOverallTotal"] = $swornOverallTotal; // $nSwornImprovementTotal =$nMachineriesTotalAdjustedMarketValue + $nBuildingsTotalAdjustedMarketValue; // $this->formArray["swornImprovementTotal"] =$nSwornImprovementTotal; // $nSwornOverallTotal =$nSwornImprovementTotal + $nSwornLandTotal; // $this->formArray["swornOverallTotal"] =$nSwornOverallTotal; // end $this->formArray["totalMarketValue"] = $totalMarketValue; $this->formArray["totalAssessedValue"] = $totalAssessedValue; $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue); }
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 displayLandList($landList) { $landTotal = 0; if (count($landList)) { $l = 0; $landitems = ''; $adjitems = ''; $totalarea = 0; $adjcount = $this->formArray["adjcount"]; $adjfact = ''; $percadj = 0; $markval = 0; $valuadj = 0; $adjmark = 0; $summcount = $this->formArray["summcount"]; $summuse = ''; $summadj = 0; $summlvl = 0; $summasv = 0; foreach ($landList as $key => $land) { if ($this->pl == 0) { //$this->formArray["arpNumber"] = $land->getArpNumber(); //$this->formArray["propertyIndexNumber"] = $land->getPropertyIndexNumber(); $this->formArray["octTctNumber"] = $land->getOctTctNumber(); $this->formArray["surveyNumber"] = $land->getSurveyNumber(); $this->formArray["north"] = $land->getNorth(); $this->formArray["east"] = $land->getEast(); $this->formArray["south"] = $land->getSouth(); $this->formArray["west"] = $land->getWest(); //$this->formArray["taxability"] = $land->getTaxability(); //$this->formArray["effectivity"] = $land->getEffectivity(); $this->formArray["memoranda"] = $land->getMemoranda(); if (is_a($land->propertyAdministrator, Person)) { if ($land->propertyAdministrator->getLastName() != "") { $this->formArray["administrator"] = $land->propertyAdministrator->getFullName(); } if (is_a($land->propertyAdministrator->addressArray[0], "address")) { $address1 = $land->propertyAdministrator->addressArray[0]->getNumber(); if ($address1 != "") { $address1 .= " "; } $address1 .= $land->propertyAdministrator->addressArray[0]->getStreet(); if ($address1 != "") { $address1 .= ", "; } $address1 .= $land->propertyAdministrator->addressArray[0]->getBarangay(); $address2 = $land->propertyAdministrator->addressArray[0]->getDistrict(); if ($address2 != "") { $address2 .= ", "; } $address2 .= $land->propertyAdministrator->addressArray[0]->getMunicipalityCity(); if ($address2 != "") { $address2 .= ", "; } $address2 .= $land->propertyAdministrator->addressArray[0]->getProvince(); $this->formArray["adminAddress1"] = $address1; $this->formArray["adminAddress2"] = $address2; } $this->formArray["adminTelno"] = $land->propertyAdministrator->getTelephone(); } // recommendingApproval if (is_numeric($land->recommendingApproval)) { $recommendingApproval = new Person(); $recommendingApproval->selectRecord($land->recommendingApproval); $this->formArray["recommendingApproval"] = $recommendingApproval->getFullName(); $this->recommendingApproval = $recommendingApproval->getFullName(); } else { $recommendingApproval = $land->recommendingApproval; $this->formArray["recommendingApproval"] = $recommendingApproval; $this->recommendingApproval = $recommendingApproval; } $this->formArray["dateRecommendingApproval"] = $land->getRecommendingApprovalDate(); // approvedBy if (is_numeric($land->approvedBy)) { $approvedBy = new Person(); $approvedBy->selectRecord($land->approvedBy); $this->formArray["approvedBy"] = $approvedBy->getFullName(); $this->approvedBy = $approvedBy->getFullName(); } else { $approvedBy = $land->approvedBy; $this->formArray["approvedBy"] = $approvedBy; $this->approvedBy = $approvedBy; } $this->formArray["dateApprovedBy"] = $land->getApprovedByDate(); // appraisedBy (assessedBy) if (is_numeric($land->appraisedBy)) { $appraisedBy = new Person(); $appraisedBy->selectRecord($land->appraisedBy); $this->formArray["assessedBy"] = $appraisedBy->getFullName(); $this->appraisedBy = $appraisedBy->getFullName(); } else { $appraisedBy = $land->appraisedBy; $this->formArray["assessedBy"] = $appraisedBy; $this->appraisedBy = $appraisedBy; } $this->formArray["dateAssessedBy"] = $land->getAppraisedByDate(); } $this->formArray["landstart"] -= 19; $offset = $this->formArray["landstart"]; if ($l < 5) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $this->formArray["classification" . ($l + 1)] = $landClasses->getDescription(); } else { $this->formArray["classification" . ($l + 1)] = $land->getClassification(); } $landitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $this->formArray["classification" . ($l + 1)] . '</textitem>' . "\r\n"; // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $this->formArray["subClass" . ($l + 1)] = $landSubclasses->getDescription(); } else { $this->formArray["subClass" . ($l + 1)] = $land->getSubClass(); } $landitems .= '<textitem xpos="125" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $this->formArray["subClass" . ($l + 1)] . '</textitem>' . "\r\n"; $this->formArray["area" . ($l + 1)] = $land->getArea() . " " . $this->getUnit($land->getUnit); $totalarea += (double) $land->getArea(); $landitems .= '<textitem xpos="297" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["area" . ($l + 1)] . '</textitem>' . "\r\n"; // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $this->formArray["landActualUse" . ($l + 1)] = $landActualUses->getDescription(); } else { $this->formArray["landActualUse" . ($l + 1)] = $land->getActualUse(); } $landitems .= '<textitem xpos="305" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $this->formArray["landActualUse" . ($l + 1)] . '</textitem>' . "\r\n"; $this->formArray["unitValue" . ($l + 1)] = $land->getUnitValue(); $landitems .= '<textitem xpos="437" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["unitValue" . ($l + 1)] . '</textitem>' . "\r\n"; $this->formArray["landMrktVal" . ($l + 1)] = number_format($land->getMarketValue(), 2); $landitems .= '<textitem xpos="540" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["landMrktVal" . ($l + 1)] . '</textitem>' . "\r\n"; $landTotal = $landTotal + toFloat($land->getMarketValue()); $landitems .= '<lineitem x1="50" y1="' . ($offset - 8) . '" x2="550" y2="' . ($offset - 8) . '">blurb</lineitem>'; } if ($this->pl < 5) { if ($percadj != (double) $land->getPercentAdjustment()) { if ($markval > 0) { $adjcount++; $this->formArray["adjstart"] -= 14; $offset = $this->formArray["adjstart"]; $adjitems .= '<textitem xpos="147" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($markval, 2) . ' (L)' . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $adjfact . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($percadj, 2) . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($valuadj, 2) . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($adjmark, 2) . '</textitem>' . "\r\n"; $adjitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>'; } $percadj = (double) $land->getPercentAdjustment(); $adjfact = $land->getAdjustmentFactor(); $markval = 0; $valuadj = 0; $adjmark = 0; } $markval += (double) $land->getMarketValue(); $valuadj += (double) $land->getValueAdjustment(); $adjmark += (double) $land->getAdjustedMarketValue(); $this->formArray["valAdjFacMrktVal" . ($this->pl + 1)] = $land->getMarketValue(); $this->formArray["adjFacTxt" . ($this->pl + 1)] = $land->getAdjustmentFactor(); $this->formArray["adjFacInt" . ($this->pl + 1)] = "L"; $this->formArray["adjustment" . ($this->pl + 1)] = $land->getPercentAdjustment(); $this->formArray["valueAdjustment" . ($this->pl + 1)] = $land->getValueAdjustment(); $this->formArray["valAdjFacAdjMrktVal" . ($this->pl + 1)] = $land->getAdjustedMarketValue(); $this->formArray["valAdjFacTotal"] = $this->formArray["valAdjFacTotal"] + toFloat($land->getAdjustedMarketValue()); } if ($this->pl < 5) { $this->formArray["kind" . ($this->pl + 1)] = "Land"; //if(is_numeric($land->getActualUse())){ $landActualUses->selectRecord($land->getActualUse()); $this->formArray["propertyActualUse" . ($this->pl + 1)] = $landActualUses->getDescription(); //} //else{ // $this->formArray["propertyActualUse".($this->pl+1)] = $land->getActualUse(); //} $this->formArray["propertyAdjMrktVal" . ($this->pl + 1)] = $land->getAdjustedMarketValue(); $this->formArray["level" . ($this->pl + 1)] = $land->getAssessmentLevel(); $this->formArray["assessedValue" . ($this->pl + 1)] = $land->getAssessedValue(); $this->formArray["propertyAdjMrktValTotal"] = $this->formArray["propertyAdjMrktValTotal"] + toFloat($land->getAdjustedMarketValue()); $this->formArray["propertyTotal"] = $this->formArray["propertyTotal"] + toFloat($land->getAssessedValue()); /* $summkind = ''; $summuse = ''; $summadj = 0; $summlvl = 0; $summasv = 0; */ if ($summuse != $landActualUses->getDescription()) { if ($summasv > 0) { $summcount++; $this->formArray["summstart"] -= 14; $offset = $this->formArray["summstart"]; $summitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . 'LAND' . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . htmlentities($summuse) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summadj, 2) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summlvl, 2) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summasv, 2) . '</textitem>' . "\r\n"; $summitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>'; } $summuse = $landActualUses->getDescription(); $summlvl = (double) $land->getAssessmentLevel(); $summadj = 0; $summasv = 0; } $summadj += (double) $land->getAdjustedMarketValue(); $summasv += toFloat($land->getAssessedValue()); //(double)$land->getAssessedValue(); } $l++; $this->pl++; } if ($markval > 0) { $adjcount++; $this->formArray["adjstart"] -= 14; $offset = $this->formArray["adjstart"]; $adjitems .= '<textitem xpos="147" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($markval, 2) . ' (L)' . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $adjfact . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($percadj, 2) . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($valuadj, 2) . '</textitem>' . "\r\n"; $adjitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($adjmark, 2) . '</textitem>' . "\r\n"; $adjitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>'; } if ($summasv > 0) { $summcount++; $this->formArray["summstart"] -= 14; $offset = $this->formArray["summstart"]; $summitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . 'LAND' . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . htmlentities($summuse) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summadj, 2) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summlvl, 2) . '</textitem>' . "\r\n"; $summitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summasv, 2) . '</textitem>' . "\r\n"; $summitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>'; } for ($ll = $l; $ll < 5; $ll++) { $this->formArray["landstart"] -= 19; $offset = $this->formArray["landstart"]; $landitems .= '<lineitem x1="50" y1="' . ($offset - 8) . '" x2="550" y2="' . ($offset - 8) . '">blurb</lineitem>'; } $this->formArray["adjcount"] += $adjcount; $this->formArray["adjitems"] .= $adjitems; $this->formArray["summcount"] += $summcount; $this->formArray["summitems"] .= $summitems; $this->formArray["landitems"] = $landitems; $this->formArray["totalarea"] = number_format($totalarea, 4); } $this->formArray["landTotal"] = $landTotal; }
function displayLandList($landList) { if (count($landList)) { foreach ($landList as $lkey => $land) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $landClassesDescription = $landClasses->getDescription(); $landClassesCode = $landClasses->getCode(); } else { $landClassesDescription = $land->getClassification(); $landClassesCode = $land->getClassification(); } //edited May 27, 2008 // just in case subClass and actualUse needs to be drawn from land // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $landSubclassesDescription = $landSubclasses->getDescription(); $landSubclassesCode = $landSubclasses->getCode(); } else { $landSubclassesDescription = $land->getSubClass(); $landSubclassesCode = $land->getSubClass(); } // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $landActualUsesDescription = $landActualUses->getDescription(); $landActualUsesCode = $landActualUses->getCode(); $landActualUsesReportCode = $landActualUses->getReportCode(); } else { $landActualUsesDescription = $land->getActualUse(); $landActualUsesCode = $land->getActualUse(); $landActualUsesReportCode = $landActualUses->getReportCode(); } // edited this code from (3 to 8) if ($this->formArray["p"] <= 24) { $p = $this->formArray["p"]; $this->formArray["kind" . $p] = $land->getKind(); //edited May 27, 2008 //$this->formArray["classification".$p] = $land->getDescription(); $this->formArray["classification" . $p] = $landClassesDescription; $this->formArray["landActualUses" . $p] = $landActualUsesDescription; //edited May 31, 2008 $this->formArray["propertyMarketValue" . $p] = un_number_format($land->getAdjustedMarketValue()); $this->formArray["assessmentLevel" . $p] = un_number_format($land->getAssessmentLevel()); $this->formArray["assessedValue" . $p] = un_number_format($land->getAssessedValue()); $this->formArray["area" . $p] = $land->getArea(); $this->formArray["unit" . $p] = $land->getUnit(); $this->formArray["totalMarketValue"] += un_number_format($this->formArray["propertyMarketValue" . $p]); $this->formArray["totalAssessedValue"] += un_number_format($this->formArray["assessedValue" . $p]); $this->formArray["p"]++; } } } }