Пример #1
0
 function generateTDHistory($tdID)
 {
     $td = new TD();
     $td->selectRecord($tdID);
     $afsID = $td->getAfsID();
     //		echo("afsID=$afsID<br>");
     $afs = new AFS();
     $afs->selectRecord($afsID);
     $odID = $afs->getOdID();
     //	echo("odID=$odID<br>");
     $condition = sprintf(" WHERE presentODID='%s' ", fixQuotes($odID));
     $odHistoryRecords = new ODHistoryRecords();
     $odHistoryRecords->selectRecords($condition);
     if (count($odHistoryRecords->arrayList) > 0) {
         //	echo("count>0<br>");
         foreach ($odHistoryRecords->arrayList as $key => $odHistory) {
             $previousODID = $odHistory->getPreviousODID();
             $presentODID = $odHistory->getPresentODID();
             $previousAFS = new AFS();
             $previousAFS->selectRecord($afsID = "", $limit = "", $previousODID);
             $previousAFSID = $previousAFS->getAfsID();
             $previousTD = new TD();
             $previousTD->selectRecord($tdID = "", $previousAFSID);
             $previousTDID = $previousTD->getTdID();
             $this->tdHistory[] = $previousTD;
             $this->generateTDHistory($previousTDID);
         }
     } else {
         //echo("count==0<br>");
         return false;
     }
 }
Пример #2
0
 function displayRecords()
 {
     $this->selectRecords();
     $this->tpl->set_block("rptsTemplate", "OwnerPersonList", "OwnerPersonListBlock");
     $this->tpl->set_block("OwnerPersonList", "ODList", "ODListBlock");
     foreach ($this->arrayList as $person) {
         $this->tpl->set_var("personID", $person->getPersonID());
         $this->tpl->set_var("lastName", $person->getLastName());
         $this->tpl->set_var("firstName", $person->getFirstName());
         $this->tpl->set_var("middleName", $person->getMiddleName());
         $this->tpl->set_var("gender", $person->getGender());
         $this->tpl->set_var("birthday", $person->getBirthday());
         $this->tpl->set_var("maritalStatus", $person->getMaritalStatus());
         $this->tpl->set_var("tin", $person->getTin());
         $this->tpl->set_var("telephone", $person->getTelephone());
         $this->tpl->set_var("mobileNumber", $person->getMobileNumber());
         $this->tpl->set_var("email", $person->getEmail());
         if (is_array($person->addressArray)) {
             $address = $person->addressArray[0];
             $this->tpl->set_var("address", $address->getFullAddress());
         }
         // capture OD, AFS, and TD info
         $this->setDB();
         $sql = sprintf("SELECT DISTINCT(Owner.odID) as odID" . " FROM Owner,OwnerPerson " . " WHERE " . " Owner.ownerID = OwnerPerson.ownerID AND " . " OwnerPerson.personID = '%s' ", $person->getPersonID());
         $this->db->query($sql);
         while ($this->db->next_record()) {
             $od = new OD();
             if ($od->selectRecord($this->db->f("odID"))) {
                 $this->ODArray[] = $od;
                 $this->tpl->set_var("odID", $od->getOdID());
                 if (is_object($od->locationAddress)) {
                     $this->tpl->set_var("locationAddress", $od->locationAddress->getFullAddress());
                 } else {
                     $this->tpl->set_var("locationAddress", "");
                 }
                 $afs = new AFS();
                 if ($afs->selectRecord("", "", $od->getOdID(), "")) {
                     $this->tpl->set_var("afsID", $afs->getAfsID());
                     $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber());
                     $this->tpl->set_var("arpNumber", $afs->getArpNumber());
                     if (is_array($afs->landArray)) {
                         $this->displayLandList($afs->landArray);
                     }
                     if (is_array($afs->plantsTreesArray)) {
                         $this->displayPlantsTreesList($afs->plantsTreesArray);
                     }
                     if (is_array($afs->improvementsBuildingsArray)) {
                         $this->displayImprovementsBuildingsList($afs->improvementsBuildingsArray);
                     }
                     if (is_array($afs->machineriesArray)) {
                         $this->displayMachineriesList($afs->machineriesArray);
                     }
                     $td = new TD();
                     if ($td->selectRecord("", $afs->getAfsID(), "", "", "")) {
                         $this->tpl->set_var("tdID", $td->getTdID());
                         $this->tpl->set_var("taxDeclarationNumber", $td->getTaxDeclarationNumber());
                         $this->tpl->set_var("propertyType", $td->getPropertyType());
                     }
                 }
                 unset($td);
                 unset($afs);
                 unset($od);
                 $this->tpl->parse("ODListBlock", "ODList", true);
             }
         }
         $this->tpl->parse("OwnerPersonListBlock", "OwnerPersonList", true);
         $this->tpl->set_var("ODListBlock", "");
         $this->clearPropertyElements();
         unset($this->ODArray);
         unset($this->AFSArray);
         unset($this->TDArray);
         unset($this->db);
     }
 }
