public function testPlayingWithManyAssertions()
 {
     /*
      * Typically, an assertion will look like this:
      *
      * $this->assert<Something>($expected, $actual, $message);
      *     $expected: What the value *should* be.
      *     $actual: What the value *actually* is.
      *     $message: Text to display if the assertion fails.
      */
     $this->assertEquals(4, 2 + 2, 'Uh oh! Someone forgot how to add.');
     /*
      * The $message is optional. If excluded, a sane default is used.
      * In this case: "Failed asserting that an array contains $needle."
      */
     $this->assertContains(2, [1, 2, 3]);
     // For most "assert<Something>", there's also an "assertNot<Something>"
     $this->assertNotContains(4, [1, 2, 3]);
     /*
      * You can test "Equality" or "Identity" ("==" vs. "===")
      *
      * So, integer 123 is equal to string '123', but they're not *the same*.
      */
     $this->assertSame(123, 123);
     $this->assertNotSame(123, '123');
     // Sometimes, you don't need the $expected either.
     $this->assertTrue(true);
     $this->assertEmpty(null);
     $this->assertFileExists(__FILE__);
     /*
      * Using variables in your assertions can help make your tests less brittle.
      *
      * If you need to change your test data, you need only do it in one place,
      * rather than looking through your test to change it everywhere.
      */
     $person = new Person('Michael', 'Moussa');
     $this->assertSame('Michael Moussa', $person->getFullName());
     // vs
     $firstName = 'Michael';
     $lastName = 'Moussa';
     $person = new Person($firstName, $lastName);
     $this->assertSame($firstName . ' ' . $lastName, $person->getFullName());
     /*
      * You can "get away" with only ever using a single assertion (assertTrue), but using
      * all of them makes your tests more expressive, easier to read, and easier to debug.
      */
     $string = 'foobar';
     $suffix = 'bar';
     $this->assertTrue(substr($string, 0 - strlen($suffix)) === $suffix);
     // vs
     $this->assertStringEndsWith($suffix, $string);
     /*
      * There are MANY more assertions. Check them out!
      * http://phpunit.de/manual/current/en/appendixes.assertions.html
      */
 }
Exemple #2
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);
     }
 }
Exemple #3
0
/**
 * Returns a birthday iCalendar event.
 * If there is no date for the event, or the person is not alive, no iCalendar event will be returned
 * @param Person $indi The Person Object
 * @return the birthday iCalendar event.
 */
function getIndiBDIcalEvent($indi)
{
    if ($indi->isDead()) {
        return;
    }
    $birthDate = $indi->getBirthDate();
    if (!$birthDate->isOK()) {
        return;
    }
    $summary = $indi->getFullName() . "'s Birthday";
    $place = $indi->getBirthPlace();
    $description = "Born on " . $birthDate->Display(false) . ($place == "" ? "" : "in " . $place) . "\n" . encode_url($indi->getAbsoluteLinkUrl());
    $iCalRecord = getIcalRecord($birthDate, $summary, $description, encode_url($indi->getAbsoluteLinkUrl()));
    return $iCalRecord;
}
Exemple #4
0
 public function testFullNameIncludesMiddleInitial()
 {
     $person = new Person('Michael', 'Moussa', 'P');
     $this->assertSame('Michael P. Moussa', $person->getFullName());
 }
Exemple #5
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");
 }
<?php

// inheritance.php
require_once "app_autoload.php";
$person = new Person("Zachary", "Cameron Lynch");
echo $person->getFullName() . "<br>";
echo "<hr>";
$employee = new Employee("Donald", "Adam", "Cameron", 17);
echo $employee->getFullName() . "<br>";
echo "<hr>";
Exemple #7
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);
             }
         }
     }
 }
Exemple #8
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);
             }
         }
     }
 }
    public function getFullName()
    {
        return parent::getFullname() . implode(',', $this->skills);
    }
}
//$this - ссылка на текущщий объект. Работает только в контексте объекта
$person = new Person();
$person->firstname = 'Popkin';
$person->lastname = 'Piska';
echo $person->firstname;
echo $person->lastname;
$person->age = 150;
var_dump($person);
$persond = new Person('Piska', 'Popkin', 'Zhopkin');
$person3 = new Developer('Pi2ska', 'Pop2kin', 'Zhop2kin', ['php', 'javascript']);
echo $persond->getFullName();
echo $person3->getFullName();
var_dump($persond);
var_dump($person3);
class Foo
{
    protected static $prop = 'Foo';
    public static function get()
    {
        echo static::$prop;
        //        Если бы тут был self то наследуемый класс тоже давал бы Foo
    }
}
class Bar extends Foo
{
    protected static $prop = 'Bar';
Exemple #11
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");
 }
