function getPerson($personID)
 {
     $person = new Person();
     if ($person->selectRecord($personID)) {
         return $person;
     } else {
         return false;
     }
 }
Beispiel #2
0
 function Main()
 {
     switch ($this->formArray["ownerType"]) {
         case "Person":
             $this->tpl->set_block("rptsTemplate", "CompanyDetails", "CompanyDetailsBlock");
             $this->tpl->set_var("CompanyDetailsBlock", "");
             $person = new Person();
             $person->selectRecord($this->formArray["id"]);
             $this->tpl->set_var("id", $person->getPersonID());
             $this->tpl->set_var("lastName", $person->getLastName());
             $this->tpl->set_var("firstName", $person->getFirstName());
             $this->tpl->set_var("middleName", $person->getMiddleName());
             $this->tpl->set_var("gender", $person->getGender());
             $this->tpl->set_var("birthday", $person->getBirthday());
             $this->tpl->set_var("maritalStatus", $person->getMaritalStatus());
             $this->tpl->set_var("tin", $person->getTin());
             $address = $person->addressArray[0];
             if (is_a($address, Address)) {
                 $this->tpl->set_var("fullAddress", $address->getFullAddress());
             }
             $this->tpl->set_var("telephone", $person->getTelephone());
             $this->tpl->set_var("mobileNumber", $person->getMobileNumber());
             $this->tpl->set_var("email", $person->getEmail());
             break;
         case "Company":
             $this->tpl->set_block("rptsTemplate", "PersonDetails", "PersonDetailsBlock");
             $this->tpl->set_var("PersonDetailsBlock", "");
             $company = new Company();
             $company->selectRecord($this->formArray["id"]);
             $this->tpl->set_var("id", $company->getCompanyID());
             $this->tpl->set_var("companyName", $company->getCompanyName());
             $this->tpl->set_var("tin", $company->getTin());
             $this->tpl->set_var("telephone", $company->getTelephone());
             $this->tpl->set_var("fax", $company->getFax());
             $address = $company->addressArray[0];
             if (is_a($address, Address)) {
                 $this->tpl->set_var("fullAddress", $address->getFullAddress());
             }
             $this->tpl->set_var("email", $company->getEmail());
             $this->tpl->set_var("website", $company->getWebsite());
             break;
         default:
             exit("No Person/Company selected. <a href='OwnerList.php" . $this->sess->url("") . "'>Click here</a> to go back to the Owner List.");
             break;
     }
     $this->tpl->set_var("ownerType", $this->formArray["ownerType"]);
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->setPageDetailPerms();
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Beispiel #3
0
 function selectRecords($condition = " ORDER BY TRIM(Person.lastName), TRIM(Person.firstName), TRIM(Person.middleName) ASC LIMIT 0,10")
 {
     $this->setDB();
     $sql = sprintf("SELECT DISTINCT(OwnerPerson.personID) as personID" . " FROM OwnerPerson,Person " . " WHERE OwnerPerson.personID = Person.personID " . " %s;", $condition);
     $this->db->query($sql);
     while ($this->db->next_record()) {
         $person = new Person();
         $person->selectRecord($this->db->f("personID"));
         $this->arrayList[] = $person;
     }
 }
Beispiel #4
0
 function getPersonDetails($personID)
 {
     $person = new Person();
     $person->selectRecord($personID);
     if (!($domDoc = $person->getDomDocument())) {
         return false;
     } else {
         $xmlStr = $domDoc->dump_mem(true);
         return $xmlStr;
     }
 }
Beispiel #5
0
 function selectPersonRecords($condition = "")
 {
     $this->setDB();
     $sql = sprintf("SELECT DISTINCT(OwnerPerson.personID) as personID" . " FROM OwnerPerson,Person " . " WHERE OwnerPerson.personID = Person.personID " . " %s;", $condition);
     $this->db->query($sql);
     $personRecords = new PersonRecords();
     while ($this->db->next_record()) {
         $person = new Person();
         $person->selectRecord($this->db->f("personID"));
         $personRecords->arrayList[] = $person;
     }
     if (is_array($personRecords->arrayList)) {
         return $personRecords;
     } else {
         return false;
     }
 }
Beispiel #6
0
 function setPersonList()
 {
     $db = new DB_RPTS();
     $db1 = new DB_RPTS();
     $db->query("SELECT DISTINCT personID from OwnerPerson inner join Owner on Owner.ownerID=OwnerPerson.ownerID where Owner.rptopID <> ''");
     $this->tpl->set_block("rptsTemplate", "Owner", "oBlk");
     for ($i = 0; $db->next_record(); $i++) {
         $personID = $db->f("personID");
         $person = new Person();
         if ($person->selectRecord($personID)) {
             //$setPersonArray($person);
             $this->tpl->set_var(ownerName, $person->getFullName());
             $this->tpl->set_var(ownerID, $personID);
         }
         $this->tpl->parse("oBlk", "Owner", true);
     }
 }
Beispiel #7
0
 function getOwnerName($ownerType, $id)
 {
     $ownerName = "";
     switch ($ownerType) {
         case "Person":
             $person = new Person();
             $person->selectRecord($id);
             $ownerName = $person->getName();
             $this->tpl->set_var("openWin", "PersonDetails.php" . $this->sess->url("") . "&personID=" . $id . "&formAction=viewOnly");
             break;
         case "Company":
             $company = new Company();
             $company->selectRecord($id);
             $ownerName = $company->getCompanyName();
             $this->tpl->set_var("openWin", "CompanyDetails.php" . $this->sess->url("") . "&companyID=" . $id . "&formAction=viewOnly");
             break;
     }
     return $ownerName;
 }
 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;
 }