Пример #3
0
 function getTDListOf($id, $type, $year)
 {
     $owner = new Owner();
     //echo("\$ownerIDArray = \$owner->selectOwner".$type."(".$id.");");
     eval("\$ownerIDArray = \$owner->selectOwner" . $type . "(" . $id . ");");
     if ($ownerIDArray) {
         $odArray = "";
         foreach ($ownerIDArray as $key => $value) {
             eval("\$odID = \$owner->selectOD" . $type . "({$value});");
             if ($odID) {
                 $odArray[] = $odID;
             }
         }
         unset($owner);
         if ($odArray) {
             $afsArray = "";
             foreach ($odArray as $key => $value) {
                 $afs = new AFS();
                 $afsIDArray[] = $afs->checkAfsID($value);
             }
             unset($afs);
             if ($afsIDArray) {
                 $tdRecords = new TDRecords();
                 $tdIDArray = "";
                 foreach ($afsIDArray as $tkey => $tvalue) {
                     $td = new TD();
                     if ($td->selectRecord("", $tvalue, "", "", $year)) {
                         $tdIDArray[] = $td->getTdID();
                     }
                     unset($td);
                     /*
                     						$afs = new AFS;
                     						$afs->selectRecord($tvalue);
                     						//print_r($afs);
                     						//echo "<br>";
                     						$landArray = $afs->getLandArray();
                     						$plantsTreesArray = $afs->getPlantsTreesArray();
                     						$improvementsBuildingsArray = $afs->getImprovementsBuildingsArray();
                     						$machineriesArray = $afs->getMachineriesArray();
                     						unset($afs);
                     						if ($landArray){
                     							foreach($landArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"Land",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($plantsTreesArray){
                     							foreach($plantsTreesArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"PlantsTrees",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($improvementsBuildingsArray){
                     							foreach($improvementsBuildingsArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"ImprovementsBuildings",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($machineriesArray){
                     							foreach($machineriesArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"Machineries",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}*/
                 }
                 $ret = $tdIDArray;
                 //print_r($tdRecords->getArrayList());
                 /*if ($tdRecords->getArrayList()){
                 			$tdRecords->setDomDocument();
                 			if(!$domDoc = $tdRecords->getDomDocument()){
                 				return $ret = false;
                 			}
                 			else {
                 				$xmlStr = $domDoc->dump_mem(true);
                 				return $ret = $xmlStr;
                 			}
                 		}
                 		else $ret = false;*/
             } else {
                 $ret = false;
             }
         } else {
             $ret = false;
         }
     } else {
         $ret = false;
     }
     return $ret;
 }