Exemple #12
0
<?php

include 'Person.php';
$andy = new Person('Andy', 'Fischoff');
$andy->email = '*****@*****.**';
$andy->gender = 'male';
$andy->sayHello();
echo "<br><br>";
$bobby = new Person('Bobby', 'Brown');
$bobby->email = '*****@*****.**';
$bobby->gender = 'male';
echo $bobby->getFullName() . '<br>';
$bobby->sayHello();
Exemple #13
0
 function Main()
 {
     $this->formArray['currentDate'] = date("F d, Y");
     $MunicipalityCityDetails = new SoapObject(NCCBIZ . "MunicipalityCityDetails.php", "urn:Object");
     #test values
     //$this->formArray['municipalityCityID']=1;
     if (!($xmlStr = $MunicipalityCityDetails->getMunicipalityCityDetails($this->formArray['municipalityCityID']))) {
         #echo($xmlStr);
         //exit("xml failed for municipality");
         header("Location: " . $this->sess->url("ViewSOA.php") . "&status=2");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             echo "error xmlDoc";
         } else {
             $MunicipalityCity = new MunicipalityCity();
             $MunicipalityCity->parseDomDocument($domDoc);
             $this->formArray['municipality'] = $MunicipalityCity->getDescription();
         }
     }
     #test values
     //$this->formArray['ownerID']=5;
     #echo("ownerID=".$this->formArray['ownerID']."<br>");
     //			$this->displayOwnerList($this->formArray['ownerID']);
     #test values
     //$this->formArray["rptopID"]=15;
     if ($this->formArray['personID'] != "") {
         $person = new Person();
         $person->selectRecord($this->formArray['personID']);
         $this->tpl->set_var(ownerName, $person->getFullName());
         $this->tpl->set_var(ownerNo, $person->getTin());
         $address = $person->addressArray[0];
         $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince());
         $db = new DB_RPTS();
         $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['personID'];
         $db->query($sql);
     } else {
         $company = new Company();
         $company->selectRecord($this->formArray['companyID']);
         $this->tpl->set_var(ownerName, $company->getCompanyName());
         $this->tpl->set_var(ownerNo, $company->getCompanyID());
         $address = $company->addressArray[0];
         $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince());
         $db = new DB_RPTS();
         $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['companyID'];
         $db->query($sql);
     }
     /*$person = new Person();
     		$person->selectRecord($this->formArray['personID']);
     		$this->tpl->set_var(ownerName,$person->getFullName());
     		$this->tpl->set_var(ownerNo,$person->getTin());
     		$address = $person->addressArray[0];
     		$this->tpl->set_var(ownerAddress,$address->getNumber() ." ".$address->getStreet()." ".$address->getBarangay()." ".$address->getDistrict()." ".$address->getMunicipalitycity()." ".$address->getProvince());
     		$db = new DB_RPTS();
     
     		$sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=".$this->formArray['personID'];
     		$db->query($sql);*/
     $this->tpl->set_block("rptsTemplate", "ROW", "RowBlk");
     for ($i = 0; $db->next_record(); $i++) {
         $rptopID = $db->f("rptopID");
         $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object");
         if (!($xmlStr = $RPTOPDetails->getRPTOP($rptopID))) {
             //	exit("xml failed for RPTOP");
             header("Location: " . $this->sess->url("ViewSOA.php") . "&status=1");
         } else {
             //echo $xmlStr;
             if (!($domDoc = domxml_open_mem($xmlStr))) {
                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                 $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
             } else {
                 $rptop = new RPTOP();
                 $td = new TD();
                 $rptop->parseDomDocument($domDoc);
                 foreach ($rptop as $key => $value) {
                     $this->formArray['payableYear'] = $rptop->getTaxableYear();
                     $rptopID = $rptop->getRptopID();
                     if ($key == "tdArray") {
                         $tdCtr = 0;
                         if (count($value)) {
                             foreach ($value as $tkey => $tvalue) {
                                 $td->selectRecord($tvalue->getTdID());
                                 $assessedValue = number_format($td->getAssessedValue(), 2, ".", "");
                                 $propertyType = $td->getPropertyType();
                                 $TaxDeclarationNumber = $td->getTaxDeclarationNumber();
                                 //										$this->tpl->set_var(kind,$propertyType);
                                 //										$this->tpl->set_var(currentTDNo,$TaxDeclarationNumber);
                                 /*									$dues = new Dues();
                                 									$dues->create($td->getTdID(), "","","","2003");
                                 									$this->tpl->set_var(basic,$dues->getBasic());
                                 									$totBasic += $dues->getBasic();
                                 									$this->tpl->set_var(sef,$dues->getSEF());
                                 									$totSEF += $dues->getSEF();
                                 									$this->tpl->set_var(total,$dues->getSEF()+$dues->getBasic());
                                 									$totTaxDue += $dues->getSEF()+$dues->getBasic();*/
                                 $afsID = $td->getAfsID();
                                 $afs = new AFS();
                                 $afs->selectRecord($afsID);
                                 $od = new OD();
                                 $od->selectRecord($afs->getOdID());
                                 $addr = $od->getLocationAddress();
                                 if (count($addr)) {
                                     $location = $addr->getFullAddress();
                                     //												$this->tpl->set_var(location,$addr->getFullAddress());
                                     $munCityID = $addr->getMunicipalityCityID();
                                     //											if($munCityID == $this->formArray['municipalityCityID'])
                                     //												$this->tpl->set_var(municipality,$addr->getMunicipalityCity());
                                 }
                                 if (count($afs->landArray)) {
                                     foreach ($afs->landArray as $afsKey => $afsValue) {
                                         $actualUse = $afsValue->getActualUse();
                                         $landActualUses = new LandActualUses();
                                         $landActualUses->selectRecord($actualUse);
                                         //$this->tpl->set_var("class",$landActualUses->getCode());
                                         $Code = $landActualUses->getCode();
                                     }
                                 }
                                 if (count($afs->improvementsBuildingsArray)) {
                                     foreach ($afs->improvementsBuildingsArray as $afsKey => $afsValue) {
                                         $actualUse = $afsValue->getActualUse();
                                         $improvementsBuildingsActualUses = new improvementsBuildingsActualUses();
                                         $improvementsBuildingsActualUses->selectRecord($actualUse);
                                         //$this->tpl->set_var("class",$improvementsBuildingsActualUses->getCode());
                                         $Code = $improvementsBuildingsActualUses->getCode();
                                     }
                                 }
                                 //echo $afs->get
                                 //											echo $munCityID ."==". $this->formArray['municipalityCityID']."<br>";
                                 if ($munCityID == $this->formArray['municipalityCityID']) {
                                     $this->tpl->set_var(location, $location);
                                     $this->tpl->set_var("class", $Code);
                                     $this->tpl->set_var(kind, $propertyType);
                                     $this->tpl->set_var(currentTDNo, $TaxDeclarationNumber);
                                     $this->tpl->set_var(municipality, $addr->getMunicipalityCity());
                                     $dues = new Dues();
                                     $dues->create($td->getTdID(), "", "", "", "2003");
                                     $totTaxDue += $dues->getSEF() + $dues->getBasic();
                                     $basic = number_format($dues->getBasic(), "2", ".", "");
                                     $this->tpl->set_var(basic, $basic);
                                     $totBasic += $basic;
                                     $sef = number_format($dues->getSEF(), "2", ".", "");
                                     $this->tpl->set_var(sef, $sef);
                                     $totSEF += number_format($sef, "2", ".", "");
                                     $this->tpl->set_var(total, number_format($sef + $basic, "2", ".", ""));
                                     $this->tpl->set_var(marketValue, number_format($afs->getTotalMarketValue(), 2));
                                     $totMarketValue += $afs->getTotalMarketValue();
                                     $this->tpl->set_var(assessedValue, number_format($afs->getTotalAssessedValue(), 2));
                                     $totAssessedValue += $afs->getTotalAssessedValue();
                                     $pIndexNo = $afs->getPropertyIndexNumber();
                                     if ($pIndexNo == "") {
                                         $pIndexNo = "No value specified";
                                     }
                                     $this->tpl->set_var(pin, $pIndexNo);
                                     //echo $afs->getTotalMarketValue();
                                     /*									if(count($afs->landArray)){
                                     										foreach($afs->landArray as $afsKey => $afsValue){
                                     											$this->tpl->set_var(pin,$afsValue->getPropertyIndexNumber());
                                     										}
                                     								}							
                                     */
                                     $this->tpl->parse("RowBlk", "ROW", true);
                                 }
                                 //else{
                                 //											$this->tpl->set_var("RowBlk","");
                                 //								}
                             }
                             #end foreach($value)
                         }
                         #end if coun value
                         $this->tpl->set_var(totalMarketValue, number_format($totMarketValue, 2));
                         $this->tpl->set_var(totalAssessedValue, number_format($totAssessedValue, 2));
                         $this->tpl->set_var(totalBasic, number_format($totBasic, 2));
                         $this->tpl->set_var(totalSEF, number_format($totSEF, 2));
                         $this->tpl->set_var(totalTaxDue, number_format($totTaxDue, 2));
                     }
                 }
             }
             //				$this->tpl->parse("RowBlk","ROW",true);
         }
     }
     //		$owner
     /*		$RPTOPDetails = new SoapObject(NCCBIZ."RPTOPDetails.php", "urn:Object");
     		if (!$xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"])){
     			//exit("xml failed for RPTOP");
     			header("Location: ".$this->sess->url("ViewSOA.php")."&status=1");
     		}
     		else{
     			//echo $xmlStr;
     			if(!$domDoc = domxml_open_mem($xmlStr)) {
     				$this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
     				$this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
     			}
     			else {
     				$rptop = new RPTOP;
     				$td = new TD();
     				$rptop->parseDomDocument($domDoc);
     				$status_report = "";
     				foreach($rptop as $key => $value){
     					$this->formArray['payableYear'] = $rptop->getTaxableYear();
     					$rptopID = $rptop->getRptopID();
     					if($key=="tdArray"){
     						$tdCtr = 0;
     							if (count($value)){	
     							$this->tpl->set_block("rptsTemplate","ROW","RowBlk");	
     								foreach($value as $tkey => $tvalue){			
     									$td->selectRecord($tvalue->getTdID());
     
     									$assessedValue = number_format($td->getAssessedValue(),2,".","");
     									$propertyType = $td->getPropertyType();
     									$TaxDeclarationNumber = $td->getTaxDeclarationNumber();
     									//$tdCtr++;
     									$this->tpl->set_var(kind,$propertyType);
     									$this->tpl->set_var(currentTDNo,$TaxDeclarationNumber);
     
     /*									$dues = new Dues();
     									$dues->create($td->getTdID(), "","","","2003");
     									$this->tpl->set_var(basic,$dues->getBasic());
     									$totBasic += $dues->getBasic();
     									$this->tpl->set_var(sef,$dues->getSEF());
     									$totSEF += $dues->getSEF();
     									$this->tpl->set_var(total,$dues->getSEF()+$dues->getBasic());
     									$totTaxDue += $dues->getSEF()+$dues->getBasic();*/
     /*								$afsID = $td->getAfsID();
     									$afs = new AFS();
     									$afs->selectRecord($afsID);
     									$od = new OD();
     									$od->selectRecord($afs->getOdID());
     									$addr = $od->getLocationAddress();
     									if(count($addr)){
     									$this->tpl->set_var(location,$addr->getFullAddress());
     									$munCityID = $addr->getMunicipalityCityID();
     										if($munCityID == $this->formArray['municipalityCityID'])
     										$this->tpl->set_var(municipality,$addr->getMunicipalityCity());
     									}
     									if(count($afs->landArray)){
     										foreach($afs->landArray as $afsKey => $afsValue){
     											$actualUse = $afsValue->getActualUse();
     											$landActualUses = new LandActualUses();
     											$landActualUses->selectRecord($actualUse);
     											$this->tpl->set_var("class",$landActualUses->getCode());
     										}
     									}
     									if(count($afs->improvementsBuildingsArray)){
     										foreach($afs->improvementsBuildingsArray as $afsKey => $afsValue){
     											$actualUse = $afsValue->getActualUse();
     											$improvementsBuildingsActualUses = new improvementsBuildingsActualUses();
     											$improvementsBuildingsActualUses->selectRecord($actualUse);
     											$this->tpl->set_var("class",$improvementsBuildingsActualUses->getCode());
     										}
     									}
     									//echo $afs->get
     
     									if($munCityID == $this->formArray['municipalityCityID']){
     									$dues = new Dues();
     									$dues->create($td->getTdID(), "","","","2003");
     									$this->tpl->set_var(basic,number_format($dues->getBasic(),"2",".",""));
     									$totBasic += $dues->getBasic();
     									$this->tpl->set_var(sef,number_format($dues->getSEF(),"2",".",""));
     									$totSEF += $dues->getSEF();
     									$this->tpl->set_var(total,number_format($dues->getSEF()+$dues->getBasic(),"2",".",""));
     									$pIndexNo = $afs->getPropertyIndexNumber();
     									if($pIndexNo==""){
     										$pIndexNo = "No value specified";	
     									}
     									$this->tpl->set_var(pin,$pIndexNo);
     									
     									$this->tpl->set_var(marketValue,$afs->getTotalMarketValue());
     									$totMarketValue += $afs->getTotalMarketValue();
     									$this->tpl->set_var(assessedValue,$afs->getTotalAssessedValue());
     									$totAssessedValue += $afs->getTotalAssessedValue();																
     									//echo $afs->getTotalMarketValue();
     /*									if(count($afs->landArray)){
     										foreach($afs->landArray as $afsKey => $afsValue){
     											$this->tpl->set_var(pin,$afsValue->getPropertyIndexNumber());
     										}
     									}							
     */
     /*								$this->tpl->parse("RowBlk","ROW",true);
     								}else{
     								$this->tpl->set_var("RowBlk","");
     								}
     								}#end foreach($value)						
     							}#end if coun value
     
     //				$this->tpl->set_block("rptsTemplate","STAT",sBlk);
     //				$this->tpl->set_var(status_report,$status_report);
     //				$this->tpl->parse(sBlk,"STAT",true);
     							
     							$this->tpl->set_var(totalMarketValue,$totMarketValue);
     							$this->tpl->set_var(totalAssessedValue,$totAssessedValue);
     							$this->tpl->set_var(totalBasic,$totBasic);
     							$this->tpl->set_var(totalSEF,$totSEF);
     							$this->tpl->set_var(totalTaxDue,$totTaxDue);
     					}
     				}
     				
     			}
     		}*/
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Exemple #14
0
 function Main()
 {
     $this->formArray['currentDate'] = date("F d, Y");
     $MunicipalityCityDetails = new SoapObject(NCCBIZ . "MunicipalityCityDetails.php", "urn:Object");
     #test values
     //$this->formArray['municipalityCityID']=1;
     if (!($xmlStr = $MunicipalityCityDetails->getMunicipalityCityDetails($this->formArray['municipalityCityID']))) {
         #echo($xmlStr);
         exit("xml failed for municipality");
         //header("Location: ".$this->sess->url("ViewSOA.php")."&status=2");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             echo "error xmlDoc";
         } else {
             $MunicipalityCity = new MunicipalityCity();
             $MunicipalityCity->parseDomDocument($domDoc);
             $this->formArray['municipality'] = $MunicipalityCity->getDescription();
         }
     }
     if ($this->formArray['personID'] != "") {
         $person = new Person();
         $person->selectRecord($this->formArray['personID']);
         $this->tpl->set_var(ownerName, $person->getFullName());
         $this->tpl->set_var(ownerNo, $person->getTin());
         $address = $person->addressArray[0];
         if (is_object($address)) {
             $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince());
         } else {
             $this->tpl->set_var(ownerAddress, "");
         }
         $db = new DB_RPTS();
         $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['personID'];
         $db->query($sql);
     } else {
         $company = new Company();
         $company->selectRecord($this->formArray['companyID']);
         $this->tpl->set_var(ownerName, $company->getCompanyName());
         $this->tpl->set_var(ownerNo, $company->getCompanyID());
         $address = $company->addressArray[0];
         $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince());
         $db = new DB_RPTS();
         $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['companyID'];
         $db->query($sql);
     }
     $ypos = 325;
     $this->tpl->set_block("rptsTemplate", "ROW", "RowBlk");
     for ($i = 0; $db->next_record(); $i++) {
         $rptopID = $db->f("rptopID");
         $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object");
         if (!($xmlStr = $RPTOPDetails->getRPTOP($rptopID))) {
             //	exit("xml failed for RPTOP");
             header("Location: " . $this->sess->url("ViewSOA.php") . "&status=1");
         } else {
             //echo $xmlStr;
             if (!($domDoc = domxml_open_mem($xmlStr))) {
                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                 $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
             } else {
                 $rptop = new RPTOP();
                 $td = new TD();
                 $rptop->parseDomDocument($domDoc);
                 foreach ($rptop as $key => $value) {
                     $this->formArray['payableYear'] = $rptop->getTaxableYear();
                     $rptopID = $rptop->getRptopID();
                     if ($key == "tdArray") {
                         $tdCtr = 0;
                         if (count($value)) {
                             foreach ($value as $tkey => $tvalue) {
                                 $td->selectRecord($tvalue->getTdID());
                                 $assessedValue = number_format($td->getAssessedValue(), 2, ".", "");
                                 $propertyType = $td->getPropertyType();
                                 $TaxDeclarationNumber = $td->getTaxDeclarationNumber();
                                 $afsID = $td->getAfsID();
                                 $afs = new AFS();
                                 $afs->selectRecord($afsID);
                                 $od = new OD();
                                 $od->selectRecord($afs->getOdID());
                                 $addr = $od->getLocationAddress();
                                 if (count($addr)) {
                                     $location = strtoupper($addr->getNumber() . " " . substr($addr->getBarangay(), 0, 4) . " " . substr($addr->getMunicipalityCity(), 0, 3) . " " . substr($addr->getProvince(), 0, 3));
                                     $munCityID = $addr->getMunicipalityCityID();
                                 }
                                 if (count($afs->landArray)) {
                                     foreach ($afs->landArray as $afsKey => $afsValue) {
                                         $actualUse = $afsValue->getActualUse();
                                         $landActualUses = new LandActualUses();
                                         $landActualUses->selectRecord($actualUse);
                                         $Code = $landActualUses->getCode();
                                     }
                                 }
                                 if (count($afs->improvementsBuildingsArray)) {
                                     foreach ($afs->improvementsBuildingsArray as $afsKey => $afsValue) {
                                         $actualUse = $afsValue->getActualUse();
                                         $improvementsBuildingsActualUses = new improvementsBuildingsActualUses();
                                         $improvementsBuildingsActualUses->selectRecord($actualUse);
                                         $Code = $improvementsBuildingsActualUses->getCode();
                                     }
                                 }
                                 if ($munCityID == $this->formArray['municipalityCityID']) {
                                     $this->tpl->set_var(location, $location);
                                     $this->tpl->set_var("class", $Code);
                                     $this->tpl->set_var(kind, strtoupper(substr($propertyType, 0, 4)));
                                     $this->tpl->set_var(currentTDNo, $TaxDeclarationNumber);
                                     $this->tpl->set_var(municipality, $addr->getMunicipalityCity());
                                     //$dues = new Dues();
                                     //$dues->create($td->getTdID(),"2003");
                                     //$totTaxDue += $dues->getSEF()+$dues->getBasic();
                                     $dues = new Dues($tvalue->getTdID(), $rptop->getTaxableYear(), $assessedValue);
                                     $paymentPeriod = $dues->getPaymentMode();
                                     $totalTaxDue = $dues->getPaidBasic($paymentPeriod) + $dues->getPaidSEF($paymentPeriod) + $dues->getPaidIdle($paymentPeriod);
                                     if ($dues->getAmnesty()) {
                                         $dues->setPctPenalty(0.0);
                                     } else {
                                         $totalTaxDue += $dues->getPenalty($paymentPeriod);
                                     }
                                     if ($dues->getIsDiscount()) {
                                         $taxDue->setDiscount($totalTaxDue);
                                         $totalTaxDue -= $dues->getDiscount();
                                     }
                                     $interest = $dues->getPctPenalty();
                                     if ($interest > 0 && $paymentPeriod != "Annual") {
                                         $paymentPeriod = "Annual";
                                     }
                                     $basic = number_format($dues->getPaidBasic(), "2", ".", "");
                                     $this->tpl->set_var(basic, $basic);
                                     $totBasic += $basic;
                                     $sef = number_format($dues->getPaidSEF(), "2", ".", "");
                                     $this->tpl->set_var(sef, $sef);
                                     $totSEF += number_format($sef, "2", ".", "");
                                     $this->tpl->set_var(total, number_format($sef + $basic, "2", ".", ""));
                                     $this->tpl->set_var(marketValue, number_format($afs->getTotalMarketValue(), 2));
                                     $totMarketValue += $afs->getTotalMarketValue();
                                     $this->tpl->set_var(assessedValue, number_format($afs->getTotalAssessedValue(), 2));
                                     $totAssessedValue += $afs->getTotalAssessedValue();
                                     $pIndexNo = $afs->getPropertyIndexNumber();
                                     if ($pIndexNo == "") {
                                         $pIndexNo = "No value specified";
                                     }
                                     $ypos = $ypos - 10;
                                     $this->tpl->set_var(ypos, $ypos);
                                     $this->tpl->set_var(pin, $pIndexNo);
                                     $this->tpl->parse("RowBlk", "ROW", true);
                                 }
                             }
                             #end foreach($value)
                         }
                         #end if coun value
                         $this->tpl->set_var(totalMarketValue, number_format($totMarketValue, 2));
                         $this->tpl->set_var(totalAssessedValue, number_format($totAssessedValue, 2));
                         $this->tpl->set_var(totalBasic, number_format($totBasic, 2));
                         $this->tpl->set_var(totalSEF, number_format($totSEF, 2));
                         $this->tpl->set_var(totalTaxDue, number_format($totalTaxDue, 2));
                     }
                 }
             }
         }
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url(""));
     /*		$this->tpl->parse("templatePage", "rptsTemplate");
     		$this->tpl->finish("templatePage");
     		$this->tpl->p("templatePage");
     */
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $rptrpdf = new PDFWriter();
     $rptrpdf->setOutputXML($this->tpl->get('templatePage'), "string");
     $rptrpdf->writePDF("viewSOA.pdf");
 }
 function 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["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();
                 // 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();
                 $this->formArray["bldgCore1"] = $improvementsBuildings->getBuildingCoreAndAdditionalItems();
                 $this->formArray["addItems"] = "";
                 $this->formArray["subTotal"] = "";
                 $this->formArray["adjustments"] = "";
                 $this->formArray["depreciationRate"] = $improvementsBuildings->getDepreciationRate();
                 $this->formArray["subTotal2"] = "";
                 $this->formArray["depreciationRate"] = $improvementsBuildings->getDepreciationRate();
                 $this->formArray["accumulatedDepreciation"] = $improvementsBuildings->getAccumulatedDepreciation();
                 if (is_a($improvementsBuildings->propertyAdministrator, Person)) {
                     $this->formArray["administrator"] = $improvementsBuildings->propertyAdministrator->getFullName();
                     if (is_a($improvementsBuildings->propertyAdministrator->addressArray[0], "address")) {
                         $address1 = $improvementsBuildings->propertyAdministrator->addressArray[0]->getNumber();
                         $address1 .= " " . $improvementsBuildings->propertyAdministrator->addressArray[0]->getStreet();
                         $address1 .= ", " . $improvementsBuildings->propertyAdministrator->addressArray[0]->getBarangay();
                         $address2 = $improvementsBuildings->propertyAdministrator->addressArray[0]->getDistrict();
                         $address2 .= ", " . $improvementsBuildings->propertyAdministrator->addressArray[0]->getMunicipalityCity();
                         $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
                 $improvementsBuildingsClasses = new ImprovementsBuildingsClasses();
                 if (is_numeric($improvementsBuildings->getActualUse())) {
                     $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getActualUse());
                     $this->formArray["actualUse" . ($i + 1)] = $improvementsBuildingsClasses->getDescription();
                 } else {
                     $this->formArray["actualUse" . ($i + 1)] = $improvementsBuildings->getActualUse();
                 }
                 $this->formArray["marketValue" . ($i + 1)] = $improvementsBuildings->getMarketValue();
                 $this->formArray["assessmentLevel" . ($i + 1)] = $improvementsBuildings->getAssessmentLevel();
                 $this->formArray["assessedValue" . ($i + 1)] = $improvementsBuildings->getAssessedValue();
             }
             $i++;
         }
     }
     $this->formArray["landTotal"] = $landTotal;
     $this->formArray["valAdjFacTotal"] = $valAdjFacTotal;
     $this->formArray["propertyAdjMrktValTotal"] = $propertyAdjMrktValTotal;
     $this->formArray["propertyTotal"] = $propertyTotal;
 }