Beispiel #9
0
 function displayDetails($value)
 {
     //print_r($value);
     foreach ($value as $lkey => $lvalue) {
         switch ($lkey) {
             case "propertyAdministrator":
                 if (is_a($lvalue, Person)) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue->getBirthday());
                     $this->tpl->set_var("personID", $lvalue->getPersonID());
                     $this->tpl->set_var("lastName", $lvalue->getLastName());
                     $this->tpl->set_var("firstName", $lvalue->getFirstName());
                     $this->tpl->set_var("middleName", $lvalue->getMiddleName());
                     $this->tpl->set_var("gender", $lvalue->getGender());
                     $this->tpl->set_var("birth_year", removePreZero($dateArr["year"]));
                     $this->tpl->set_var("birth_month", removePreZero($dateArr["month"]));
                     $this->tpl->set_var("birth_day", removePreZero($dateArr["day"]));
                     $this->tpl->set_var("maritalStatus", $lvalue->getMaritalStatus());
                     $this->tpl->set_var("tin", $lvalue->getTin());
                     if (is_a($lvalue->addressArray[0], "address")) {
                         $this->tpl->set_var("addressID", $lvalue->addressArray[0]->getAddressID());
                         $this->tpl->set_var("number", $lvalue->addressArray[0]->getNumber());
                         $this->tpl->set_var("street", $lvalue->addressArray[0]->getStreet());
                         $this->tpl->set_var("barangay", $lvalue->addressArray[0]->getBarangay());
                         $this->tpl->set_var("district", $lvalue->addressArray[0]->getDistrict());
                         $this->tpl->set_var("municipalityCity", $lvalue->addressArray[0]->getMunicipalityCity());
                         $this->tpl->set_var("province", $lvalue->addressArray[0]->getProvince());
                     }
                     $this->tpl->set_var("telephone", $lvalue->getTelephone());
                     $this->tpl->set_var("mobileNumber", $lvalue->getMobileNumber());
                     $this->tpl->set_var("email", $lvalue->getEmail());
                 } else {
                     $this->tpl->set_var($lkey, "");
                 }
                 break;
             case "verifiedBy":
                 if (is_numeric($lvalue)) {
                     $verifiedBy = new Person();
                     $verifiedBy->selectRecord($lvalue);
                     $this->tpl->set_var("verifiedByID", $verifiedBy->getPersonID());
                     $this->tpl->set_var("verifiedByName", $verifiedBy->getFullName());
                 } else {
                     $verifiedBy = $lvalue;
                     $this->tpl->set_var("verifiedByID", $verifiedBy);
                     $this->tpl->set_var("verifiedByName", $verifiedBy);
                 }
                 break;
             case "plottingsBy":
                 if (is_numeric($lvalue)) {
                     $plottingsBy = new Person();
                     $plottingsBy->selectRecord($lvalue);
                     $this->tpl->set_var("plottingsByID", $plottingsBy->getPersonID());
                     $this->tpl->set_var("plottingsByName", $plottingsBy->getFullName());
                 } else {
                     $plottingsBy = $lvalue;
                     $this->tpl->set_var("plottingsByID", $plottingsBy);
                     $this->tpl->set_var("plottingsByName", $plottingsBy);
                 }
                 break;
             case "notedBy":
                 if (is_numeric($lvalue)) {
                     $notedBy = new Person();
                     $notedBy->selectRecord($lvalue);
                     $this->tpl->set_var("notedByID", $notedBy->getPersonID());
                     $this->tpl->set_var("notedByName", $notedBy->getFullName());
                 } else {
                     $notedBy = $lvalue;
                     $this->tpl->set_var("notedByID", $notedBy);
                     $this->tpl->set_var("notedByName", $notedBy);
                 }
                 break;
             case "appraisedBy":
                 if (is_numeric($lvalue)) {
                     $appraisedBy = new Person();
                     $appraisedBy->selectRecord($lvalue);
                     $this->tpl->set_var("appraisedByID", $appraisedBy->getPersonID());
                     $this->tpl->set_var("appraisedByName", $appraisedBy->getFullName());
                 } else {
                     $appraisedBy = $lvalue;
                     $this->tpl->set_var("appraisedByID", $appraisedBy);
                     $this->tpl->set_var("appraisedByName", $appraisedBy);
                 }
                 break;
             case "appraisedByDate":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("as_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("as_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("as_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->tpl->set_var("as_yearValue", "");
                     $this->tpl->set_var("as_month", "");
                     $this->tpl->set_var("as_dayValue", "");
                 }
                 break;
             case "recommendingApproval":
                 if (is_numeric($lvalue)) {
                     $recommendingApproval = new Person();
                     $recommendingApproval->selectRecord($lvalue);
                     $this->tpl->set_var("recommendingApprovalID", $recommendingApproval->getPersonID());
                     $this->tpl->set_var("recommendingApprovalName", $recommendingApproval->getFullName());
                 } else {
                     $recommendingApproval = $lvalue;
                     $this->tpl->set_var("recommendingApprovalID", $recommendingApproval);
                     $this->tpl->set_var("recommendingApprovalName", $recommendingApproval);
                 }
                 break;
             case "recommendingApprovalDate":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("re_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("re_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("re_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->tpl->set_var("re_yearValue", "");
                     $this->tpl->set_var("re_month", "");
                     $this->tpl->set_var("re_dayValue", "");
                 }
                 break;
             case "approvedBy":
                 if (is_numeric($lvalue)) {
                     $approvedBy = new Person();
                     $approvedBy->selectRecord($lvalue);
                     $this->tpl->set_var("approvedByID", $approvedBy->getPersonID());
                     $this->tpl->set_var("approvedByName", $approvedBy->getFullName());
                 } else {
                     $approvedBy = $lvalue;
                     $this->tpl->set_var("approvedByID", $approvedBy);
                     $this->tpl->set_var("approvedByName", $approvedBy);
                 }
                 break;
             case "approvedByDate":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("av_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("av_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("av_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->tpl->set_var("av_yearValue", "");
                     $this->tpl->set_var("av_month", "");
                     $this->tpl->set_var("av_dayValue", "");
                 }
                 break;
             case "dateConstructed":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("dc_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("dc_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("dc_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateOccupied":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("do_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("do_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("do_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateCompleted":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("dm_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("dm_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("dm_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateAcquired":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("da_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("da_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("da_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateOfInstallation":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("di_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("di_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("di_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateOfOperation":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("do_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("do_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("do_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "propertyID":
                 if (true) {
                     //echo $lvalue."=>".get_class($value)."<br>";
                     switch (get_class($value)) {
                         case "land":
                             $propertyType = "Land";
                             break;
                         case "improvementsbuildings":
                             $propertyType = "ImprovementsBuildings";
                             break;
                         case "plantstrees":
                             $propertyType = "PlantsTrees";
                             break;
                         case "machineries":
                             $propertyType = "Machineries";
                             break;
                     }
                     $this->tpl->set_var($lkey, $lvalue);
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "arpNumber":
                 $lvalue = $lvalue ? $lvalue : "";
                 $this->tpl->set_var($lkey, $lvalue);
                 break;
             case "adjustedMarketValue":
             case "valueAdjustment":
             case "marketValue":
                 $this->tpl->set_var($lkey, number_format($lvalue, 2, '.', ','));
                 break;
             default:
                 if ($lkey != "") {
                     eval('$tmpval = $value->get' . ucfirst($lkey) . '();');
                     //echo '$tmpval = $value->get'.ucfirst($lkey).'();<br>';
                     $this->tpl->set_var($lkey, $tmpval);
                 }
         }
     }
 }
Beispiel #10
0
 function selectRecord($propertyID)
 {
     if ($propertyID == "") {
         return;
     }
     $this->setDB();
     $sql = sprintf("SELECT * FROM  %s WHERE propertyID=%s;", IMPROVEMENTSBUILDINGS_TABLE, $propertyID);
     $this->db->query($sql);
     //echo $sql;
     $improvementsBuildings = new ImprovementsBuildings();
     if ($this->db->next_record()) {
         foreach ($this->db->Record as $key => $value) {
             switch ($key) {
                 case "propertyAdministrator":
                     $propertyAdministrator = new Person();
                     if ($propertyAdministrator->selectRecord($value)) {
                         $this->{$key} = $propertyAdministrator;
                     } else {
                         $this->{$key} = "";
                     }
                     break;
                 default:
                     $this->{$key} = $value;
             }
         }
         $this->setDomDocument();
         $ret = true;
     } else {
         $ret = false;
     }
     return $ret;
 }
Beispiel #11
0
 function displayTDDetails()
 {
     $afsID = $this->formArray["afsID"];
     $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object");
     if (!($xmlStr = $TDDetails->getTD("", $afsID, "", ""))) {
         // error xml
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $td = new TD();
             $td->parseDomDocument($domDoc);
             $this->formArray["taxDeclarationNumber"] = $td->getTaxDeclarationNumber();
             $this->formArray["memoranda"] = $td->getMemoranda();
             $this->formArray["cancelsTDNumber"] = $td->getCancelsTDNumber();
             //cityMunicipalAssessor
             if (is_numeric($td->getCityMunicipalAssessor())) {
                 $cityMunicipalAssessor = new Person();
                 $cityMunicipalAssessor->selectRecord($td->cityMunicipalAssessor);
                 $this->formArray["cityAssessor"] = $cityMunicipalAssessor->getFullName();
             } else {
                 $this->formArray["cityAssessor"] = $td->getCityMunicipalAssessor;
             }
             $this->formArray["propertyType"] = $td->getPropertyType();
         }
     }
 }
 function initMasterSignatoryList($TempVar, $tempVar)
 {
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList(0, " WHERE " . AUTH_USER_MD5_TABLE . ".userType REGEXP '1\$' AND " . AUTH_USER_MD5_TABLE . ".status='enabled'"))) {
         // error xmlStr
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $UserRecords = new UserRecords();
             $UserRecords->parseDomDocument($domDoc);
             $list = $UserRecords->getArrayList();
             foreach ($list as $key => $user) {
                 $person = new Person();
                 $person->selectRecord($user->personID);
                 $this->tpl->set_var("id", $user->personID);
                 $this->tpl->set_var("name", $person->getFullName());
                 $this->initSelected($tempVar . "ID", $user->personID);
                 $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
             }
         }
     }
 }
Beispiel #13
0
 function getFullName()
 {
     $person = new Person();
     $person->selectRecord($this->personID);
     return $person->getFullName();
 }
Beispiel #14
0
 function displayMachineriesList($machineriesList)
 {
     $totAcqCst = 0;
     $totOthers = 0;
     $totMrktVal = 0;
     $totalMarketValue = 0;
     $totalAssessmentValue = 0;
     if (count($machineriesList)) {
         $i = 0;
         foreach ($machineriesList as $key => $machineries) {
             if ($i == 0) {
                 // $this->formArray["arpNumber"] = $machineries->getArpNumber();
                 // $this->formArray["propertyIndexNumber"] = $machineries->getPropertyIndexNumber();
                 $this->formArray["taxability"] = $machineries->getTaxability();
                 $this->formArray["effectivity"] = $machineries->getEffectivity();
                 $this->formArray["buildingPIN"] = $machineries->getBuildingPin();
                 $this->formArray["landPIN"] = $machineries->getLandPin();
                 $this->formArray["memoranda"] = $machineries->getMemoranda();
                 if (is_a($machineries->propertyAdministrator, Person)) {
                     $this->formArray["userAdmin"] = $machineries->propertyAdministrator->getFullName();
                     if (is_a($machineries->propertyAdministrator->addressArray[0], "address")) {
                         $address1 = $machineries->propertyAdministrator->addressArray[0]->getNumber();
                         $address1 .= " " . $machineries->propertyAdministrator->addressArray[0]->getStreet();
                         $address1 .= ", " . $machineries->propertyAdministrator->addressArray[0]->getBarangay();
                         $address2 = $machineries->propertyAdministrator->addressArray[0]->getDistrict();
                         $address2 .= ", " . $machineries->propertyAdministrator->addressArray[0]->getMunicipalityCity();
                         $address2 .= ", " . $machineries->propertyAdministrator->addressArray[0]->getProvince();
                         $this->formArray["userAdminAddress"] = $address1 . " " . $address2;
                     }
                     $this->formArray["userAdminTelNo"] = $machineries->propertyAdministrator->getTelephone();
                 }
                 // recommendingApproval
                 if (is_numeric($machineries->recommendingApproval)) {
                     $recommendingApproval = new Person();
                     $recommendingApproval->selectRecord($machineries->recommendingApproval);
                     $this->formArray["cityAssessor"] = $recommendingApproval->getFullName();
                     $this->recommendingApproval = $recommendingApproval->getFullName();
                 } else {
                     $recommendingApproval = $machineries->recommendingApproval;
                     $this->formArray["cityAssessor"] = $recommendingApproval;
                     $this->recommendingApproval = $recommendingApproval;
                 }
                 $this->formArray["dateCityAssessor"] = $machineries->getRecommendingApprovalDate();
                 // approvedBy
                 if (is_numeric($machineries->approvedBy)) {
                     $approvedBy = new Person();
                     $approvedBy->selectRecord($machineries->approvedBy);
                     $this->formArray["provincialAssessor"] = $approvedBy->getFullName();
                     $this->approvedBy = $approvedBy->getFullName();
                 } else {
                     $approvedBy = $land->approvedBy;
                     $this->formArray["provincialAssessor"] = $approvedBy;
                     $this->approvedBy = $approvedBy;
                 }
                 $this->formArray["dateProvAssessor"] = $machineries->getApprovedByDate();
                 // appraisedBy (assessedBy)
                 if (is_numeric($machineries->appraisedBy)) {
                     $appraisedBy = new Person();
                     $appraisedBy->selectRecord($machineries->appraisedBy);
                     $this->formArray["assessedBy"] = $appraisedBy->getFullName();
                     $this->appraisedBy = $appraisedBy->getFullName();
                 } else {
                     $appraisedBy = $machineries->appraisedBy;
                     $this->formArray["assessedBy"] = $appraisedBy;
                     $this->appraisedBy = $appraisedBy;
                 }
                 $this->formArray["dateAssessedBy"] = $machineries->getAppraisedByDate();
             }
             if ($i < 9) {
                 $this->formArray["tbl1Desc" . ($i + 1)] = $machineries->machineryDescription;
                 $this->formArray["tbl2Desc" . ($i + 1)] = $machineries->machineryDescription;
                 $this->formArray["brandNo" . ($i + 1)] = $machineries->brand . " " . $machineries->modelNumber;
                 $this->formArray["capacity" . ($i + 1)] = $machineries->capacity;
                 $this->formArray["dateAcquired" . ($i + 1)] = $machineries->dateAcquired;
                 $this->formArray["condAcq" . ($i + 1)] = $machineries->conditionWhenAcquired;
                 $this->formArray["lifeEst" . ($i + 1)] = $machineries->estimatedEconomicLife;
                 $this->formArray["lifeRem" . ($i + 1)] = $machineries->remainingEconomicLife;
                 $this->formArray["dateInst" . ($i + 1)] = $machineries->dateOfInstallation;
                 $this->formArray["dateOper" . ($i + 1)] = $machineries->dateOfOperation;
                 $this->formArray["remarks" . ($i + 1)] = $machineries->remarks;
                 $this->formArray["units" . ($i + 1)] = $machineries->numberOfUnits;
                 $this->formArray["acqCost" . ($i + 1)] = $machineries->acquisitionCost;
                 $this->formArray["freight" . ($i + 1)] = $machineries->freightCost;
                 $this->formArray["insurnc" . ($i + 1)] = $machineries->insuranceCost;
                 $this->formArray["instaln" . ($i + 1)] = $machineries->installationCost;
                 $this->formArray["others" . ($i + 1)] = $machineries->othersCost;
                 $this->formArray["mrktVal" . ($i + 1)] = $machineries->marketValue;
                 $this->formArray["depr" . ($i + 1)] = $machineries->depreciation;
                 $this->formArray["depMVal" . ($i + 1)] = $machineries->depreciatedMarketValue;
                 $totAcqCst = $totAcqCst + toFloat($machineries->acquisitionCost);
                 $totOthers = $totOthers + toFloat($machineries->othersCost);
                 $totMrktVal = $totMrktVal + toFloat($machineries->marketValue);
                 $totalMarketValue = $totMrktVal;
                 $totalAssessmentValue = $totalAssessmentValue + toFloat($machineries->assessedValue);
             }
             $i++;
         }
     }
     $this->formArray["totAcqCst"] = $totAcqCst;
     $this->formArray["totOthers"] = $totOthers;
     $this->formArray["totMrktVal"] = $totMrktVal;
     $this->formArray["totalMarketValue"] = $totalMarketValue;
     $this->formArray["totalAssessmentValue"] = $totalAssessmentValue;
 }
Beispiel #15
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "remove":
             //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")";
             $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
             if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) {
                 if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                     //echo "SOAP failed";
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"])));
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     //select
     $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object");
     if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) {
         exit("xml failed");
     } else {
         //echo($xmlStr);
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
             $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
         } else {
             $rptop = new RPTOP();
             $rptop->parseDomDocument($domDoc);
             //print_r($rptop);
             foreach ($rptop as $key => $value) {
                 switch ($key) {
                     case "owner":
                         //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object");
                         if (is_a($value, "Owner")) {
                             $this->formArray["ownerID"] = $rptop->owner->getOwnerID();
                             $xmlStr = $rptop->owner->domDocument->dump_mem(true);
                             if (!$xmlStr) {
                                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                 $this->tpl->set_var("OwnerListTableBlock", "");
                             } else {
                                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                                 } else {
                                     $this->displayOwnerList($domDoc);
                                 }
                             }
                         } else {
                             $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock");
                             $this->tpl->set_var("PersonListBlock", "");
                             $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
                             $this->tpl->set_var("CompanyListBlock", "");
                         }
                         break;
                     case "cityAssessor":
                         if (is_numeric($value)) {
                             $cityAssessor = new Person();
                             $cityAssessor->selectRecord($value);
                             $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID());
                             $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName());
                             $this->formArray["cityAssessorName"] = $cityAssessor->getFullName();
                         } else {
                             $cityAssessor = $value;
                             $this->tpl->set_var("cityAssessorID", $cityAssessor);
                             $this->tpl->set_var("cityAssessorName", $cityAssessor);
                             $this->formArray["cityAssessorName"] = $cityAssessor;
                         }
                         break;
                     case "cityTreasurer":
                         if (is_numeric($value)) {
                             $cityTreasurer = new Person();
                             $cityTreasurer->selectRecord($value);
                             $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID());
                             $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName());
                             $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName();
                         } else {
                             $cityTreasurer = $value;
                             $this->tpl->set_var("cityTreasurerID", $cityTreasurer);
                             $this->tpl->set_var("cityTreasurerName", $cityTreasurer);
                             $this->formArray["cityTreasurerName"] = $cityTreasurer;
                         }
                         break;
                     case "tdArray":
                         $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock");
                         $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock");
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $tdCtr = 0;
                         if (count($value)) {
                             $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                             $this->tpl->set_var("TDDBEmptyBlock", "");
                             /*
                             $this->tpl->set_block("TDList", "Land", "LandBlock");
                             $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock");
                             $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock");
                             $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock");
                             */
                             foreach ($value as $tkey => $tvalue) {
                                 //foreach($tvalue as $column => $val){
                                 //	$this->tpl->set_var($column,$val);
                                 //}
                                 $this->tpl->set_var("tdID", $tvalue->getTDID());
                                 $this->tpl->set_var("taxDeclarationNumber", $tvalue->getTaxDeclarationNumber());
                                 $this->tpl->set_var("afsID", $tvalue->getAfsID());
                                 $this->tpl->set_var("cancelsTDNumber", $tvalue->getCancelsTDNumber());
                                 $this->tpl->set_var("canceledByTDNumber", $tvalue->getCanceledByTDNumber());
                                 $this->tpl->set_var("taxBeginsWithTheYear", $tvalue->getTaxBeginsWithTheYear());
                                 $this->tpl->set_var("ceasesWithTheYear", $tvalue->getCeasesWithTheYear());
                                 $this->tpl->set_var("enteredInRPARForBy", $tvalue->getEnteredInRPARForBy());
                                 $this->tpl->set_var("enteredInRPARForYear", $tvalue->getEnteredInRPARForYear());
                                 $this->tpl->set_var("previousOwner", $tvalue->getPreviousOwner());
                                 $this->tpl->set_var("previousAssessedValue", $tvalue->getPreviousAssessedValue());
                                 list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getProvincialAssessorDate());
                                 $this->tpl->set_var("pa_yearValue", removePreZero($dateArr["year"]));
                                 $this->tpl->set_var("pa_month", removePreZero($dateArr["month"]));
                                 $this->tpl->set_var("pa_dayValue", removePreZero($dateArr["day"]));
                                 list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getCityMunicipalAssessorDate());
                                 $this->tpl->set_var("cm_yearValue", removePreZero($dateArr["year"]));
                                 $this->tpl->set_var("cm_month", removePreZero($dateArr["month"]));
                                 $this->tpl->set_var("cm_dayValue", removePreZero($dateArr["day"]));
                                 $this->tpl->set_var("provincialAssessorName", $tvalue->provincialAssessor);
                                 $this->tpl->set_var("cityMunicipalAssessorName", $tvalue->cityMunicipalAssessor);
                                 //$this->tpl->set_var("assessedValue",$tvalue->getAssessedValue());
                                 $this->tpl->set_var("propertyType", $tvalue->getPropertyType());
                                 $this->tpl->set_var("basicTax", "");
                                 $this->tpl->set_var("sefTax", "");
                                 $this->tpl->set_var("total", "");
                                 //$this->tpl->set_var("basicTax",$tvalue->getBasicTax());
                                 //$this->tpl->set_var("sefTax",$tvalue->getSefTax());
                                 //$this->tpl->set_var("total",$tvalue->getTotal());
                                 $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                                 if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) {
                                     //$this->tpl->set_block("rptsTemplate", "AFSTable", "AFSTableBlock");
                                     //$this->tpl->set_var("AFSTableBlock", "afs not found");
                                 } else {
                                     //echo $xmlStr;
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         //$this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                         //$this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                                     } else {
                                         $afs = new AFS();
                                         $afs->parseDomDocument($domDoc);
                                         $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue();
                                         $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue();
                                         $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue();
                                         $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue();
                                         $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue();
                                         $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue();
                                         $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue();
                                         $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue();
                                         $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue();
                                         $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue();
                                         $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ','));
                                         $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ','));
                                         $this->tpl->set_var("taxability", $afs->getTaxability());
                                         $this->tpl->set_var("effectivity", $afs->getEffectivity());
                                         $this->formArray["idle"] = "No";
                                         if ($tvalue->getPropertyType() == "Land") {
                                             if (is_array($afs->landArray)) {
                                                 // if land is stripped
                                                 if (count($afs->landArray) > 1) {
                                                     foreach ($afs->landArray as $land) {
                                                         if ($land->getIdle() == "Yes") {
                                                             $this->formArray["idle"] = "Yes";
                                                             break;
                                                         }
                                                     }
                                                 } else {
                                                     $this->formArray["idle"] = $afs->landArray[0]->getIdle();
                                                 }
                                             }
                                         }
                                         if ($this->formArray["idle"] == "") {
                                             $this->formArray["idle"] = "No";
                                         }
                                         $this->tpl->set_var("idle", $this->formArray["idle"]);
                                     }
                                 }
                                 // grab DueRecords from tdID
                                 $this->formArray["totalTaxDue"] = 0.0;
                                 $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object");
                                 $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => "");
                                 if (!($xmlStr = $DueList->getDueList($tvalue->getTdID()))) {
                                     foreach ($dueArrayList as $dueKey => $dueValue) {
                                         $this->tpl->set_var("basicTax[" . $dueKey . "]", "uncalculated");
                                         $this->tpl->set_var("sefTax[" . $dueKey . "]", "uncalculated");
                                         $this->tpl->set_var("idleTax[" . $dueKey . "]", "uncalculated");
                                         $this->tpl->set_var("taxDue[" . $dueKey . "]", "uncalculated");
                                         $this->tpl->set_var("dueDate[" . $dueKey . "]", "-");
                                     }
                                 } else {
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         foreach ($dueArrayList as $dueKey => $dueValue) {
                                             $this->tpl->set_var("basicTax[" . $dueKey . "]", "uncalculated");
                                             $this->tpl->set_var("sefTax[" . $dueKey . "]", "uncalculated");
                                             $this->tpl->set_var("idleTax[" . $dueKey . "]", "uncalculated");
                                             $this->tpl->set_var("taxDue[" . $dueKey . "]", "uncalculated");
                                             $this->tpl->set_var("dueDate[" . $dueKey . "]", "-");
                                         }
                                     } 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())));
                                                         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, " . date("Y") . " - " . date("F d, Y", strtotime(date("Y") . "-" . $treasurySettings->getDiscountPeriod())));
                                         $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage();
                                         $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod();
                                         $this->formArray["discountPeriod_End"] = strtotime(date("Y") . "-" . $this->formArray["discountPeriod"]);
                                         $this->formArray["discountPeriod_Start"] = strtotime(date("Y") . "-01-01");
                                         // initialize penaltyLUTArray
                                         $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
                                             if (strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]) {
                                                 $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100));
                                             } else {
                                                 $dueArrayList[$dKey]->setEarlyPaymentDiscount(0.0);
                                             }
                                             // compute Penalty as of today
                                             // check if today is exceeding dueDate and compute penalty
                                             if (strtotime($this->now) > strtotime($dueArrayList[$dKey]->getDueDate())) {
                                                 // count months
                                                 // numYears = today[year] - dueDate[year]
                                                 $numYears = date("Y", strtotime($this->now)) - date("Y", strtotime($dueArrayList[$dKey]->getDueDate()));
                                                 // numMonths = today[month] - dueDate[month]
                                                 $numMonths = date("n", strtotime($this->now)) - date("n", strtotime($dueArrayList[$dKey]->getDueDate()));
                                                 // totalMonths = (numYears*12) + numMonths
                                                 $totalMonths = $numYears * 12 + $numMonths;
                                                 // associate penaltyPercentage
                                                 if ($totalMonths >= count($penaltyLUTArray)) {
                                                     $penaltyPercentage = 0.72;
                                                 } else {
                                                     $penaltyPercentage = $penaltyLUTArray[$totalMonths];
                                                 }
                                                 $penalty = $dueArrayList[$dKey]->getTaxDue() * $penaltyPercentage;
                                                 $dueArrayList[$dKey]->setMonthsOverDue($totalMonths);
                                                 $dueArrayList[$dKey]->setPenaltyPercentage($penaltyPercentage);
                                                 $dueArrayList[$dKey]->setPenalty($penalty);
                                             } else {
                                                 $dueArrayList[$dKey]->setMonthsOverDue(0);
                                                 $dueArrayList[$dKey]->setPenaltyPercentage(0.0);
                                                 $dueArrayList[$dKey]->setPenalty(0.0);
                                             }
                                             $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("netDue", formatCurrency($dueArrayList["Annual"]->getNetDue()));
                                     }
                                 }
                                 $this->tpl->set_var("ctr", $tdCtr);
                                 $this->tpl->parse("defaultTDListBlock", "defaultTDList", true);
                                 $this->tpl->parse("toggleTDListBlock", "toggleTDList", true);
                                 $this->tpl->parse("TDListBlock", "TDList", true);
                                 /*
                                 $this->tpl->set_var("LandBlock", "");
                                 $this->tpl->set_var("PlantsTreesBlock", "");
                                 $this->tpl->set_var("ImprovementsBuildingsBlock", "");
                                 $this->tpl->set_var("MachineriesBlock", "");
                                 */
                                 $tdCtr++;
                             }
                         } else {
                             $this->tpl->set_var("defaultTDListBlock", "//no default");
                             $this->tpl->set_var("toggleTDListBlock", "//no Toggle");
                             $this->tpl->set_var("TDListBlock", "");
                         }
                         $this->tpl->set_var("tdCtr", $tdCtr);
                         break;
                     case "landTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "landTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "plantTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "plantTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "bldgTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "bldgTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "machTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "machTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "totalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "totalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     default:
                         $this->formArray[$key] = $value;
                 }
             }
             $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"];
             $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"];
             unset($rptop);
             $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
             $rptop = new RPTOP();
             $rptop->setRptopID($this->formArray["rptopID"]);
             $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]);
             $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]);
             $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]);
             $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]);
             $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]);
             $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]);
             $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]);
             $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]);
             $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]);
             $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]);
             $rptop->setCreatedBy($this->userID);
             $rptop->setModifiedBy($this->userID);
             $rptop->setDomDocument();
             $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object");
             $rptop->setDomDocument();
             $doc = $rptop->getDomDocument();
             $xmlStr = $doc->dump_mem(true);
             //echo $xmlStr;
             if (!($ret = $RPTOPEncode->updateRPTOPtotals($xmlStr))) {
                 echo "ret=" . $ret;
             }
             //echo $ret;
         }
     }
     $this->setForm();
     $this->setPageDetailPerms();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y", 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");
 }
