Example #1
0
 function Main()
 {
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->formArray["mergeBasketArray"] = explode(",", $this->formArray["mergeBasketCSV"]);
     if (is_array($this->formArray["mergeBasketArray"])) {
         $this->tpl->set_block("rptsTemplate", "NoODList", "NoODListBlock");
         $this->tpl->set_var("NoODListBlock", "");
         $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock");
         $this->tpl->set_var("totalInMergeBasket", count($this->formArray["mergeBasketArray"]));
         foreach ($this->formArray["mergeBasketArray"] as $odID) {
             $od = new OD();
             $od->selectRecord($odID);
             $owner = $od->owner;
             $ownerStr = "";
             if (is_array($owner->personArray)) {
                 foreach ($owner->personArray as $pKey => $pValue) {
                     $ownerArray[] = $pValue->getFullName();
                 }
             }
             if (is_array($owner->companyArray)) {
                 foreach ($owner->companyArray as $cKey => $cValue) {
                     $ownerArray[] = $cValue->getCompanyName();
                 }
             }
             if (is_object($od->locationAddress)) {
                 $this->tpl->set_var("locationAddress", $od->locationAddress->getFullAddress());
             } else {
                 $this->tpl->set_var("locationAddress", "");
             }
             $this->tpl->set_var("landArea", number_format($od->getLandArea(), 2, '.', ','));
             $this->tpl->set_var("odID", $od->getOdID());
             if (is_array($ownerArray)) {
                 $this->tpl->set_var("ownerName", implode(",", $ownerArray));
             } else {
                 $this->tpl->set_var("ownerName", "");
             }
             $afs = new AFS();
             $afs->selectRecord("", "", $odID, "");
             if (is_object($afs)) {
                 if ($afs->getPropertyIndexNumber() != "") {
                     $propertyIndexNumber = $afs->getPropertyIndexNumber();
                 } else {
                     $propertyIndexNumber = "";
                 }
             }
             $this->tpl->set_var("propertyIndexNumber", $propertyIndexNumber);
             $this->tpl->parse("ODListBlock", "ODList", true);
             unset($ownerArray);
         }
     } else {
         $this->tpl->set_block("rptsTemplate", "ShowODList", "ShowODListBlock");
         $this->tpl->set_var("ShowODListBlock", "");
         $this->tpl->set_var("totalInMergeBasket", 0);
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
 function displaySucceedingOD()
 {
     $ODHistoryList = new SoapObject(NCCBIZ . "ODHistoryList.php", "urn:Object");
     if (!($xmlStr = $ODHistoryList->getSucceedingODList($this->formArray["odID"]))) {
         $this->tpl->set_var("succeedingARPNumber", "");
         $this->tpl->set_var("succeedingUpdateCode", "");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var("succeedingARPNumber", "");
             $this->tpl->set_var("succeedingUpdateCode", "");
         } else {
             $odHistoryRecords = new ODHistoryRecords();
             $odHistoryRecords->parseDomDocument($domDoc);
             $arrayList = $odHistoryRecords->getArrayList();
             if (count($arrayList)) {
                 $value = $arrayList[0];
                 $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
                 if (!($xmlStr = $ODDetails->getOD($value->getPresentODID()))) {
                     $this->tpl->set_var("succeedingARPNumber", "");
                     $this->tpl->set_var("succeedingUpdateCode", "");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_var("succeedingARPNumber", "");
                         $this->tpl->set_var("succeedingUpdateCode", "");
                     } else {
                         $succeedingOD = new OD();
                         $succeedingOD->parseDomDocument($domDoc);
                         $succeedingODID = $succeedingOD->getOdID();
                         $succeedingAFS = $this->getAFSDetails($succeedingODID);
                         $this->tpl->set_var("succeedingARPNumber", $succeedingAFS->getARPNumber());
                         $this->tpl->set_var("succeedingUpdateCode", $value->getTransactionCode());
                     }
                 }
             }
         }
     }
 }
Example #3
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);
     }
 }