Exemple #16
0
<?php

class Person
{
    public $firstName;
    public $lastName;
    public function __construct($firstName, $lastName)
    {
        $this->firstName = $firstName;
        $this->lastName = $lastName;
    }
    public function getFullName()
    {
        return $this->firstName . " " . $this->lastName;
    }
}
$cameron = new Person('Cameron', 'Holland');
echo $cameron->firstName;
echo $cameron->getFullName();
$ben = new PErson('Ben', 'Batschelet');
echo "Howdy, " . $ben->firstName;
Exemple #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);
             }
         }
     }
 }
Exemple #18
0
<?php

// person.php
require_once "app.php";
$boy = new Person("Zachary", "Cameron Lynch");
echo "Name: " . $boy->getFullName() . "<br>";
echo "Population: " . Person::getPopulation();
echo "<hr>";
$dad = new Person("Adam", "Cameron");
echo "Name: " . $dad->getFullName() . "<br>";
echo "Population: " . Person::getPopulation();
echo "<hr>";
$grandDad = new Person("Donald", "Cameron");
echo "Name: " . $grandDad->getFullName() . "<br>";
echo "Population: " . Person::$population;
echo "<hr>";
Exemple #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");
 }
Exemple #20
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;
 }
 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;
 }
Exemple #22
0
 function getFullName()
 {
     $person = new Person();
     $person->selectRecord($this->personID);
     return $person->getFullName();
 }