Beispiel #16
0
 function selectRecords()
 {
     foreach ($this->formArray["personID"] as $personID) {
         $person = new Person();
         $person->selectRecord($personID);
         $this->arrayList[] = $person;
     }
 }
Beispiel #17
0
 function initMasterSignatoryList($TempVar, $tempVar)
 {
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         // error xml
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $eRPTSSettings = new eRPTSSettings();
             $eRPTSSettings->parseDomDocument($domDoc);
             switch ($tempVar) {
                 case "recommendingApproval":
                 case "approvedBy":
                     $this->formArray["recommendingApprovalID"] = $this->formArray["recommendingApproval"];
                     $this->formArray["approvedByID"] = $this->formArray["approvedBy"];
                     $this->tpl->set_var("id", $eRPTSSettings->getAssessorFullName());
                     $this->tpl->set_var("name", $eRPTSSettings->getAssessorFullName());
                     $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                     $this->initSelected($tempVar . "ID", $eRPTSSettings->getAssessorFullName());
                     $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
                     // provincialAssessor
                     if ($eRPTSSettings->getProvincialAssessorLastName() != "") {
                         $this->formArray["recommendingApprovalID"] = $this->formArray["recommendingApproval"];
                         $this->formArray["approvedByID"] = $this->formArray["approvedBy"];
                         $this->tpl->set_var("id", $eRPTSSettings->getProvincialAssessorFullName());
                         $this->tpl->set_var("name", $eRPTSSettings->getProvincialAssessorFullName());
                         $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                         $this->initSelected($tempVar . "ID", $eRPTSSettings->getProvincialAssessorFullName());
                         $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
                     }
                     break;
             }
         }
     }
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList(0, " WHERE (userType='Signatory' OR userType='Assessor') AND status='enabled'"))) {
         //$this->tpl->set_var("id", "");
         //$this->tpl->set_var("name", "empty list");
         //$this->tpl->parse($TempVar."ListBlock", $TempVar."List", true);
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             //$this->tpl->set_var("", "");
             //$this->tpl->set_var("name", "empty list");
             //$this->tpl->parse($TempVar."ListBlock", $TempVar."List", true);
         } else {
             $UserRecords = new UserRecords();
             $UserRecords->parseDomDocument($domDoc);
             $list = $UserRecords->getArrayList();
             foreach ($list as $key => $user) {
                 $person = new Person();
                 $person->selectRecord($user->personID);
                 $this->tpl->set_var("id", $user->personID);
                 $this->tpl->set_var("name", $person->getFullName());
                 $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                 $this->initSelected($tempVar . "ID", $user->personID);
                 $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
             }
         }
     }
 }
 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;
 }