Пример #4
0
 function refreshTDHistory($td)
 {
     $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
     if ($this->formArray["odID"] = $ODDetails->getOdIDFromTdID($td->getTdID())) {
         $ODHistoryList = new SoapObject(NCCBIZ . "ODHistoryList.php", "urn:Object");
         $ODHistoryRecords = new ODHistoryRecords();
         if (!($xmlStr = $ODHistoryList->getPrecedingODList($this->formArray["odID"]))) {
             // do nothing. no preceding OD
             return false;
         } else {
             if (!($domDoc = domxml_open_mem($xmlStr))) {
                 // no nothing. no preceding OD
             } else {
                 $ODHistoryRecords->parseDomDocument($domDoc);
                 $precedingODList = $ODHistoryRecords->arrayList;
                 $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
                 $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                 $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object");
                 foreach ($precedingODList as $key => $odHistory) {
                     $previousODID = $odHistory->getPreviousODID();
                     $previousAFSID = $AFSEncode->getAfsID($previousODID);
                     $previousAFSxml = $AFSDetails->getAfs($previousAFSID);
                     $previousAFSdomDoc = domxml_open_mem($previousAFSxml);
                     $previousAFS = new AFS();
                     $previousAFS->parseDomDocument($previousAFSdomDoc);
                     $precedingTDxml = $TDDetails->getTDFromAfsID($previousAFSID);
                     $precedingTDdomDoc = domxml_open_mem($precedingTDxml);
                     $precedingTD = new TD();
                     $precedingTD->parseDomDocument($precedingTDdomDoc);
                     // capture DUES of precedingTD
                     $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object");
                     if (!($xmlStr = $DueList->getDueList($precedingTD->getTdID(), $this->formArray["taxableYear"] - 1))) {
                         // no Dues for precedingTD
                         //echo "no dues";
                     } else {
                         if (!($domDoc = domxml_open_mem($xmlStr))) {
                             // no Dues for precedingTD
                             //echo "no dues";
                         } else {
                             $dueRecords = new DueRecords();
                             $dueRecords->parseDomDocument($domDoc);
                             foreach ($dueRecords->getArrayList() as $due) {
                                 foreach ($due as $dueKey => $dueValue) {
                                     switch ($dueKey) {
                                         case "dueType":
                                             $dueArray[$dueValue] = $due;
                                             break;
                                     }
                                 }
                             }
                             $BacktaxTDDetails = new SoapObject(NCCBIZ . "BacktaxTDDetails.php", "urn:Object");
                             $BacktaxTDEncode = new SoapObject(NCCBIZ . "BacktaxTDEncode.php", "urn:Object");
                             if (!($xmlStr = $BacktaxTDDetails->getBacktaxTD($td->getTdID(), $this->formArray["taxableYear"] - 1))) {
                                 // backtax for Due does not exist, create backtax record
                                 $backtaxTD = $this->setBacktaxTDFromDueArray($td->getTdID(), "", $dueArray, $precedingTD, $previousAFS);
                                 $backtaxTD->setDomDocument();
                                 $backtaxTDDoc = $backtaxTD->getDomDocument();
                                 $backtaxTDXmlStr = $backtaxTDDoc->dump_mem(true);
                                 if (!($backtaxTDID = $BacktaxTDEncode->saveBacktaxTD($backtaxTDXmlStr))) {
                                     echo "Error saving BacktaxTD";
                                 }
                             } else {
                                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                                     // backtax for Due does not exist, create backtax
                                     $backtaxTD = $this->setBacktaxTDFromDueArray($td->getTdID(), "", $dueArray, $precedingTD, $previousAFS);
                                     $backtaxTD->setDomDocument();
                                     $backtaxTDDoc = $backtaxTD->getDomDocument();
                                     $backtaxTDXmlStr = $backtaxTDDoc->dump_mem(true);
                                     if (!($backtaxTDID = $BacktaxTDEncode->saveBacktaxTD($backtaxTDXmlStr))) {
                                         echo "Error saving BacktaxTD";
                                     }
                                 } else {
                                     // update backtax record from Due
                                     $backtaxTD = new BacktaxTD();
                                     $backtaxTD->parseDomDocument($domDoc);
                                     $backtaxTD = $this->setBacktaxTDFromDueArray($td->getTdID(), $backtaxTD->getBacktaxTDID(), $dueArray, $precedingTD, $previousAFS);
                                     $backtaxTD->setDomDocument();
                                     $backtaxTDDoc = $backtaxTD->getDomDocument();
                                     $backtaxTDXmlStr = $backtaxTDDoc->dump_mem(true);
                                     if (!($backtaxTDID = $BacktaxTDEncode->updateBacktaxTD($backtaxTDXmlStr))) {
                                         echo "Error updating BacktaxTD";
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Пример #5
0
 function getTDIDArrayFromParentTDID($presentTDID)
 {
     $presentTD = new TD();
     $presentTD->selectRecord($presentTDID);
     $presentAfsID = $presentTD->getAfsID();
     $presentAFS = new AFS();
     $presentAFS->selectRecord($presentAFSID);
     $presentODID = $presentAFS->getOdID();
     $odHistoryRecords = new ODHistoryRecords();
     $odHistoryRecords->selectPrecOD($presentODID);
     if (is_array($odHistoryRecords->arrayList)) {
         foreach ($odHistoryRecords as $odID) {
             $afs = new AFS();
             $afs->selectRecord("", "", $odID);
             $afsID = $afs->getAfsID();
             $td = new TD();
             $td->selectRecord("", $afsID);
             $tdID = $td->getTdID();
             $tdIDArray[] = $tdID;
         }
         if (is_array($tdIDArray)) {
             return $tdIDArray;
         }
     }
     return false;
 }
Пример #6
0
 function getTDListOf($id, $type, $year)
 {
     $owner = new Owner();
     eval("\$ownerIDArray = \$owner->selectOwner" . $type . "(" . $id . ");");
     if ($ownerIDArray) {
         $odArray = "";
         foreach ($ownerIDArray as $key => $value) {
             eval("\$odID = \$owner->selectOD" . $type . "({$value});");
             if ($odID) {
                 $odArray[] = $odID;
             }
         }
         unset($owner);
         if ($odArray) {
             $afsArray = "";
             foreach ($odArray as $key => $value) {
                 $afs = new AFS();
                 $odHistoryRecords = new OdHistoryRecords();
                 $afsID = $afs->checkAFSYear($value, $year);
                 $odHistoryArr = $odHistoryRecords->selectSuccOD($value, $year);
                 if ($odHistoryArr) {
                     $latestAfs = true;
                     foreach ($odHistoryArr as $k => $v) {
                         if ($afs->checkAFSYear($v, $year)) {
                             $latestAfs = false;
                         }
                     }
                     if ($latestAfs) {
                         $afsIDArray[] = $afsID;
                     }
                 } else {
                     if ($afsID != "") {
                         $afsIDArray[] = $afsID;
                     }
                 }
             }
             unset($afs);
             if ($afsIDArray) {
                 $tdRecords = new TDRecords();
                 $tdIDArray = "";
                 foreach ($afsIDArray as $tkey => $tvalue) {
                     $td = new TD();
                     if ($td->selectRecord("", $tvalue)) {
                         // added the following if($td->getArchive()!="true") line on September 10, 2005 to..
                         // ..omit 'cancelled' TDs and other TDs that went through a transaction in..
                         // ..creating new RPTOPs.
                         if ($td->getArchive() != "true") {
                             $tdIDArray[] = $td->getTdID();
                         }
                     }
                     unset($td);
                 }
                 $ret = $tdIDArray;
             } else {
                 $ret = false;
             }
         } else {
             $ret = false;
         }
     } else {
         $ret = false;
     }
     return $ret;
 }
Пример #7
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");
 }
Пример #8
0
 function getTDListOf($id, $type, $year)
 {
     echo "<br><br>" . $year . "-" . $id;
     $owner = new Owner();
     //echo("\$ownerIDArray = \$owner->selectOwner".$type."(".$id.");");
     eval("\$ownerIDArray = \$owner->selectOwner" . $type . "(" . $id . ");");
     echo "<br>ownerIDArray - ";
     print_r($ownerIDArray);
     if ($ownerIDArray) {
         $odArray = "";
         foreach ($ownerIDArray as $key => $value) {
             eval("\$odID = \$owner->selectOD" . $type . "({$value});");
             if ($odID) {
                 $odArray[] = $odID;
             }
         }
         echo "<br>odArray - ";
         print_r($odArray);
         unset($owner);
         if ($odArray) {
             $afsArray = "";
             foreach ($odArray as $key => $value) {
                 $afs = new AFS();
                 $odHistoryRecords = new OdHistoryRecords();
                 $afsID = $afs->checkAFSYear($value, $year);
                 $afs->selectRecord("", "", $value);
                 //print_r($value);
                 $odHistoryArr = $odHistoryRecords->selectSuccOD($value, $year);
                 if ($odHistoryArr) {
                     $latestAfs = true;
                     foreach ($odHistoryArr as $k => $v) {
                         if ($afs->checkAFSYear($v, $year)) {
                             $latestAfs = false;
                         }
                         echo "<br>latestAfs = " . $latestAfs . "<br>odID = " . $v . "<br>year" . $year . " - " . $afs->getEffectivity();
                     }
                     if ($latestAfs) {
                         $afsIDArray[] = $afsID;
                     }
                 } else {
                     if ($afsID != "") {
                         $afsIDArray[] = $afsID;
                     }
                 }
                 //if ($latesAfs) $afsIDArray[] = $afsID;
             }
             echo "<br>afsIDArray - ";
             print_r($afsIDArray);
             unset($afs);
             if ($afsIDArray) {
                 $tdRecords = new TDRecords();
                 $tdIDArray = "";
                 foreach ($afsIDArray as $tkey => $tvalue) {
                     $td = new TD();
                     //echo $tvalue;
                     if ($td->selectRecord("", $tvalue)) {
                         //echo $td->getTdID();
                         $tdIDArray[] = $td->getTdID();
                     }
                     unset($td);
                     /*
                     						$afs = new AFS;
                     						$afs->selectRecord($tvalue);
                     						//print_r($afs);
                     						//echo "<br>";
                     						$landArray = $afs->getLandArray();
                     						$plantsTreesArray = $afs->getPlantsTreesArray();
                     						$improvementsBuildingsArray = $afs->getImprovementsBuildingsArray();
                     						$machineriesArray = $afs->getMachineriesArray();
                     						unset($afs);
                     						if ($landArray){
                     							foreach($landArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"Land",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($plantsTreesArray){
                     							foreach($plantsTreesArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"PlantsTrees",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($improvementsBuildingsArray){
                     							foreach($improvementsBuildingsArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"ImprovementsBuildings",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($machineriesArray){
                     							foreach($machineriesArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"Machineries",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}*/
                 }
                 //print_r($tdIDArray);
                 $ret = $tdIDArray;
                 //print_r($tdRecords->getArrayList());
                 /*if ($tdRecords->getArrayList()){
                 			$tdRecords->setDomDocument();
                 			if(!$domDoc = $tdRecords->getDomDocument()){
                 				return $ret = false;
                 			}
                 			else {
                 				$xmlStr = $domDoc->dump_mem(true);
                 				return $ret = $xmlStr;
                 			}
                 		}
                 		else $ret = false;*/
             } else {
                 $ret = false;
             }
         } else {
             $ret = false;
         }
     } else {
         $ret = false;
     }
     return $ret;
 }