Exemple #23
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;
 }
Exemple #24
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);
         }
     }
 }
Exemple #25
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);
                 }
         }
     }
 }
Exemple #26
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);
             }
         }
     }
 }
 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;
 }
Exemple #28
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();
 }
Exemple #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;
 }
 /**
  * print information for a name record
  *
  * Called from the individual information page
  * @see individual.php
  * @param Event $event the event object
  */
 function print_name_record(&$event)
 {
     global $pgv_lang, $factarray, $UNDERLINE_NAME_QUOTES, $NAME_REVERSE;
     global $lang_short_cut, $LANGUAGE;
     if (!$event->canShowDetails()) {
         return false;
     }
     $factrec = $event->getGedComRecord();
     $linenum = $event->getLineNumber();
     $this->name_count++;
     print "<td valign=\"top\"";
     if (preg_match("/PGV_OLD/", $factrec) > 0) {
         print " class=\"namered\"";
     }
     if (preg_match("/PGV_NEW/", $factrec) > 0) {
         print " class=\"nameblue\"";
     }
     print ">";
     if (!preg_match("/^2 (SURN)|(GIVN)/m", $factrec)) {
         $dummy = new Person($factrec);
         $dummy->setPrimaryName(0);
         echo '<span class="label">', $pgv_lang['name'], ': </span><br />';
         echo PrintReady($dummy->getFullName()), '<br />';
     }
     $ct = preg_match_all("/\n2 (\\w+) (.*)/", $factrec, $nmatch, PREG_SET_ORDER);
     for ($i = 0; $i < $ct; $i++) {
         $fact = trim($nmatch[$i][1]);
         if ($fact != "SOUR" && $fact != "NOTE") {
             if ($fact == "_AKAN" || $fact == "_AKA" || $fact == "ALIA") {
                 // Allow special processing for different languages
                 $func = "fact_AKA_localisation_{$lang_short_cut[$LANGUAGE]}";
                 if (function_exists($func)) {
                     // Localise the AKA fact
                     $func($fact, $this->pid);
                 }
             }
             print "\n\t\t\t<span class=\"label\">";
             if (isset($pgv_lang[$fact])) {
                 print $pgv_lang[$fact];
             } else {
                 if (isset($factarray[$fact])) {
                     print $factarray[$fact];
                 } else {
                     print $fact;
                 }
             }
             print ":</span><span class=\"field\"> ";
             if (isset($nmatch[$i][2])) {
                 $name = trim($nmatch[$i][2]);
                 $name = preg_replace("'/,'", ",", $name);
                 $name = preg_replace("'/'", " ", $name);
                 if ($UNDERLINE_NAME_QUOTES) {
                     $name = preg_replace('/"([^"]*)"/', '<span class="starredname">\\1</span>', $name);
                 }
                 $name = preg_replace('/(\\S*)\\*/', '<span class="starredname">\\1</span>', $name);
                 print PrintReady($name);
             }
             print " </span><br />";
         }
     }
     if ($this->total_names > 1 && !$this->isPrintPreview() && $this->userCanEdit() && !strpos($factrec, 'PGV_OLD')) {
         print "&nbsp;&nbsp;&nbsp;<a href=\"javascript:;\" class=\"font9\" onclick=\"edit_name('" . $this->pid . "', " . $linenum . "); return false;\">" . $pgv_lang["edit_name"] . "</a> | ";
         print "<a class=\"font9\" href=\"javascript:;\" onclick=\"delete_record('" . $this->pid . "', " . $linenum . "); return false;\">" . $pgv_lang["delete_name"] . "</a>\n";
         if ($this->name_count == 2) {
             print_help_link("delete_name_help", "qm");
         }
         print "<br />\n";
     }
     $ct = preg_match("/\\d (NOTE)|(SOUR)/", $factrec);
     if ($ct > 0) {
         // -- find sources for this name
         print "<div class=\"indent\">";
         print_fact_sources($factrec, 2);
         //-- find the notes for this name
         print "&nbsp;&nbsp;&nbsp;";
         print_fact_notes($factrec, 2);
         print "</div><br />";
     }
     print "</td>\n";
 }