Beispiel #19
0
 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("rptsTemplate", "JSTDList", "JSTDListBlock");
                         $this->tpl->set_block("TDList", "DueTypeList", "DueTypeListBlock");
                         $this->tpl->set_block("TDList", "BacktaxesList", "BacktaxesListBlock");
                         $this->tpl->set_block("JSTDList", "JSBacktaxesList", "JSBacktaxesListBlock");
                         $this->tpl->set_block("BacktaxesList", "BacktaxDueTypeList", "BacktaxDueTypeListBlock");
                         $tdCtr = 0;
                         if (count($value)) {
                             $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                             $this->tpl->set_var("TDDBEmptyBlock", "");
                             foreach ($value as $tkey => $tvalue) {
                                 $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("propertyType", $tvalue->getPropertyType());
                                 $this->tpl->set_var("basicTax", "");
                                 $this->tpl->set_var("sefTax", "");
                                 $this->tpl->set_var("total", "");
                                 $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                                 if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) {
                                     //
                                 } else {
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         //
                                     } else {
                                         $afs = new AFS();
                                         $afs->parseDomDocument($domDoc);
                                         $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue();
                                         $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue();
                                         $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue();
                                         $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue();
                                         $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue();
                                         $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue();
                                         $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue();
                                         $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue();
                                         $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue();
                                         $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue();
                                         $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ','));
                                         $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ','));
                                         $this->tpl->set_var("taxability", $afs->getTaxability());
                                         $this->tpl->set_var("effectivity", $afs->getEffectivity());
                                         $this->formArray["idle"] = "No";
                                         if ($tvalue->getPropertyType() == "Land") {
                                             if (is_array($afs->landArray)) {
                                                 // if land is stripped
                                                 if (count($afs->landArray) > 1) {
                                                     foreach ($afs->landArray as $land) {
                                                         if ($land->getIdle() == "Yes") {
                                                             $this->formArray["idle"] = "Yes";
                                                             break;
                                                         }
                                                     }
                                                 } else {
                                                     $this->formArray["idle"] = $afs->landArray[0]->getIdle();
                                                 }
                                             }
                                         }
                                         if ($this->formArray["idle"] == "") {
                                             $this->formArray["idle"] = "No";
                                         }
                                         $this->tpl->set_var("idle", $this->formArray["idle"]);
                                     }
                                 }
                                 // grab DueRecords from tdID
                                 $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object");
                                 $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => "");
                                 $this->tpl->set_var("dueYear", $rptop->getTaxableYear());
                                 if (!($xmlStr = $DueList->getDueList($tvalue->getTdID(), $rptop->getTaxableYear()))) {
                                     foreach ($dueArrayList as $dueKey => $dueValue) {
                                         $this->tpl->set_var("basicTax[" . $dueKey . "]", "uncalculated");
                                         $this->tpl->set_var("sefTax[" . $dueKey . "]", "uncalculated");
                                         $this->tpl->set_var("idleTax[" . $dueKey . "]", "uncalculated");
                                         $this->tpl->set_var("taxDue[" . $dueKey . "]", "uncalculated");
                                         $this->tpl->set_var("dueDate[" . $dueKey . "]", "-");
                                     }
                                 } else {
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         foreach ($dueArrayList as $dueKey => $dueValue) {
                                             $this->tpl->set_var("basicTax[" . $dueKey . "]", "uncalculated");
                                             $this->tpl->set_var("sefTax[" . $dueKey . "]", "uncalculated");
                                             $this->tpl->set_var("idleTax[" . $dueKey . "]", "uncalculated");
                                             $this->tpl->set_var("taxDue[" . $dueKey . "]", "uncalculated");
                                             $this->tpl->set_var("dueDate[" . $dueKey . "]", "-");
                                         }
                                     } 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())));
                                                         $this->tpl->set_var("dueID[" . $dueValue . "]", $due->getDueID());
                                                         break;
                                                 }
                                             }
                                         }
                                         // initialize discountPeriod and discountPercentage for earlyPaymentDiscount
                                         $treasurySettings = $this->getTreasurySettings();
                                         $this->tpl->set_var("discountPercentage", $treasurySettings->getDiscountPercentage() . "%");
                                         $this->tpl->set_var("discountPeriod", "January 01, " . $rptop->getTaxableYear() . " - " . date("F d, Y", strtotime($rptop->getTaxableYear() . "-" . $treasurySettings->getDiscountPeriod())));
                                         $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage();
                                         $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod();
                                         $this->formArray["discountPeriod_End"] = strtotime($rptop->getTaxableYear() . "-" . $this->formArray["discountPeriod"]);
                                         $this->formArray["discountPeriod_Start"] = strtotime($rptop->getTaxableYear() . "-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 = $this->getPenaltyLUTArray();
                                         // get paymentHistory
                                         $defaultDueType = "Annual";
                                         $allowableDueTypesArray = array("Annual", "Q1", "Q2", "Q3", "Q4");
                                         /* alxjvr 2006.03.22
                                         											if(!$paymentHistory = $this->getPaymentHistory($dueArrayList,"")){
                                         												$defaultDueType = "Annual";
                                         												$allowableDueTypesArray = array("Annual","Q1");
                                         											}
                                         											else{
                                         												$defaultDueType = $paymentHistory->arrayList[0]->getDueType();
                                         
                                         												if($defaultDueType=="Annual"){
                                         													$allowableDueTypesArray = array("Annual");
                                         												}
                                         												else{
                                         													switch($defaultDueType){
                                         														case "Q1":
                                         															$allowableDueTypesArray = array("Q1", "Q2");
                                         															break;
                                         														case "Q2":
                                         															$allowableDueTypesArray = array("Q2", "Q3");
                                         															break;
                                         														case "Q3":
                                         															$allowableDueTypesArray = array("Q3", "Q4");
                                         															break;
                                         														case "Q4":
                                         															$allowableDueTypesArray = array("Q4");
                                         															break;
                                         													}
                                         												}
                                         											}
                                         											*/
                                         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: February 08, 2005
                                                 // 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 {
                                                     // 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));
                                                     } else {
                                                         $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100));
                                                     }
                                                 }
                                             }
                                             $latestPaymentDate[$dKey] = $this->getLatestPaymentDateForDue($dueArrayList[$dKey]);
                                             $amountPaidForDue = $this->getAmountPaidForDue($dueArrayList);
                                             $amnestyStatus = $this->getAmnestyStatusForDue($dueArrayList);
                                             $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);
                                                 }
                                             }
                                             if ($amnestyStatus) {
                                                 $this->tpl->set_var("amnesty_status", "checked");
                                             } else {
                                                 $this->tpl->set_var("amnesty_status", "");
                                             }
                                             // 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 = $dueArrayList[$dKey]->getInitialNetDue() - $amountPaidForDue;
                                                 // 0.1 is used instead of 0 because sometimes rounded off balances intended to be 0 end up appearing as 0.002 or so...
                                                 if (round($balance, 4) > 0.1) {
                                                     $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("totalPaid[" . $dKey . "]", formatCurrency($this->getAmountPaidForDueID($dueArrayList[$dKey]->getDueID())));
                                             $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getInitialNetDue()));
                                             $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue();
                                         }
                                         // revert Back to Annual mode if Quarterly Dues have Penalties
                                         foreach ($dueArrayList as $dKey => $due) {
                                             if ($dKey != "Annual") {
                                                 if ($dueArrayList[$dKey]->getPenalty() > 0) {
                                                     $defaultDueType = "Annual";
                                                     $allowableDueTypesArray = array("Annual");
                                                     $revertedBackToAnnual = true;
                                                     break;
                                                 }
                                             }
                                         }
                                         foreach ($allowableDueTypesArray as $allowableDueType) {
                                             $this->tpl->set_var("allowableDueType", $allowableDueType);
                                             $this->tpl->parse("DueTypeListBlock", "DueTypeList", true);
                                         }
                                         $this->tpl->set_var("dueType[Annual]_status", "checked");
                                         $this->tpl->set_var("dueType[Q1]_status", "");
                                         $this->tpl->set_var("dueType[Q2]_status", "");
                                         $this->tpl->set_var("dueType[Q3]_status", "");
                                         $this->tpl->set_var("dueType[Q4]_status", "");
                                         $this->tpl->set_var("dueDate", date("M. d, Y", strtotime($dueArrayList[$defaultDueType]->getDueDate())));
                                         $this->tpl->set_var("basicTax", formatCurrency($dueArrayList[$defaultDueType]->getBasicTax()));
                                         $this->tpl->set_var("sefTax", formatCurrency($dueArrayList[$defaultDueType]->getSEFTax()));
                                         $this->tpl->set_var("idleTax", formatCurrency($dueArrayList[$defaultDueType]->getIdleTax()));
                                         $this->tpl->set_var("taxDue", formatCurrency($dueArrayList[$defaultDueType]->getTaxDue()));
                                         $this->tpl->set_var("advancedPaymentDiscount", formatCurrency($dueArrayList[$defaultDueType]->getAdvancedPaymentDiscount()));
                                         $this->tpl->set_var("earlyPaymentDiscount", formatCurrency($dueArrayList[$defaultDueType]->getEarlyPaymentDiscount()));
                                         $this->tpl->set_var("penalty", formatCurrency($dueArrayList[$defaultDueType]->getPenalty()));
                                         // get amountPaid for defaultDueType
                                         // but if dues have been reverted back to "Annual" mode from "Quarterly" mode
                                         // get amountPaid for all the quarters that have been paid so far
                                         if ($revertedBackToAnnual) {
                                             $amountPaid = 0;
                                             $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Annual"]->getDueID());
                                             $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Q1"]->getDueID());
                                             $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Q2"]->getDueID());
                                             $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Q3"]->getDueID());
                                             $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Q4"]->getDueID());
                                         } else {
                                             $amountPaid = $this->getAmountPaidForDueID($dueArrayList[$defaultDueType]->getDueID());
                                         }
                                         $this->tpl->set_var("amountPaid", formatCurrency($amountPaid));
                                         $balance = $dueArrayList[$defaultDueType]->getTaxDue();
                                         if ($dueArrayList[$defaultDueType]->getAdvancedPaymentDiscount() > 0) {
                                             $balance = $dueArrayList[$defaultDueType]->getTaxDue() - $dueArrayList[$defaultDueType]->getAdvancedPaymentDiscount();
                                         } else {
                                             if ($dueArrayList[$defaultDueType]->getEarlyPaymentDiscount() > 0) {
                                                 $balance = $dueArrayList[$defaultDueType]->getTaxDue() - $dueArrayList[$defaultDueType]->getEarlyPaymentDiscount();
                                             }
                                         }
                                         $balance = round($balance + $dueArrayList[$defaultDueType]->getPenalty() - $amountPaid, 2);
                                         $this->tpl->set_var("balance", formatCurrency($balance));
                                     }
                                 }
                                 // 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->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->parse("JSTDListBlock", "JSTDList", true);
                                 $this->tpl->set_var("DueTypeListBlock", "");
                                 // added following line Feb.22,2005 to solve erpts issue (2005-22), backtaxTD blocking bug.
                                 $this->tpl->set_var("BacktaxesListBlock", "");
                                 $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("JSTDListBlock", "");
                         }
                         $this->tpl->set_var("tdCtr", $tdCtr);
                         break;
                     case "landTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "landTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "plantTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "plantTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "bldgTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "bldgTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "machTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "machTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "totalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "totalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     default:
                         $this->formArray[$key] = $value;
                 }
             }
             $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"];
             $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"];
             unset($rptop);
             $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
             $rptop = new RPTOP();
             $rptop->setRptopID($this->formArray["rptopID"]);
             $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]);
             $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]);
             $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]);
             $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]);
             $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]);
             $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]);
             $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]);
             $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]);
             $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]);
             $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]);
             $rptop->setCreatedBy($this->userID);
             $rptop->setModifiedBy($this->userID);
             $rptop->setDomDocument();
             $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object");
             $rptop->setDomDocument();
             $doc = $rptop->getDomDocument();
             $xmlStr = $doc->dump_mem(true);
             //echo $xmlStr;
             if (!($ret = $RPTOPEncode->updateRPTOPtotals($xmlStr))) {
                 echo "ret=" . $ret;
             }
             //echo $ret;
         }
     }
     $this->setForm();
     $this->setPageDetailPerms();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y", 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");
 }