Example #4
0
 function displaySucceedingOD()
 {
     $ODHistoryList = new SoapObject(NCCBIZ . "ODHistoryList.php", "urn:Object");
     if (!($xmlStr = $ODHistoryList->getSucceedingODList($this->formArray["odID"]))) {
         $this->tpl->set_block("rptsTemplate", "SucceedingODList", "SucceedingODListBlock");
         $this->tpl->set_var("SucceedingODListBlock", "");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "SucceedingODList", "SucceedingODListBlock");
             $this->tpl->set_var("SucceedingODListBlock", "");
         } else {
             $odHistoryRecords = new ODHistoryRecords();
             $odHistoryRecords->parseDomDocument($domDoc);
             $arrayList = $odHistoryRecords->getArrayList();
             if (count($arrayList)) {
                 $this->tpl->set_block("rptsTemplate", "SucceedingODDBEmpty", "SucceedingODDBEmptyBlock");
                 $this->tpl->set_var("SucceedingODDBEmptyBlock", "");
                 $this->tpl->set_block("rptsTemplate", "SucceedingODList", "SucceedingODListBlock");
                 $this->tpl->set_block("SucceedingODList", "SucceedingODPersonList", "SucceedingODPersonListBlock");
                 $this->tpl->set_block("SucceedingODList", "SucceedingODCompanyList", "SucceedingODCompanyListBlock");
                 foreach ($arrayList as $key => $value) {
                     $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
                     if (!($xmlStr = $ODDetails->getOD($value->getPresentODID()))) {
                         // error xml
                     } else {
                         if (!($domDoc = domxml_open_mem($xmlStr))) {
                             // error domdoc
                         } else {
                             $succeedingOD = new OD();
                             $succeedingOD->parseDomDocument($domDoc);
                             $this->tpl->set_var("odID", $succeedingOD->getOdID());
                             $this->tpl->set_var("transactionCode", $value->getTransactionCode());
                             $oValue = $succeedingOD->owner;
                             $pOwnerStr = "";
                             if (count($oValue->personArray)) {
                                 foreach ($oValue->personArray as $pKey => $pValue) {
                                     $this->tpl->set_var("personID", $pValue->getPersonID());
                                     $this->tpl->set_var("OwnerPerson", $pValue->getFullName());
                                     $this->tpl->parse("SucceedingODPersonListBlock", "SucceedingODPersonList", true);
                                 }
                             }
                             if (count($oValue->companyArray)) {
                                 foreach ($oValue->companyArray as $cKey => $cValue) {
                                     $this->tpl->set_var("companyID", $cValue->getCompanyID());
                                     $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName());
                                     $this->tpl->parse("SucceedingODCompanyListBlock", "SucceedingODCompanyList", true);
                                 }
                             }
                             if (count($oValue->personArray) || count($oValue->companyArray)) {
                                 $this->tpl->set_var("none", "");
                             } else {
                                 $this->tpl->set_var("none", "none");
                             }
                             if ($succeedingOD->locationAddress != "") {
                                 $this->tpl->set_var("locationAddress", $succeedingOD->locationAddress->getFullAddress());
                             }
                             $this->tpl->set_var("landArea", number_format($succeedingOD->getLandArea(), 2, '.', ','));
                         }
                     }
                     $this->tpl->set_var("odID", $value->getPresentODID());
                     $this->tpl->parse("SucceedingODListBlock", "SucceedingODList", true);
                     $this->tpl->set_var("SucceedingODPersonListBlock", "");
                     $this->tpl->set_var("SucceedingODCompanyListBlock", "");
                 }
             }
         }
     }
 }
 function getTDArrayFromCompany($companyID)
 {
     $this->setDB();
     $sql = sprintf("SELECT DISTINCT(Owner.odID) as odID" . " FROM Owner,OwnerCompany " . " WHERE " . " Owner.ownerID = OwnerCompany.ownerID AND " . " OwnerCompany.companyID = '%s' ", $companyID);
     $this->db->query($sql);
     while ($this->db->next_record()) {
         $od = new OD();
         if ($od->selectRecord($this->db->f("odID"))) {
             $this->ODArray[] = $od;
             $afs = new AFS();
             if ($afs->selectRecord("", "", $od->getOdID(), "")) {
                 $td = new TD();
                 if ($td->selectRecord("", $afs->getAfsID(), "", "", "")) {
                     $tdArray[] = $td;
                 }
             }
         }
     }
     if (!is_array($tdArray)) {
         $tdArray = false;
     }
     return $tdArray;
 }
 function displayPrecedingOD()
 {
     $ODHistoryList = new SoapObject(NCCBIZ . "ODHistoryList.php", "urn:Object");
     if (!($xmlStr = $ODHistoryList->getPrecedingODList($this->formArray["odID"]))) {
         $this->tpl->set_var("precedingUpdateCode", "");
         $this->tpl->set_var("precedingARPNumber", "");
         $this->tpl->set_var("precedingAssessedValue", "");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var("precedingUpdateCode", "");
             $this->tpl->set_var("precedingARPNumber", "");
             $this->tpl->set_var("precedingAssessedValue", "");
         } else {
             $odHistoryRecords = new ODHistoryRecords();
             $odHistoryRecords->parseDomDocument($domDoc);
             $arrayList = $odHistoryRecords->getArrayList();
             if (count($arrayList)) {
                 $value = $arrayList[0];
                 $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
                 if (!($xmlStr = $ODDetails->getOD($value->getPreviousODID()))) {
                     $this->tpl->set_var("precedingUpdateCode", "");
                     $this->tpl->set_var("precedingARPNumber", "");
                     $this->tpl->set_var("precedingAssessedValue", "");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_var("precedingUpdateCode", "");
                         $this->tpl->set_var("precedingARPNumber", "");
                         $this->tpl->set_var("precedingAssessedValue", "");
                     } else {
                         $precedingOD = new OD();
                         $precedingOD->parseDomDocument($domDoc);
                         $precedingODID = $precedingOD->getOdID();
                         $precedingAFS = $this->getAFSDetails($precedingODID);
                         $this->tpl->set_var("precedingUpdateCode", $value->getTransactionCode());
                         $this->tpl->set_var("precedingARPNumber", $precedingAFS->getARPNumber());
                         $this->tpl->set_var("precedingAssessedValue", number_format($precedingAFS->getTotalAssessedValue(), 2, ".", ","));
                         // get previous owner of Auctioned property
                         $owner = $precedingOD->owner;
                         if (is_array($owner->personArray)) {
                             foreach ($owner->personArray as $p) {
                                 $ownerNamesArray[] = $p->getLastName() . ", " . $p->getFirstName() . " " . substr($p->getMiddleName(), 0, 1) . ".";
                             }
                         }
                         if (is_array($owner->companyArray)) {
                             foreach ($owner->companyArray as $c) {
                                 $ownerNamesArray[] = $c->getCompanyName();
                             }
                         }
                         if (is_array($ownerNamesArray)) {
                             $ownerNamesString = implode("<br>", $ownerNamesArray);
                             unset($ownerNamesArray);
                             $this->tpl->set_var("ownerNames", $ownerNamesString);
                         } else {
                             $this->tpl->set_var("ownerNames", "");
                         }
                     }
                 }
             }
         }
     }
 }