Beispiel #20
0
 function displayDetails($value)
 {
     foreach ($value as $lkey => $lvalue) {
         switch ($lkey) {
             case "propertyAdministrator":
                 if (is_a($lvalue, Person)) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue->getBirthday());
                     $this->tpl->set_var("personID", $lvalue->getPersonID());
                     $this->tpl->set_var("lastName", $lvalue->getLastName());
                     $this->tpl->set_var("firstName", $lvalue->getFirstName());
                     $this->tpl->set_var("middleName", $lvalue->getMiddleName());
                     $this->tpl->set_var("gender", $lvalue->getGender());
                     $this->tpl->set_var("birth_year", removePreZero($dateArr["year"]));
                     $this->tpl->set_var("birth_month", removePreZero($dateArr["month"]));
                     $this->tpl->set_var("birth_day", removePreZero($dateArr["day"]));
                     $this->tpl->set_var("maritalStatus", $lvalue->getMaritalStatus());
                     $this->tpl->set_var("tin", $lvalue->getTin());
                     if (is_a($lvalue->addressArray[0], "address")) {
                         $this->tpl->set_var("addressID", $lvalue->addressArray[0]->getAddressID());
                         $this->tpl->set_var("number", $lvalue->addressArray[0]->getNumber());
                         $this->tpl->set_var("street", $lvalue->addressArray[0]->getStreet());
                         $this->tpl->set_var("barangay", $lvalue->addressArray[0]->getBarangay());
                         $this->tpl->set_var("district", $lvalue->addressArray[0]->getDistrict());
                         $this->tpl->set_var("municipalityCity", $lvalue->addressArray[0]->getMunicipalityCity());
                         $this->tpl->set_var("province", $lvalue->addressArray[0]->getProvince());
                     }
                     $this->tpl->set_var("telephone", $lvalue->getTelephone());
                     $this->tpl->set_var("mobileNumber", $lvalue->getMobileNumber());
                     $this->tpl->set_var("email", $lvalue->getEmail());
                 } else {
                     $this->tpl->set_var($lkey, "");
                 }
                 break;
             case "verifiedBy":
                 if (is_numeric($lvalue)) {
                     $verifiedBy = new Person();
                     $verifiedBy->selectRecord($lvalue);
                     $this->tpl->set_var("verifiedByID", $verifiedBy->getPersonID());
                     $this->tpl->set_var("verifiedByName", $verifiedBy->getFullName());
                 } else {
                     $verifiedBy = $lvalue;
                     $this->tpl->set_var("verifiedByID", $verifiedBy);
                     $this->tpl->set_var("verifiedByName", $verifiedBy);
                 }
                 break;
             case "plottingsBy":
                 if (is_numeric($lvalue)) {
                     $plottingsBy = new Person();
                     $plottingsBy->selectRecord($lvalue);
                     $this->tpl->set_var("plottingsByID", $plottingsBy->getPersonID());
                     $this->tpl->set_var("plottingsByName", $plottingsBy->getFullName());
                 } else {
                     $plottingsBy = $lvalue;
                     $this->tpl->set_var("plottingsByID", $plottingsBy);
                     $this->tpl->set_var("plottingsByName", $plottingsBy);
                 }
                 break;
             case "notedBy":
                 if (is_numeric($lvalue)) {
                     $notedBy = new Person();
                     $notedBy->selectRecord($lvalue);
                     $this->tpl->set_var("notedByID", $notedBy->getPersonID());
                     $this->tpl->set_var("notedByName", $notedBy->getFullName());
                 } else {
                     $notedBy = $lvalue;
                     $this->tpl->set_var("notedByID", $notedBy);
                     $this->tpl->set_var("notedByName", $notedBy);
                 }
                 break;
             case "appraisedBy":
                 if (is_numeric($lvalue)) {
                     $appraisedBy = new Person();
                     $appraisedBy->selectRecord($lvalue);
                     $this->tpl->set_var("appraisedByID", $appraisedBy->getPersonID());
                     $this->tpl->set_var("appraisedByName", $appraisedBy->getFullName());
                 } else {
                     $appraisedBy = $lvalue;
                     $this->tpl->set_var("appraisedByID", $appraisedBy);
                     $this->tpl->set_var("appraisedByName", $appraisedBy);
                 }
                 break;
             case "appraisedByDate":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("as_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("as_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("as_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->tpl->set_var($lkey, "");
                 }
                 break;
             case "recommendingApproval":
                 if (is_numeric($lvalue)) {
                     $recommendingApproval = new Person();
                     $recommendingApproval->selectRecord($lvalue);
                     $this->tpl->set_var("recommendingApprovalID", $recommendingApproval->getPersonID());
                     $this->tpl->set_var("recommendingApprovalName", $recommendingApproval->getFullName());
                 } else {
                     $recommendingApproval = $lvalue;
                     $this->tpl->set_var("recommendingApprovalID", $recommendingApproval);
                     $this->tpl->set_var("recommendingApprovalName", $recommendingApproval);
                 }
                 break;
             case "recommendingApprovalDate":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("re_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("re_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("re_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->tpl->set_var($lkey, "");
                 }
             case "approvedBy":
                 if (is_numeric($lvalue)) {
                     $approvedBy = new Person();
                     $approvedBy->selectRecord($lvalue);
                     $this->tpl->set_var("approvedByID", $approvedBy->getPersonID());
                     $this->tpl->set_var("approvedByName", $approvedBy->getFullName());
                 } else {
                     $approvedBy = $lvalue;
                     $this->tpl->set_var("approvedByID", $approvedBy);
                     $this->tpl->set_var("approvedByName", $approvedBy);
                 }
                 break;
             case "approvedByDate":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("av_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("av_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("av_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->tpl->set_var($lkey, "");
                 }
                 break;
             case "dateConstructed":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("dc_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("dc_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("dc_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateOccupied":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("do_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("do_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("do_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateCompleted":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("dm_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("dm_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("dm_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateAcquired":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("da_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("da_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("da_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateOfInstallation":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("di_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("di_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("di_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "dateOfOperation":
                 if (true) {
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue);
                     $this->tpl->set_var("do_yearValue", removePreZero($dateArr["year"]));
                     eval(MONTH_ARRAY);
                     //$monthArray
                     $this->tpl->set_var("do_month", $monthArray[removePreZero($dateArr["month"])]);
                     $this->tpl->set_var("do_dayValue", removePreZero($dateArr["day"]));
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             case "propertyID":
                 if (true) {
                     switch (get_class($value)) {
                         case "land":
                             $propertyType = "Land";
                             break;
                         case "improvementsbuildings":
                             $propertyType = "ImprovementsBuildings";
                             break;
                         case "plantstrees":
                             $propertyType = "PlantsTrees";
                             break;
                         case "machineries":
                             $propertyType = "Machineries";
                             break;
                     }
                     $this->tpl->set_var($lkey, $lvalue);
                     $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object");
                     if (!($xmlStr = $TDDetails->getTD("", $lvalue, $propertyType))) {
                         $this->tpl->set_var("tdNumber", "enter TD");
                         $this->tpl->set_var("tdID", "");
                         $this->tpl->set_var("propertyType", $propertyType);
                     } else {
                         if (!($domDoc = domxml_open_mem($xmlStr))) {
                             $this->tpl->set_var("tdNumber", "enter TD");
                             $this->tpl->set_var("tdID", "");
                             $this->tpl->set_var("propertyType", $propertyType);
                         } else {
                             $td = new TD();
                             $td->parseDomDocument($domDoc);
                             $this->tpl->set_var("tdNumber", $td->getTaxDeclarationNumber());
                             foreach ($td as $tdkey => $tdvalue) {
                                 switch ($tdkey) {
                                     case "provincialAssessor":
                                         if (is_numeric($lvalue)) {
                                             $provincialAssessor = new Person();
                                             $provincialAssessor->selectRecord($lvalue);
                                             $this->tpl->set_var("provincialAssessorID", $provincialAssessor->getPersonID());
                                             $this->tpl->set_var("provincialAssessorName", $provincialAssessor->getFullName());
                                         } else {
                                             $provincialAssessor = $lvalue;
                                             $this->tpl->set_var("provincialAssessorID", $provincialAssessor);
                                             $this->tpl->set_var("provincialAssessorName", $provincialAssessor);
                                         }
                                         break;
                                     case "provincialAssessorDate":
                                         if (true) {
                                             list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue);
                                             $this->tpl->set_var("pa_yearValue", removePreZero($dateArr["year"]));
                                             eval(MONTH_ARRAY);
                                             //$monthArray
                                             $this->tpl->set_var("pa_month", $monthArray[removePreZero($dateArr["month"])]);
                                             $this->tpl->set_var("pa_dayValue", removePreZero($dateArr["day"]));
                                         } else {
                                             $this->tpl->set_var($tdkey, "");
                                         }
                                         break;
                                     case "cityMunicipalAssessor":
                                         if (is_numeric($lvalue)) {
                                             $cityMunicipalAssessor = new Person();
                                             $cityMunicipalAssessor->selectRecord($lvalue);
                                             $this->tpl->set_var("cityMunicipalAssessorID", $cityMunicipalAssessor->getPersonID());
                                             $this->tpl->set_var("cityMunicipalAssessorName", $cityMunicipalAssessor->getFullName());
                                         } else {
                                             $cityMunicipalAssessor = $lvalue;
                                             $this->tpl->set_var("cityMunicipalAssessorID", $cityMunicipalAssessor);
                                             $this->tpl->set_var("cityMunicipalAssessorName", $cityMunicipalAssessor);
                                         }
                                         break;
                                     case "cityMunicipalAssessorDate":
                                         if (true) {
                                             list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue);
                                             $this->tpl->set_var("cm_yearValue", removePreZero($dateArr["year"]));
                                             eval(MONTH_ARRAY);
                                             //$monthArray
                                             $this->tpl->set_var("cm_month", $monthArray[removePreZero($dateArr["month"])]);
                                             $this->tpl->set_var("cm_dayValue", removePreZero($dateArr["day"]));
                                         } else {
                                             $this->tpl->set_var($tdkey, "");
                                         }
                                         break;
                                     case "enteredInRPARForBy":
                                         if (is_numeric($lvalue)) {
                                             $enteredInRPARForBy = new Person();
                                             $enteredInRPARForBy->selectRecord($lvalue);
                                             $this->tpl->set_var("enteredInRPARForByID", $enteredInRPARForBy->getPersonID());
                                             $this->tpl->set_var("enteredInRPARForByName", $enteredInRPARForBy->getFullName());
                                         } else {
                                             $enteredInRPARForBy = $lvalue;
                                             $this->tpl->set_var("enteredInRPARForByID", $enteredInRPARForBy);
                                             $this->tpl->set_var("enteredInRPARForByName", $enteredInRPARForBy);
                                         }
                                         break;
                                     default:
                                         $this->tpl->set_var($tdkey, $tdvalue);
                                 }
                             }
                         }
                     }
                 } else {
                     $this->formArray[$key] = "";
                 }
                 break;
             default:
                 $this->tpl->set_var($lkey, $lvalue);
         }
     }
 }
 function displayImprovementsBuildingsList($improvementsBuildingsList)
 {
     if (count($improvementsBuildingsList)) {
         $i = 0;
         foreach ($improvementsBuildingsList as $key => $improvementsBuildings) {
             if ($i == 0) {
                 //$this->formArray["arpNumber"] = $improvementsBuildings->getArpNumber();
                 //$this->formArray["propertyIndexNumber"] = $improvementsBuildings->getPropertyIndexNumber();
                 $this->formArray["landPIN"] = $improvementsBuildings->getLandPIN();
                 $this->displayLandPINDetails();
                 $this->formArray["foundation"] = $improvementsBuildings->getFoundation();
                 $this->formArray["windows"] = $improvementsBuildings->getWindows();
                 $this->formArray["columns"] = $improvementsBuildings->getColumnsBldg();
                 $this->formArray["stairs"] = $improvementsBuildings->getStairs();
                 $this->formArray["beams"] = $improvementsBuildings->getBeams();
                 $this->formArray["partition"] = $improvementsBuildings->getPartition();
                 $this->formArray["trussFraming"] = $improvementsBuildings->getTrussFraming();
                 $this->formArray["wallFinish"] = $improvementsBuildings->getWallFinish();
                 $this->formArray["roof"] = $improvementsBuildings->getRoof();
                 $this->formArray["electrical"] = $improvementsBuildings->getElectrical();
                 $this->formArray["exteriorWalls"] = $improvementsBuildings->getExteriorWalls();
                 $this->formArray["toiletAndBath"] = $improvementsBuildings->getToiletAndBath();
                 $this->formArray["flooring"] = $improvementsBuildings->getFlooring();
                 $this->formArray["plumbingSewer"] = $improvementsBuildings->getPlumbingSewer();
                 $this->formArray["doors"] = $improvementsBuildings->getDoors();
                 $this->formArray["fixtures"] = $improvementsBuildings->getFixtures();
                 $this->formArray["ceiling"] = $improvementsBuildings->getCeiling();
                 $this->formArray["dateConstructed"] = $improvementsBuildings->getDateConstructed();
                 $this->formArray["structuralTypes"] = $improvementsBuildings->getStructuralTypes();
                 $this->formArray["dateOccupied"] = $improvementsBuildings->getDateOccupied();
                 $this->formArray["memoranda"] = $improvementsBuildings->getMemoranda();
                 // buildingClassification
                 $improvementsBuildingsClasses = new ImprovementsBuildingsClasses();
                 if (is_numeric($improvementsBuildings->getBuildingClassification())) {
                     $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification());
                     $this->formArray["classification"] = $improvementsBuildingsClasses->getDescription();
                 } else {
                     $this->formArray["classification"] = $improvementsBuildings->getBuildingClassification();
                 }
                 $this->formArray["dateCompleted"] = $improvementsBuildings->getDateCompleted();
                 $this->formArray["bldgPermit"] = $improvementsBuildings->getBuildingPermit();
                 $this->formArray["areaOfGroundFloor"] = $improvementsBuildings->getAreaOfGroundFloor();
                 $this->formArray["buildingAge"] = $improvementsBuildings->getBuildingAge();
                 $this->formArray["totalBuildingArea"] = $improvementsBuildings->getTotalBuildingArea();
                 $this->formArray["numberOfStoreys"] = $improvementsBuildings->getNumberOfStoreys();
                 $this->formArray["cctNumber"] = $improvementsBuildings->getCctNumber();
                 // NCC Modification checked and implemented by K2 : November 18, 2005
                 // details:
                 //		commented out line 448, changed lines 451 to 455
                 //$this->formArray["bldgCore1"] = $improvementsBuildings->getBuildingCoreAndAdditionalItems();
                 $this->formArray["bldgCore1"] = number_format($improvementsBuildings->getUnitValue(), 2);
                 $this->formArray["depMarketValue"] = $improvementsBuildings->getDepreciatedMarketValue();
                 $this->formArray["marketValue"] = number_format($improvementsBuildings->getMarketValue(), 2);
                 $this->formArray["addItems"] = number_format($improvementsBuildings->getAddItems(), 2);
                 $this->formArray["subTotal"] = "";
                 $this->formArray["adjustments"] = number_format($improvementsBuildings->getMarketValue() + $improvementsBuildings->getAddItems(), 2);
                 $this->formArray["depreciationRate"] = $improvementsBuildings->getDepreciationRate();
                 $this->formArray["subTotal2"] = "";
                 $this->formArray["depreciationRate"] = $improvementsBuildings->getDepreciationRate();
                 $this->formArray["accumulatedDepreciation"] = $improvementsBuildings->getAccumulatedDepreciation();
                 if (is_a($improvementsBuildings->propertyAdministrator, Person)) {
                     if ($improvementsBuildings->propertyAdministrator->getLastName() != "") {
                         $this->formArray["administrator"] = $improvementsBuildings->propertyAdministrator->getFullName();
                     }
                     if (is_a($improvementsBuildings->propertyAdministrator->addressArray[0], "address")) {
                         $address1 = $improvementsBuildings->propertyAdministrator->addressArray[0]->getNumber();
                         if ($address1 != "") {
                             $address1 .= " ";
                         }
                         $address1 .= $improvementsBuildings->propertyAdministrator->addressArray[0]->getStreet();
                         if ($address1 != "") {
                             $address1 .= ", ";
                         }
                         $address1 .= $improvementsBuildings->propertyAdministrator->addressArray[0]->getBarangay();
                         $address2 = $improvementsBuildings->propertyAdministrator->addressArray[0]->getDistrict();
                         if ($address2 != "") {
                             $address2 .= ", ";
                         }
                         $address2 .= $improvementsBuildings->propertyAdministrator->addressArray[0]->getMunicipalityCity();
                         if ($address2 != "") {
                             $address2 .= ", ";
                         }
                         $address2 .= $improvementsBuildings->propertyAdministrator->addressArray[0]->getProvince();
                         $this->formArray["adminAddress1"] = $address1;
                         $this->formArray["adminAddress2"] = $address2;
                     }
                     $this->formArray["adminTelno"] = $improvementsBuildings->propertyAdministrator->getTelephone();
                 }
                 // recommendingApproval
                 if (is_numeric($improvementsBuildings->recommendingApproval)) {
                     $recommendingApproval = new Person();
                     $recommendingApproval->selectRecord($improvementsBuildings->recommendingApproval);
                     $this->formArray["recommendingApproval"] = $recommendingApproval->getFullName();
                     $this->recommendingApproval = $recommendingApproval->getFullName();
                 } else {
                     $recommendingApproval = $improvementsBuildings->recommendingApproval;
                     $this->formArray["recommendingApproval"] = $recommendingApproval;
                     $this->recommendingApproval = $recommendingApproval;
                 }
                 $this->formArray["dateRecommendingApproval"] = $improvementsBuildings->getRecommendingApprovalDate();
                 // approvedBy
                 if (is_numeric($improvementsBuildings->approvedBy)) {
                     $approvedBy = new Person();
                     $approvedBy->selectRecord($improvementsBuildings->approvedBy);
                     $this->formArray["approvedBy"] = $approvedBy->getFullName();
                     $this->approvedBy = $approvedBy->getFullName();
                 } else {
                     $approvedBy = $improvementsBuildings->approvedBy;
                     $this->formArray["approvedBy"] = $approvedBy;
                     $this->approvedBy = $approvedBy;
                 }
                 $this->formArray["dateApprovedBy"] = $improvementsBuildings->getApprovedByDate();
                 // appraisedBy (assessedBy)
                 if (is_numeric($improvementsBuildings->appraisedBy)) {
                     $appraisedBy = new Person();
                     $appraisedBy->selectRecord($improvementsBuildings->appraisedBy);
                     $this->formArray["assessedBy"] = $appraisedBy->getFullName();
                     $this->appraisedBy = $appraisedBy->getFullName();
                 } else {
                     $appraisedBy = $improvementsBuildings->appraisedBy;
                     $this->formArray["assessedBy"] = $appraisedBy;
                     $this->appraisedBy = $appraisedBy;
                 }
                 $this->formArray["dateAssessedBy"] = $improvementsBuildings->getAppraisedByDate();
             }
             if ($i < 4) {
                 $this->formArray["kind" . ($i + 1)] = $improvementsBuildings->getKind();
                 // actualUse
                 $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                 if (is_numeric($improvementsBuildings->getActualUse())) {
                     $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse());
                     $this->formArray["actualUse" . ($i + 1)] = $improvementsBuildingsActualUses->getDescription();
                 } else {
                     $this->formArray["actualUse" . ($i + 1)] = $improvementsBuildings->getActualUse();
                 }
                 // NCC Modification checked and implemented by K2 : November 18, 2005
                 // details:
                 //		commented out line 557, added line 558, changed "marketValue" to "depMarketValue"
                 //$this->formArray["marketValue".($i+1)] = $improvementsBuildings->getMarketValue();
                 $this->formArray["depMarketValue" . ($i + 1)] = $improvementsBuildings->getDepreciatedMarketValue();
                 $this->formArray["assessmentLevel" . ($i + 1)] = $improvementsBuildings->getAssessmentLevel();
                 $this->formArray["assessedValue" . ($i + 1)] = $improvementsBuildings->getAssessedValue();
                 $this->formArray["total"] += toFloat($this->formArray["assessedValue" . ($i + 1)]);
             }
             $i++;
         }
         // NCC Modification checked and implemented by K2 : November 18, 2005
         // details:
         //		added for() loop in lines 572 to 578 that resets values to:
         //			 "kind, actualUse, depMarketValue, assessmentLevel" and "assessedValue"
         for ($j = $i; $j < 4; $j++) {
             $this->formArray["kind" . ($j + 1)] = '';
             $this->formArray["actualUse" . ($j + 1)] = '';
             $this->formArray["depMarketValue" . ($j + 1)] = '';
             $this->formArray["assessmentLevel" . ($j + 1)] = '';
             $this->formArray["assessedValue" . ($j + 1)] = '';
         }
     }
     $this->formArray["valAdjFacTotal"] = $valAdjFacTotal;
     $this->formArray["propertyAdjMrktValTotal"] = $propertyAdjMrktValTotal;
     $this->formArray["propertyTotal"] = $propertyTotal;
 }
Beispiel #22
0
 function initMasterTreasurerList($TempVar, $tempVar)
 {
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     /*
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ."eRPTSSettingsDetails.php", "urn:Object");
     		if(!$xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1)){
     			// error xml
     		}
     		else{
     			if(!$domDoc = domxml_open_mem($xmlStr)){
     				// error domDoc
     			}
     			else{
     				$eRPTSSettings = new eRPTSSettings;
     				$eRPTSSettings->parseDomDocument($domDoc);
     				switch($tempVar){
     					case "cityTreasurer":
     						$this->tpl->set_var("id",$eRPTSSettings->getTreasurerFullName());
     						$this->tpl->set_var("name",$eRPTSSettings->getTreasurerFullName());
     				$this->formArray[$tempVar."ID"] = $this->formArray[$tempVar];
     						$this->initSelected($tempVar."ID",$eRPTSSettings->getTreasurerFullName());
     						$this->tpl->parse($TempVar."ListBlock",$TempVar."List",true);
     						break;
     				}
     			}
     		}
     */
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList(0, " WHERE " . AUTH_USER_MD5_TABLE . ".userType REGEXP '1\$' AND " . AUTH_USER_MD5_TABLE . ".status='enabled'"))) {
         // error xmlStr
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $UserRecords = new UserRecords();
             $UserRecords->parseDomDocument($domDoc);
             $list = $UserRecords->getArrayList();
             foreach ($list as $key => $user) {
                 $person = new Person();
                 $person->selectRecord($user->personID);
                 $this->tpl->set_var("id", $user->personID);
                 $this->tpl->set_var("name", $person->getFullName());
                 $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                 $this->initSelected($tempVar . "ID", $user->personID);
                 $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
             }
         }
     }
 }
Beispiel #23
0
 function initMasterSignatoryList($TempVar, $tempVar)
 {
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     // commented out: March 16, 2004:
     // recommended that approval lists come ONLY out of the Users table and not out of eRPTSSettings
     /* Begin of Comment out
     
     		$eRPTSSettingsDetails = new SoapObject(NCCBIZ."eRPTSSettingsDetails.php", "urn:Object");
     		if(!$xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1)){
     			// xml failed
     		}
     		else{
     			if(!$domDoc = domxml_open_mem($xmlStr)){
     				// error domDoc
     			}
     			else{
     				$eRPTSSettings = new eRPTSSettings;
     				$eRPTSSettings->parseDomDocument($domDoc);
     				switch($tempVar){
     					case "recommendingApproval":
     					case "approvedBy":
     
     						// provincialAssessor
     						
     						if($eRPTSSettings->getProvincialAssessorLastName()!=""){
     
     							$this->formArray["recommendingApprovalID"] = $this->formArray["recommendingApproval"];
     							$this->formArray["approvedByID"] = $this->formArray["approvedBy"];
     							$this->tpl->set_var("id",$eRPTSSettings->getAssessorFullName());
     							$this->tpl->set_var("name",$eRPTSSettings->getAssessorFullName());
     							$this->initSelected($tempVar."ID",$eRPTSSettings->getAssessorFullName());
     							$this->tpl->parse($TempVar."ListBlock",$TempVar."List",true);
     						
     							$this->formArray["recommendingApprovalID"] = $this->formArray["recommendingApproval"];
     							$this->formArray["approvedByID"] = $this->formArray["approvedBy"];						
     						
     							$this->tpl->set_var("id",$eRPTSSettings->getProvincialAssessorFullName());
     							$this->tpl->set_var("name",$eRPTSSettings->getProvincialAssessorFullName());
     
     							$this->formArray[$tempVar."ID"] = $this->formArray[$tempVar];
     							$this->initSelected($tempVar."ID",$eRPTSSettings->getProvincialAssessorFullName());
     							$this->tpl->parse($TempVar."ListBlock",$TempVar."List",true);
     						}						
     												
     						break;
     				}
     			}
     		}
     
     		*/
     // End of Comment out : March 16, 2004
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList(0, " WHERE " . AUTH_USER_MD5_TABLE . ".userType REGEXP '1\$' AND " . AUTH_USER_MD5_TABLE . ".status='enabled'"))) {
         //$this->tpl->set_var("id", "");
         //$this->tpl->set_var("name", "empty list");
         //$this->tpl->parse($TempVar."ListBlock", $TempVar."List", true);
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             //$this->tpl->set_var("", "");
             //$this->tpl->set_var("name", "empty list");
             //$this->tpl->parse($TempVar."ListBlock", $TempVar."List", true);
         } else {
             $UserRecords = new UserRecords();
             $UserRecords->parseDomDocument($domDoc);
             $list = $UserRecords->getArrayList();
             foreach ($list as $key => $user) {
                 $person = new Person();
                 $person->selectRecord($user->personID);
                 $this->tpl->set_var("id", $user->personID);
                 $this->tpl->set_var("name", $person->getFullName());
                 $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                 $this->initSelected($tempVar . "ID", $user->personID);
                 $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
             }
         }
     }
 }
Beispiel #24
0
 function selectRecord($ownerID)
 {
     if ($ownerID == "") {
         return;
     }
     $this->setDB();
     $sql = sprintf("SELECT * FROM %s WHERE ownerID=%s;", OWNER_TABLE, $ownerID);
     $this->db->query($sql);
     if ($this->db->next_record()) {
         $this->ownerID = $this->db->f("ownerID");
         $this->rptopID = $this->db->f("rptopID");
         $sql = sprintf("SELECT personID FROM %s WHERE ownerID=%s;", OWNER_PERSON_TABLE, $ownerID);
         $this->db->query($sql);
         while ($this->db->next_record()) {
             $person = new Person();
             if ($person->selectRecord($this->db->f("personID"))) {
                 $this->setPersonArray($person);
             }
         }
         $sql = sprintf("SELECT companyID FROM %s WHERE ownerID=%s;", OWNER_COMPANY_TABLE, $ownerID);
         $this->db->query($sql);
         while ($this->db->next_record()) {
             $company = new Company();
             if ($company->selectRecord($this->db->f("companyID"))) {
                 $this->setCompanyArray($company);
             }
         }
         //print_r($this);
         $this->setDomDocument();
         $ret = true;
     } else {
         $ret = false;
     }
     return $ret;
 }
Beispiel #25
0
 function displayPlantsTreesList($plantsTreesList)
 {
     $plantTotal = 0;
     if (count($plantsTreesList)) {
         $p = 0;
         foreach ($plantsTreesList as $key => $plantsTrees) {
             if ($this->pl == 0) {
                 //$this->formArray["arpNumber"] = $plantsTrees->getArpNumber();
                 //$this->formArray["propertyIndexNumber"] = $plantsTrees->getPropertyIndexNumber();
                 $this->formArray["surveyNumber"] = $plantsTrees->getSurveyNumber();
                 $this->formArray["taxability"] = $plantsTrees->getTaxability();
                 $this->formArray["effectivity"] = $plantsTrees->getEffectivity();
                 $this->formArray["memoranda"] = $plantsTrees->getMemoranda();
                 if (is_a($plantsTrees->propertyAdministrator, Person)) {
                     $this->formArray["administrator"] = $plantsTrees->propertyAdministrator->getFullName();
                     if (is_a($plantsTrees->propertyAdministrator->addressArray[0], "address")) {
                         $address1 = $plantsTrees->propertyAdministrator->addressArray[0]->getNumber();
                         $address1 .= " " . $plantsTrees->propertyAdministrator->addressArray[0]->getStreet();
                         $address1 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getBarangay();
                         $address2 = $plantsTrees->propertyAdministrator->addressArray[0]->getDistrict();
                         $address2 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getMunicipalityCity();
                         $address2 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getProvince();
                         $this->formArray["adminAddress1"] = $address1;
                         $this->formArray["adminAddress2"] = $address2;
                     }
                     $this->formArray["adminTelno"] = $plantsTrees->propertyAdministrator->getTelephone();
                 }
                 if ($this->recommendingApproval == "") {
                     if (is_numeric($plantsTrees->recommendingApproval)) {
                         $recommendingApproval = new Person();
                         $recommendingApproval->selectRecord($plantsTrees->recommendingApproval);
                         $this->formArray["recommendingApproval"] = $recommendingApproval->getFullName();
                         $this->recommendingApproval = $recommendingApproval->getFullName();
                     } else {
                         $recommendingApproval = $land->recommendingApproval;
                         $this->formArray["recommendingApproval"] = $recommendingApproval;
                         $this->recommendingApproval = $recommendingApproval;
                     }
                 }
                 $this->formArray["dateRecommendingApproval"] = $plantsTrees->getRecommendingApprovalDate();
                 if ($this->approvedBy == "") {
                     if (is_numeric($plantsTrees->approvedBy)) {
                         $approvedBy = new Person();
                         $approvedBy->selectRecord($plantsTrees->approvedBy);
                         $this->formArray["approvedBy"] = $approvedBy->getFullName();
                         $this->approvedBy = $approvedBy->getFullName();
                     } else {
                         $approvedBy = $approvedBy->recommendingApproval;
                         $this->formArray["approvedBy"] = $approvedBy;
                         $this->approvedBy = $approvedBy;
                     }
                 }
                 $this->formArray["dateApprovedBy"] = $plantsTrees->getApprovedByDate();
             }
             if ($p < 9) {
                 // productClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 if (is_numeric($plantsTrees->getProductClass())) {
                     $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                     $this->formArray["productClass" . ($p + 1)] = $plantsTreesClasses->getDescription();
                 } else {
                     $this->formArray["productClass" . ($p + 1)] = $plantsTrees->getProductClass();
                 }
                 $this->formArray["areaPlanted" . ($p + 1)] = $plantsTrees->getAreaPlanted();
                 $this->formArray["totalNumber" . ($p + 1)] = $plantsTrees->getTotalNumber();
                 $this->formArray["nonFruit" . ($p + 1)] = $plantsTrees->getNonFruitBearing();
                 $this->formArray["fruit" . ($p + 1)] = $plantsTrees->getFruitBearing();
                 $this->formArray["age" . ($p + 1)] = $plantsTrees->getAge();
                 $this->formArray["unitPrice" . ($p + 1)] = $plantsTrees->getUnitPrice();
                 $this->formArray["plantMrktVal" . ($p + 1)] = $plantsTrees->getMarketValue();
                 $plantTotal = $plantTotal + toFloat($plantsTrees->getMarketValue());
             }
             if ($this->pl < 6) {
                 $this->formArray["valAdjFacMrktVal" . ($this->pl + 1)] = $plantsTrees->getMarketValue();
                 $this->formArray["adjFacTxt" . ($this->pl + 1)] = $plantsTrees->getAdjustmentFactor();
                 $this->formArray["adjFacInt" . ($this->pl + 1)] = "P";
                 $this->formArray["adjustment" . ($this->pl + 1)] = $plantsTrees->getPercentAdjustment();
                 $this->formArray["valueAdjustment" . ($this->pl + 1)] = $plantsTrees->getValueAdjustment();
                 $this->formArray["valAdjFacAdjMrktVal" . ($this->pl + 1)] = $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["valAdjFacTotal"] = $this->formArray["valAdjFacTotal"] + toFloat($plantsTrees->getAdjustedMarketValue());
             }
             if ($this->pl < 5) {
                 $this->formArray["kind" . ($this->pl + 1)] = $plantsTrees->getKind();
                 // actualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 if (is_numeric($plantsTrees->getActualUse())) {
                     $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
                     $this->formArray["propertyActualUse" . ($this->p + 1)] = $plantsTreesActualUses->getDescription();
                 } else {
                     $this->formArray["propertyActualUse" . ($this->p + 1)] = $plantsTrees->getActualUse();
                 }
                 $this->formArray["propertyAdjMrktVal" . ($this->pl + 1)] = $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["level" . ($this->pl + 1)] = $plantsTrees->getAssessmentLevel();
                 $this->formArray["assessedValue" . ($this->pl + 1)] = $plantsTrees->getAssessedValue();
                 $this->formArray["propertyAdjMrktValTotal"] = $this->formArray["propertyAdjMrktValTotal"] + toFloat($plantsTrees->getAdjustedMarketValue());
                 $this->formArray["propertyTotal"] = $this->formArray["propertyTotal"] + toFloat($plantsTrees->getAssessedValue());
             }
             $p++;
             $this->pl++;
         }
     }
     $this->formArray["plantTotal"] = $plantTotal;
 }
Beispiel #26
0
 function displaySignatories()
 {
     // treasurer
     $person = new Person();
     $person->selectRecord($this->formArray["cityTreasurerID"]);
     $this->formArray["cityAssessor"] = $person->getFullName();
     // assessor
     $person = new Person();
     $person->selectRecord($this->formArray["cityAssessorID"]);
     $this->formArray["cityTreasurer"] = $person->getFullName();
 }
Beispiel #27
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "remove":
             //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")";
             $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
             if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) {
                 if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                     //echo "SOAP failed";
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"])));
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     //select
     $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object");
     if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) {
         exit("xml failed");
     } else {
         //echo($xmlStr);
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
             $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
         } else {
             $rptop = new RPTOP();
             $rptop->parseDomDocument($domDoc);
             //print_r($rptop);
             foreach ($rptop as $key => $value) {
                 switch ($key) {
                     case "owner":
                         //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object");
                         if (is_a($value, "Owner")) {
                             $this->formArray["ownerID"] = $rptop->owner->getOwnerID();
                             $xmlStr = $rptop->owner->domDocument->dump_mem(true);
                             if (!$xmlStr) {
                                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                 $this->tpl->set_var("OwnerListTableBlock", "");
                             } else {
                                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                                 } else {
                                     $this->displayOwnerList($domDoc);
                                 }
                             }
                         } else {
                             $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock");
                             $this->tpl->set_var("PersonListBlock", "");
                             $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
                             $this->tpl->set_var("CompanyListBlock", "");
                         }
                         break;
                     case "cityAssessor":
                         if (is_numeric($value)) {
                             $cityAssessor = new Person();
                             $cityAssessor->selectRecord($value);
                             $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID());
                             $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName());
                             $this->formArray["cityAssessorName"] = $cityAssessor->getFullName();
                         } else {
                             $cityAssessor = $value;
                             $this->tpl->set_var("cityAssessorID", $cityAssessor);
                             $this->tpl->set_var("cityAssessorName", $cityAssessor);
                             $this->formArray["cityAssessorName"] = $cityAssessor;
                         }
                         break;
                     case "cityTreasurer":
                         if (is_numeric($value)) {
                             $cityTreasurer = new Person();
                             $cityTreasurer->selectRecord($value);
                             $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID());
                             $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName());
                             $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName();
                         } else {
                             $cityTreasurer = $value;
                             $this->tpl->set_var("cityTreasurerID", $cityTreasurer);
                             $this->tpl->set_var("cityTreasurerName", $cityTreasurer);
                             $this->formArray["cityTreasurerName"] = $cityTreasurer;
                         }
                         break;
                     case "tdArray":
                         $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock");
                         $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock");
                         $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         $tdCtr = 0;
                         if (count($value)) {
                             $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                             $this->tpl->set_var("TDDBEmptyBlock", "");
                             /*
                             $this->tpl->set_block("TDList", "Land", "LandBlock");
                             $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock");
                             $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock");
                             $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock");
                             */
                             foreach ($value as $tkey => $tvalue) {
                                 //foreach($tvalue as $column => $val){
                                 //	$this->tpl->set_var($column,$val);
                                 //}
                                 $this->tpl->set_var("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("basicTax", "");
                                 $this->tpl->set_var("sefTax", "");
                                 $this->tpl->set_var("total", "");
                                 //$this->tpl->set_var("basicTax",$tvalue->getBasicTax());
                                 //$this->tpl->set_var("sefTax",$tvalue->getSefTax());
                                 //$this->tpl->set_var("total",$tvalue->getTotal());
                                 $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                                 if (!($xmlStr = $AFSDetails->getAFSForList($tvalue->getAfsID()))) {
                                     //$this->tpl->set_block("rptsTemplate", "AFSTable", "AFSTableBlock");
                                     //$this->tpl->set_var("AFSTableBlock", "afs not found");
                                 } else {
                                     //echo $xmlStr;
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         //$this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                         //$this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                                     } else {
                                         $afs = new AFS();
                                         $afs->parseDomDocument($domDoc);
                                         $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue();
                                         $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue();
                                         $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue();
                                         $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue();
                                         $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue();
                                         $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue();
                                         $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue();
                                         $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue();
                                         $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue();
                                         $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue();
                                         $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ','));
                                         $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ','));
                                     }
                                 }
                                 $this->tpl->set_var("ctr", $tdCtr);
                                 $this->tpl->parse("defaultTDListBlock", "defaultTDList", true);
                                 $this->tpl->parse("toggleTDListBlock", "toggleTDList", true);
                                 $this->tpl->parse("TDListBlock", "TDList", true);
                                 /*
                                 $this->tpl->set_var("LandBlock", "");
                                 $this->tpl->set_var("PlantsTreesBlock", "");
                                 $this->tpl->set_var("ImprovementsBuildingsBlock", "");
                                 $this->tpl->set_var("MachineriesBlock", "");
                                 */
                                 $tdCtr++;
                             }
                         } else {
                             $this->tpl->set_var("defaultTDListBlock", "//no default");
                             $this->tpl->set_var("toggleTDListBlock", "//no Toggle");
                             $this->tpl->set_var("TDListBlock", "");
                         }
                         $this->tpl->set_var("tdCtr", $tdCtr);
                         break;
                     case "landTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "landTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "plantTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "plantTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "bldgTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "bldgTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "machTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "machTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "totalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "totalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     default:
                         $this->formArray[$key] = $value;
                 }
             }
             $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"];
             $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"];
             unset($rptop);
             $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
             $rptop = new RPTOP();
             $rptop->setRptopID($this->formArray["rptopID"]);
             $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]);
             $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]);
             $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]);
             $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]);
             $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]);
             $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]);
             $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]);
             $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]);
             $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]);
             $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]);
             $rptop->setCreatedBy($this->userID);
             $rptop->setModifiedBy($this->userID);
             $rptop->setDomDocument();
             $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object");
             $rptop->setDomDocument();
             $doc = $rptop->getDomDocument();
             $xmlStr = $doc->dump_mem(true);
             //echo $xmlStr;
             if (!($ret = $RPTOPEncode->updateRPTOPtotals($xmlStr))) {
                 echo "ret=" . $ret;
             }
             //echo $ret;
         }
     }
     $this->setForm();
     $this->setPageDetailPerms();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"], "ownerID" => $this->formArray["ownerID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
 function Main()
 {
     $this->getSignatory();
     if (is_array($this->formArray["personCompanyIDArray"])) {
         $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
         foreach ($this->formArray["personCompanyIDArray"] as $personCompanyID) {
             $this->tpl->set_var("pageNumber", $this->pageNumber);
             switch ($this->formArray["ownerType"]) {
                 case "Company":
                     $company = new Company();
                     $company->selectRecord($personCompanyID);
                     $nameList = $company->getCompanyName();
                     break;
                 case "Person":
                 default:
                     $person = new Person();
                     $person->selectRecord($personCompanyID);
                     $nameList = $person->getName();
                     break;
             }
             $this->tpl->set_var("nameList", $nameList);
             $tdNumberList = "";
             $tdArray = $this->getTDArrayFromOwner($personCompanyID);
             if (is_array($tdArray)) {
                 foreach ($tdArray as $td) {
                     if ($tdNumberList != "") {
                         $tdNumberList .= "\n";
                     }
                     $tdNumberList .= $this->getTDNumberListLine($td);
                 }
             }
             $this->tpl->set_var("tdNumberList", $tdNumberList);
             $this->tpl->parse("PageBlock", "Page", true);
             $this->pageNumber++;
         }
     } else {
         exit("no owners selected");
     }
     $this->setLguDetails();
     $this->setForm();
     $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);
     }
 }
Beispiel #29
0
 function displayPlantsTreesList($plantsTreesList)
 {
     $plantTotal = 0;
     if (count($plantsTreesList)) {
         $p = 0;
         $plantitems = '';
         $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 ($plantsTreesList as $key => $plantsTrees) {
             if ($this->pl == 0) {
                 //$this->formArray["arpNumber"] = $plantsTrees->getArpNumber();
                 //$this->formArray["propertyIndexNumber"] = $plantsTrees->getPropertyIndexNumber();
                 $this->formArray["surveyNumber"] = $plantsTrees->getSurveyNumber();
                 //$this->formArray["taxability"] = $plantsTrees->getTaxability();
                 //$this->formArray["effectivity"] = $plantsTrees->getEffectivity();
                 $this->formArray["memoranda"] = $plantsTrees->getMemoranda();
                 if (is_a($plantsTrees->propertyAdministrator, Person)) {
                     $this->formArray["administrator"] = $plantsTrees->propertyAdministrator->getFullName();
                     if (is_a($plantsTrees->propertyAdministrator->addressArray[0], "address")) {
                         $address1 = $plantsTrees->propertyAdministrator->addressArray[0]->getNumber();
                         $address1 .= " " . $plantsTrees->propertyAdministrator->addressArray[0]->getStreet();
                         $address1 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getBarangay();
                         $address2 = $plantsTrees->propertyAdministrator->addressArray[0]->getDistrict();
                         $address2 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getMunicipalityCity();
                         $address2 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getProvince();
                         $this->formArray["adminAddress1"] = $address1;
                         $this->formArray["adminAddress2"] = $address2;
                     }
                     $this->formArray["adminTelno"] = $plantsTrees->propertyAdministrator->getTelephone();
                 }
                 if ($this->recommendingApproval == "") {
                     if (is_numeric($plantsTrees->recommendingApproval)) {
                         $recommendingApproval = new Person();
                         $recommendingApproval->selectRecord($plantsTrees->recommendingApproval);
                         $this->formArray["recommendingApproval"] = $recommendingApproval->getFullName();
                         $this->recommendingApproval = $recommendingApproval->getFullName();
                     } else {
                         $recommendingApproval = $land->recommendingApproval;
                         $this->formArray["recommendingApproval"] = $recommendingApproval;
                         $this->recommendingApproval = $recommendingApproval;
                     }
                 }
                 $this->formArray["dateRecommendingApproval"] = $plantsTrees->getRecommendingApprovalDate();
                 if ($this->approvedBy == "") {
                     if (is_numeric($plantsTrees->approvedBy)) {
                         $approvedBy = new Person();
                         $approvedBy->selectRecord($plantsTrees->approvedBy);
                         $this->formArray["approvedBy"] = $approvedBy->getFullName();
                         $this->approvedBy = $approvedBy->getFullName();
                     } else {
                         $approvedBy = $approvedBy->recommendingApproval;
                         $this->formArray["approvedBy"] = $approvedBy;
                         $this->approvedBy = $approvedBy;
                     }
                 }
                 $this->formArray["dateApprovedBy"] = $plantsTrees->getApprovedByDate();
             }
             if ($p < 14) {
                 $this->formArray["plantstart"] -= 17;
                 $offset = $this->formArray["plantstart"];
                 // productClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 if (is_numeric($plantsTrees->getProductClass())) {
                     $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                     $this->formArray["productClass" . ($p + 1)] = $plantsTreesClasses->getDescription();
                 } else {
                     $this->formArray["productClass" . ($p + 1)] = $plantsTrees->getProductClass();
                 }
                 $plantitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $this->formArray["productClass" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["areaPlanted" . ($p + 1)] = $plantsTrees->getAreaPlanted();
                 $plantitems .= '<textitem xpos="228" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["areaPlanted" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["totalNumber" . ($p + 1)] = $plantsTrees->getTotalNumber();
                 $plantitems .= '<textitem xpos="290" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["totalNumber" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["nonFruit" . ($p + 1)] = $plantsTrees->getNonFruitBearing();
                 $plantitems .= '<textitem xpos="342" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["nonFruit" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["fruit" . ($p + 1)] = $plantsTrees->getFruitBearing();
                 $plantitems .= '<textitem xpos="380" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["fruit" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["age" . ($p + 1)] = $plantsTrees->getAge();
                 $plantitems .= '<textitem xpos="426" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["age" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["unitPrice" . ($p + 1)] = $plantsTrees->getUnitPrice();
                 $plantitems .= '<textitem xpos="482" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["unitPrice" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["plantMrktVal" . ($p + 1)] = $plantsTrees->getMarketValue();
                 $plantitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($plantsTrees->getMarketValue(), 2) . '</textitem>' . "\r\n";
                 $plantitems .= '<lineitem x1="50" y1="' . ($offset - 6) . '" x2="550" y2="' . ($offset - 6) . '">blurb</lineitem>';
                 $plantTotal = $plantTotal + toFloat($plantsTrees->getMarketValue());
             }
             if ($this->pl < 14) {
                 if ($percadj != (double) $plantsTrees->getPercentAdjustment()) {
                     if ($markval > 0) {
                         $adjcount++;
                         $this->formArray["adjstart"] -= 16;
                         $offset = $this->formArray["adjstart"];
                         $adjitems .= '<textitem xpos="147" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($markval, 2) . '   (P)' . '</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) $plantsTrees->getPercentAdjustment();
                     $adjfact = $plantsTrees->getAdjustmentFactor();
                     $markval = 0;
                     $valuadj = 0;
                     $adjmark = 0;
                 }
                 $markval += (double) $plantsTrees->getMarketValue();
                 $valuadj += (double) $plantsTrees->getValueAdjustment();
                 $adjmark += (double) $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["valAdjFacMrktVal" . ($this->pl + 1)] = $plantsTrees->getMarketValue();
                 $this->formArray["adjFacTxt" . ($this->pl + 1)] = $plantsTrees->getAdjustmentFactor();
                 $this->formArray["adjFacInt" . ($this->pl + 1)] = "P";
                 $this->formArray["adjustment" . ($this->pl + 1)] = $plantsTrees->getPercentAdjustment();
                 $this->formArray["valueAdjustment" . ($this->pl + 1)] = $plantsTrees->getValueAdjustment();
                 $this->formArray["valAdjFacAdjMrktVal" . ($this->pl + 1)] = $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["valAdjFacTotal"] = $this->formArray["valAdjFacTotal"] + toFloat($plantsTrees->getAdjustedMarketValue());
             }
             if ($this->pl < 14) {
                 $this->formArray["kind" . ($this->pl + 1)] = $plantsTrees->getKind();
                 // actualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 //if(is_numeric($plantsTrees->getActualUse())){
                 $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
                 $this->formArray["propertyActualUse" . ($this->p + 1)] = $plantsTreesActualUses->getDescription();
                 //}
                 //else{
                 //	$this->formArray["propertyActualUse".($this->p+1)] = $plantsTrees->getActualUse();
                 //}
                 $this->formArray["propertyAdjMrktVal" . ($this->pl + 1)] = $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["level" . ($this->pl + 1)] = $plantsTrees->getAssessmentLevel();
                 $this->formArray["assessedValue" . ($this->pl + 1)] = $plantsTrees->getAssessedValue();
                 $this->formArray["propertyAdjMrktValTotal"] = $this->formArray["propertyAdjMrktValTotal"] + toFloat($plantsTrees->getAdjustedMarketValue());
                 $this->formArray["propertyTotal"] = $this->formArray["propertyTotal"] + toFloat($plantsTrees->getAssessedValue());
                 if ($summuse != $plantsTreesActualUses->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">' . 'IMPROVEMENTS' . '</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 = $plantsTreesActualUses->getDescription();
                     $summlvl = (double) $plantsTrees->getAssessmentLevel();
                     $summadj = 0;
                     $summasv = 0;
                 }
                 $summadj += (double) $plantsTrees->getAdjustedMarketValue();
                 /*
                 					$fp=fopen("/home/site/log/landfaas.txt","a");
                 					fwrite($fp,$plantsTrees->getAssessedValue());
                 					fclose($fp);
                 */
                 $summasv += (double) str_replace(",", "", $plantsTrees->getAssessedValue());
             }
             $p++;
             $this->pl++;
         }
         if ($markval > 0) {
             $adjcount++;
             $this->formArray["adjstart"] -= 16;
             $offset = $this->formArray["adjstart"];
             $adjitems .= '<textitem xpos="147" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($markval, 2) . '   (P)' . '</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">' . 'IMPROVEMENTS' . '</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 ($pp = $p; $pp < 14; $pp++) {
             $this->formArray["plantstart"] -= 17;
             $offset = $this->formArray["plantstart"];
             $plantitems .= '<lineitem x1="50" y1="' . ($offset - 6) . '" x2="550" y2="' . ($offset - 6) . '">blurb</lineitem>';
         }
         for ($ll = $adjcount; $ll < 8; $ll++) {
             $this->formArray["adjstart"] -= 16;
             $offset = $this->formArray["adjstart"];
             $adjitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>';
         }
         for ($ll = $summcount; $ll < 8; $ll++) {
             $this->formArray["summstart"] -= 16;
             $offset = $this->formArray["summstart"];
             $summitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>';
         }
         $this->formArray["adjcount"] += $adjcount;
         $this->formArray["adjitems"] .= $adjitems;
         $this->formArray["summitems"] .= $summitems;
         $this->formArray["plantitems"] = $plantitems;
     }
     $this->formArray["plantTotal"] = $plantTotal;
 }
Beispiel #30
0
 function selectRecord($propertyID)
 {
     if ($propertyID == "") {
         return;
     }
     $this->setDB();
     $sql = sprintf("SELECT * FROM  %s WHERE propertyID=%s;", LAND_TABLE, $propertyID);
     $this->db->query($sql);
     //echo $sql;
     $land = new Land();
     if ($this->db->next_record()) {
         /*
         			$this->propertyID = $this->db->f("propertyID");
         			$this->afsID = $this->db->f("afsID");
         			$this->octTctNumber = $this->db->f("octTctNumber");
         			$this->surveyNumber = $this->db->f("surveyNumber");
         			$this->north = $this->db->f("north");
         			$this->east = $this->db->f("east");
         			$this->south = $this->db->f("south");
         			$this->west = $this->db->f("west");
         			$this->boundaryDescription = $this->db->f("boundaryDescription");
         			$this->classification = $this->db->f("classification");
         			$this->subClass = $this->db->f("subClass");
         			$this->area = $this->db->f("area");
         			$this->unitValue = $this->db->f("unitValue");
         			$this->adjustmentFactor = $this->db->f("adjustmentFactor");
         			$this->percentAdjustment = $this->db->f("percentAdjustment");
         			$this->valueAdjustment = $this->db->f("valueAdjustment");
         			$this->adjustedMarketValue = $this->db->f("adjustedMarketValue");
         			$this->idle = $this->db->f("idle");
         			$this->contested = $this->db->f("contested");
         			$this->dateCreated = $this->db->f("dateCreated");
         			$this->createdBy = $this->db->f("createdBy");
         			$this->dateModified = $this->db->f("dateModified");
         			$this->modifiedBy = $this->db->f("modifiedBy");
         			//*/
         foreach ($this->db->Record as $key => $value) {
             switch ($key) {
                 case "propertyAdministrator":
                     $propertyAdministrator = new Person();
                     if ($propertyAdministrator->selectRecord($value)) {
                         $this->{$key} = $propertyAdministrator;
                     } else {
                         $this->{$key} = "";
                     }
                     break;
                 default:
                     $this->{$key} = $value;
             }
         }
         $this->setDomDocument();
         $ret = true;
     } else {
         $ret = false;
     }
     return $ret;
 }