Beispiel #1
0
 function getOwnerNames($ownerID)
 {
     $ownerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
     if (!($xmlStr = $ownerList->getOwnerList($ownerID))) {
         return "";
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             return "";
         } else {
             $ownerRecords = new OwnerRecords();
             $ownerRecords->parseDomDocument($domDoc);
             $list = $ownerRecords->getArrayList();
             $ownerNames = "";
             foreach ($list as $owner) {
                 if (is_array($owner->getPersonArray())) {
                     $personArray = $owner->getPersonArray();
                     foreach ($personArray as $person) {
                         if ($ownerNames != "") {
                             $ownerNames .= ", ";
                         }
                         $ownerNames .= $person->getFullName();
                     }
                 }
                 if (is_array($owner->getCompanyArray())) {
                     $companyArray = $owner->getCompanyArray();
                     foreach ($companyArray as $company) {
                         if ($ownerNames != "") {
                             $ownerNames .= ", ";
                         }
                         $ownerNames .= $company->getCompanyName();
                     }
                 }
             }
             return $ownerNames;
         }
     }
 }
Beispiel #2
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "remove":
             if (count($this->formArray["landID"])) {
                 //print_r($this->formArray["landID"]);
                 $LandList = new SoapObject(NCCBIZ . "LandList.php", "urn:Object");
                 if (!($deletedRows = $LandList->removeLand($this->formArray["landID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["plantsTreesID"])) {
                 //print_r($this->formArray["plantsTreesID"]);
                 $PlantsTreesList = new SoapObject(NCCBIZ . "PlantsTreesList.php", "urn:Object");
                 if (!($deletedRows = $PlantsTreesList->removePlantsTrees($this->formArray["plantsTreesID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["machineriesID"])) {
                 //print_r($this->formArray["machineriesID"]);
                 $MachineriesList = new SoapObject(NCCBIZ . "MachineriesList.php", "urn:Object");
                 if (!($deletedRows = $MachineriesList->removeMachineries($this->formArray["machineriesID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["improvementsBuildingsID"])) {
                 //print_r($this->formArray["improvementsBuildingsID"]);
                 $ImprovementsBuildingsList = new SoapObject(NCCBIZ . "ImprovementsBuildingsList.php", "urn:Object");
                 if (!($deletedRows = $ImprovementsBuildingsList->removeImprovementsBuildings($this->formArray["improvementsBuildingsID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["storeyID"])) {
                 //print_r($this->formArray["storeyID"]);
                 $StoreyList = new SoapObject(NCCBIZ . "StoreyList.php", "urn:Object");
                 if (!($deletedRows = $StoreyList->removeStorey($this->formArray["storeyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: AFSDetails.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
     if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
         $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);
             //print_r($afs);
             foreach ($afs as $key => $value) {
                 $this->formArray[$key] = $value;
                 $this->formArray["totalMarketValue"] = 0;
                 $this->formArray["totalAssessedValue"] = 0;
             }
             // RPU Identification Numbers
             $this->displayRPUIdentification($afs);
             $landList = $afs->getLandArray();
             $plantsTreesList = $afs->getPlantsTreesArray();
             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
             $machineriesList = $afs->getMachineriesArray();
             if (count($landList)) {
                 $hideTD = false;
                 $this->formArray["propertyType"] = "Land";
                 $this->displayLandPlantsTrees($landList, $plantsTreesList);
                 $this->hideProperty('ImprovementsBuildings', 'improvementsBuildings');
                 $this->hideProperty('Machineries', 'machineries');
             } else {
                 if (count($plantsTreesList)) {
                     $hideTD = false;
                     $this->formArray["propertyType"] = "Land";
                     $this->displayLandPlantsTrees($landList, $plantsTreesList);
                     $this->hideProperty('ImprovementsBuildings', 'improvementsBuildings');
                     $this->hideProperty('Machineries', 'machineries');
                 } else {
                     if (count($improvementsBuildingsList)) {
                         $hideTD = false;
                         $this->formArray["propertyType"] = "ImprovementsBuildings";
                         $this->displayImprovementsBuildings($improvementsBuildingsList);
                         $this->hideProperty('Land', 'land');
                         $this->hideProperty('PlantsTrees', 'plantsTrees');
                         $this->hideProperty('Machineries', 'machineries');
                     } else {
                         if (count($machineriesList)) {
                             $hideTD = false;
                             $this->formArray["propertyType"] = "Machineries";
                             $this->displayMachineries($machineriesList);
                             $this->hideProperty('Land', 'land');
                             $this->hideProperty('PlantsTrees', 'plantsTrees');
                             $this->hideProperty('ImprovementsBuildings', 'improvementsBuildings');
                         } else {
                             $hideTD = true;
                             $this->displayLandPlantsTrees($landList, $plantsTreesList);
                             $this->displayImprovementsBuildingsMachineries($improvementsBuildingsList, $machineriesList);
                             $this->formArray["landTotalMarketValue"] = 0;
                             $this->formArray["landTotalAssessedValue"] = 0;
                             $this->formArray["plantTotalMarketValue"] = 0;
                             $this->formArray["plantTotalAssessedValue"] = 0;
                             $this->formArray["bldgTotalMarketValue"] = 0;
                             $this->formArray["bldgTotalAssessedValue"] = 0;
                             $this->formArray["machTotalMarketValue"] = 0;
                             $this->formArray["machTotalAssessedValue"] = 0;
                         }
                     }
                 }
             }
             if ($hideTD == false) {
                 // Display TD
                 $this->displayTD($afs->afsID);
             } else {
                 // Hide TD
                 $this->tpl->set_block("rptsTemplate", "DeclarationOfProperty", "DeclarationOfPropertyBlock");
                 $this->tpl->set_var("DeclarationOfPropertyBlock", "");
             }
             $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
             if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) {
                 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 {
                     $od = new OD();
                     $od->parseDomDocument($domDoc);
                     foreach ($od as $key => $value) {
                         if ($key == "locationAddress" && is_object($value)) {
                             foreach ($value as $lkey => $lvalue) {
                                 $this->formArray[$lkey] = $lvalue;
                             }
                         } else {
                             $this->formArray[$key] = $value;
                         }
                     }
                     $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
                     $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
                     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
                     if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) {
                         //exit(print_r($OwnerList));
                         $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);
                         }
                     }
                 }
             }
         }
     }
     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
     $afs = new AFS();
     $afs->selectRecord($this->formArray["afsID"]);
     $afs->setAfsID($this->formArray["afsID"]);
     $afs->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]);
     $afs->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]);
     $afs->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]);
     $afs->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]);
     $afs->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]);
     $afs->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]);
     $afs->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]);
     $afs->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]);
     $afs->setTotalMarketValue($this->formArray["totalMarketValue"]);
     $afs->setTotalAssessedValue($this->formArray["totalAssessedValue"]);
     $afs->setDomDocument();
     $doc = $afs->getDomDocument();
     $xmlStr = $doc->dump_mem(true);
     //print_r($AFSEncode);
     //echo $xmlStr;
     if (!($ret = $AFSEncode->updateAFS($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("afsID" => $this->formArray["afsID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Beispiel #3
0
 function getReceivedFromName($ownerID)
 {
     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
     if (!($xmlStr = $OwnerList->getOwnerList($ownerID))) {
         // error xmlStr
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $ownerRecords = new OwnerRecords();
             $ownerRecords->parseDomDocument($domDoc);
             $receivedFromName = "";
             $ownerArrayList = $ownerRecords->getArrayList();
             foreach ($ownerArrayList as $owner) {
                 $companyArray = $owner->getCompanyArray();
                 $personArray = $owner->getPersonArray();
                 if (is_array($personArray)) {
                     foreach ($personArray as $person) {
                         if ($receivedFromName != "") {
                             $receivedFromName .= ", ";
                         }
                         $receivedFromName .= $person->getFirstName();
                         if ($person->getMiddleName() != "") {
                             $receivedFromName .= " " . substr($person->getMiddleName(), 0, 1) . ".";
                         }
                         $receivedFromName .= " " . $person->getLastName();
                     }
                 }
                 if (is_array($companyArray)) {
                     foreach ($companyArray as $company) {
                         if ($receivedFromName != "") {
                             $receivedFromName .= ", ";
                         }
                         $receivedFromName .= $company->getCompanyName();
                     }
                 }
             }
             return $receivedFromName;
         }
     }
 }
Beispiel #4
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
             if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) {
                 exit("xml failed");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $od = new OD();
                     $od->parseDomDocument($domDoc);
                     foreach ($od as $key => $value) {
                         if ($key == "locationAddress" && is_object($value)) {
                             foreach ($value as $lkey => $lvalue) {
                                 $this->formArray[$lkey] = $lvalue;
                             }
                         } else {
                             $this->formArray[$key] = $value;
                         }
                     }
                     $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
                     $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
                     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
                     if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) {
                         //exit(print_r($OwnerList));
                         $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 {
                         }
                     }
                 }
             }
             break;
         case "save":
             $PropertyInfoEncode = new SoapObject(NCCBIZ . "PropertyInfoEncode.php", "urn:Object");
             if ($this->formArray["odID"] != "") {
                 if (!($xmlStr = $PropertyInfoEncode->getPropertyInfoDetails($this->formArray["odID"]))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $od = new OD();
                         $od->parseDomDocument($domDoc);
                         $locationAddress = $od->locationAddress;
                         if (is_a($locationAddress, LocationAddress)) {
                             $locationAddress->setLocationAddressID($this->formArray["locationAddressID"]);
                             $locationAddress->setNumber($this->formArray["number"]);
                             $locationAddress->setStreet($this->formArray["street"]);
                             $locationAddress->setBarangay($this->formArray["barangay"]);
                             $locationAddress->setDistrict($this->formArray["district"]);
                             $locationAddress->setMunicipalityCity($this->formArray["municipalityCity"]);
                             $locationAddress->setProvince($this->formArray["province"]);
                             $locationAddress->setDomDocument();
                         }
                         $od->setOdID($this->formArray["odID"]);
                         $od->setlocationAddress($locationAddress);
                         $od->setHouseTagNumber($this->formArray["houseTagNumber"]);
                         $od->setLandArea($this->formArray["landArea"]);
                         $od->setLotNumber($this->formArray["lotNumber"]);
                         $od->setZoneNumber($this->formArray["zoneNumber"]);
                         $od->setBlockNumber($this->formArray["blockNumber"]);
                         $od->setPsd13($this->formArray["psd13"]);
                         $od->setAffidavitOfOwnership($this->formArray["affidavitOfOwnership"]);
                         $od->setBarangayCertificate($this->formArray["barangayCertificate"]);
                         $od->setLandTagging($this->formArray["landTagging"]);
                         $od->setCreatedBy($this->userID);
                         $od->setModifiedBy($this->userID);
                         $od->setDomDocument();
                         $doc = $od->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $PropertyInfoEncode->updatePropertyInfo($xmlStr))) {
                             echo "error update";
                         }
                         header("location: PropertyInfoEncodeClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $ret)));
                         exit;
                     }
                 }
             } else {
                 $locationAddress = new LocationAddress();
                 $locationAddress->setNumber($this->formArray["number"]);
                 $locationAddress->setStreet($this->formArray["street"]);
                 $locationAddress->setBarangay($this->formArray["barangay"]);
                 $locationAddress->setDistrict($this->formArray["district"]);
                 $locationAddress->setMunicipalityCity($this->formArray["municipalityCity"]);
                 $locationAddress->setProvince($this->formArray["province"]);
                 $locationAddress->setDomDocument();
                 $od = new OD();
                 $od->setlocationAddress($locationAddress);
                 $od->setHouseTagNumber($this->formArray["houseTagNumber"]);
                 $od->setLandArea($this->formArray["landArea"]);
                 $od->setLotNumber($this->formArray["lotNumber"]);
                 $od->setZoneNumber($this->formArray["zoneNumber"]);
                 $od->setBlockNumber($this->formArray["blockNumber"]);
                 $od->setPsd13($this->formArray["psd13"]);
                 $od->setAffidavitOfOwnership($this->formArray["affidavitOfOwnership"]);
                 $od->setBarangayCertificate($this->formArray["barangayCertificate"]);
                 $od->setLandTagging($this->formArray["landTagging"]);
                 $od->setCreatedBy($this->userID);
                 $od->setModifiedBy($this->userID);
                 $od->setDomDocument();
                 //echo hello;
                 $doc = $od->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $PropertyInfoEncode->savePropertyInfo($xmlStr))) {
                     //echo("ret=".$ret);
                 }
                 $this->formArray["odID"] = $ret;
                 header("location: PropertyInfoEncodeClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $ret)));
                 //echo $PropertyInfoEncode->getPropertyInfoDetails($ret);
                 exit($ret);
             }
             break;
         case "cancel":
             header("location: PropertyInfoList.php");
             exit;
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock");
             $this->tpl->set_var("odIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Beispiel #5
0
 function displayOwner($afsID)
 {
     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
     $this->formArray["odID"] = $AFSEncode->getOdID($afsID);
     $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
     $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
     $this->tpl->set_var("ownerID", $this->formArray["ownerID"]);
     $this->tpl->set_var("odID", $this->formArray["odID"]);
     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
     if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) {
         //exit(print_r($OwnerList));
         $this->tpl->set_var("PersonListBlock", "");
         $this->tpl->set_var("CompanyListBlock", "");
         $this->tpl->set_var("none", "none");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var("PersonListBlock", "");
             $this->tpl->set_var("CompanyListBlock", "");
             $this->tpl->set_var("none", "none");
         } else {
             $this->displayOwnerList($domDoc);
         }
     }
 }
Beispiel #6
0
 function Main()
 {
     $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
     $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");
     $propertyType = $this->formArray["propertyType"];
     $propertyID = $this->formArray["propertyID"];
     switch ($propertyType) {
         case "Land":
             $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object");
             if (!($xmlStr = $LandDetails->getLand($propertyID))) {
                 echo "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 {
                     $land = new Land();
                     $land->parseDomDocument($domDoc);
                     //$land->selectRecord($propertyID);
                     $this->formArray["landTotalMarketValue"] += tofloat($land->getMarketValue());
                     $this->formArray["landTotalAssessedValue"] += tofloat($land->getAssessedValue());
                     $this->displayLand($land);
                     //echo $this->formArray["landTotalAssessedValue"];
                 }
             }
             $this->tpl->set_var("PlantsTreesBlock", "");
             $this->tpl->set_var("ImprovementsBuildingsBlock", "");
             $this->tpl->set_var("MachineriesBlock", "");
             break;
         case "PlantsTrees":
             $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object");
             if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($propertyID))) {
                 echo "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 {
                     $plantsTrees = new PlantsTrees();
                     $plantsTrees->parseDomDocument($domDoc);
                     //$plantsTrees->selectRecord($propertyID);
                     $this->formArray["plantTotalMarketValue"] += tofloat($plantsTrees->getMarketValue());
                     $this->formArray["plantTotalAssessedValue"] += tofloat($plantsTrees->getAssessedValue());
                     $this->displayPlantsTrees($plantsTrees);
                 }
             }
             $this->tpl->set_var("LandBlock", "");
             $this->tpl->set_var("ImprovementsBuildingsBlock", "");
             $this->tpl->set_var("MachineriesBlock", "");
             break;
         case "ImprovementsBuildings":
             $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
             if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($propertyID))) {
                 echo "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 {
                     $improvementsBuildings = new ImprovementsBuildings();
                     $improvementsBuildings->parseDomDocument($domDoc);
                     //$improvementsBuildings->selectRecord($propertyID);
                     $this->formArray["bldgTotalMarketValue"] += tofloat($improvementsBuildings->getMarketValue());
                     $this->formArray["bldgTotalAssessedValue"] += tofloat($improvementsBuildings->getAssessedValue());
                     $this->displayImprovementsBuildings($improvementsBuildings);
                 }
             }
             $this->tpl->set_var("LandBlock", "");
             $this->tpl->set_var("PlantsTreesBlock", "");
             $this->tpl->set_var("MachineriesBlock", "");
             break;
         case "Machineries":
             $MachineriesDetails = new SoapObject(NCCBIZ . "MachineriesDetails.php", "urn:Object");
             if (!($xmlStr = $MachineriesDetails->getMachineries($propertyID))) {
                 echo "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 {
                     $machineries = new Machineries();
                     $machineries->parseDomDocument($domDoc);
                     //$machineries->selectRecord($propertyID);
                     $this->formArray["machTotalMarketValue"] += tofloat($machineries->getMarketValue());
                     $this->formArray["machTotalAssessedValue"] += tofloat($machineries->getAssessedValue());
                     $this->displayMachineries($machineries);
                 }
             }
             $this->tpl->set_var("LandBlock", "");
             $this->tpl->set_var("PlantsTreesBlock", "");
             $this->tpl->set_var("ImprovementsBuildingsBlock", "");
             break;
         default:
             $this->tpl->set_block("TDList", "Land", "LandBlock");
             $this->tpl->set_var("LandBlock", "");
             $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock");
             $this->tpl->set_var("PlantsTreesBlock", "");
             $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock");
             $this->tpl->set_var("ImprovementsBuildingsBlock", "");
             $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock");
             $this->tpl->set_var("MachineriesBlock", "");
             $this->tpl->set_block("TDList", "TD", "TDBlock");
             $this->tpl->set_var("TDBlock", "");
     }
     $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object");
     $this->formArray["afsID"] = $TDEncode->getAfsID($this->formArray["tdID"]);
     $afs = new AFS();
     $this->formArray["odID"] = $afs->checkOdID($this->formArray["afsID"]);
     $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
     $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
     if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) {
         //exit(print_r($OwnerList));
         $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);
         }
     }
     $this->setForm();
     $this->tpl->parse("TDListBlock", "TDList", true);
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("tdID" => $this->formArray["rtdID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Beispiel #7
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "delete":
             //print_r($this->formArray);
             if (count($this->formArray["personID"]) > 0) {
                 $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object");
                 if (!($deletedRows = $PersonList->deletePerson($this->formArray["personID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             //print_r($this->formArray);
             if (count($this->formArray["companyID"]) > 0) {
                 $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object");
                 if (!($deletedRows = $CompanyList->deleteCompany($this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: OwnerList.php" . $this->sess->url("") . $this->sess->add_query(array("ownerID" => $this->formArray["ownerID"])));
             exit;
             break;
         case "remove":
             //*
             if (count($this->formArray["personID"])) {
                 $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
                 if (!($deletedRows = $OwnerList->removeOwnerPerson($this->formArray["ownerID"], $this->formArray["personID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["companyID"]) > 0) {
                 $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
                 if (!($deletedRows = $OwnerList->removeOwnerCompany($this->formArray["ownerID"], $this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: OwnerList.php" . $this->sess->url("") . $this->sess->add_query(array("ownerID" => $this->formArray["ownerID"])));
             exit;
             break;
         case "cancel":
             header("location: OwnerList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
     if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) {
         //exit(print_r($OwnerList));
         $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
         $this->tpl->set_var("OwnerListTableBlock", "invalid ownerID");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
             $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
         } else {
             $ownerRecords = new OwnerRecords();
             $ownerRecords->parseDomOwnerRecords($domDoc);
             $list = $ownerRecords->getOwnerList();
             foreach ($list as $key => $value) {
                 if (count($value->personArray)) {
                     $this->tpl->set_block("rptsTemplate", "PersonDBEmpty", "PersonDBEmptyBlock");
                     $this->tpl->set_var("PersonDBEmptyBlock", "");
                     $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock");
                     foreach ($value->personArray as $personKey => $personValue) {
                         $this->tpl->set_var("personID", $personValue->getPersonID());
                         if (!($pname = $personValue->getFullName())) {
                             $pname = "none";
                         }
                         $this->tpl->set_var("fullName", $pname);
                         $this->tpl->set_var("tin", $personValue->getTin());
                         $this->tpl->set_var("telephone", $personValue->getTelephone());
                         $this->tpl->set_var("mobileNumber", $personValue->getMobileNumber());
                         $this->tpl->parse("PersonListBlock", "PersonList", true);
                     }
                 } else {
                     $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock");
                     $this->tpl->set_var("PersonListBlock", "");
                 }
                 if (count($value->companyArray)) {
                     $this->tpl->set_block("rptsTemplate", "CompanyDBEmpty", "CompanyDBEmptyBlock");
                     $this->tpl->set_var("CompanyDBEmptyBlock", "");
                     $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
                     //print_r($value->companyArray);
                     foreach ($value->companyArray as $companyKey => $companyValue) {
                         $this->tpl->set_var("companyID", $companyValue->getCompanyID());
                         if (!($cname = $companyValue->getCompanyName())) {
                             $cname = "none";
                         }
                         $this->tpl->set_var("companyName", $cname);
                         $this->tpl->set_var("tin", $companyValue->getTin());
                         $this->tpl->set_var("telephone", $companyValue->getTelephone());
                         $this->tpl->set_var("fax", $companyValue->getFax());
                         $this->tpl->parse("CompanyListBlock", "CompanyList", true);
                     }
                 } else {
                     $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
                     $this->tpl->set_var("CompanyListBlock", "");
                 }
             }
         }
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Beispiel #8
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "remove":
             if (count($this->formArray["landID"])) {
                 //print_r($this->formArray["landID"]);
                 $LandList = new SoapObject(NCCBIZ . "LandList.php", "urn:Object");
                 if (!($deletedRows = $LandList->removeLand($this->formArray["landID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["plantsTreesID"])) {
                 //print_r($this->formArray["plantsTreesID"]);
                 $PlantsTreesList = new SoapObject(NCCBIZ . "PlantsTreesList.php", "urn:Object");
                 if (!($deletedRows = $PlantsTreesList->removePlantsTrees($this->formArray["plantsTreesID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["machineriesID"])) {
                 //print_r($this->formArray["machineriesID"]);
                 $MachineriesList = new SoapObject(NCCBIZ . "MachineriesList.php", "urn:Object");
                 if (!($deletedRows = $MachineriesList->removeMachineries($this->formArray["machineriesID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["improvementsBuildingsID"])) {
                 //print_r($this->formArray["improvementsBuildingsID"]);
                 $ImprovementsBuildingsList = new SoapObject(NCCBIZ . "ImprovementsBuildingsList.php", "urn:Object");
                 if (!($deletedRows = $ImprovementsBuildingsList->removeImprovementsBuildings($this->formArray["improvementsBuildingsID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["storeyID"])) {
                 //print_r($this->formArray["storeyID"]);
                 $StoreyList = new SoapObject(NCCBIZ . "StoreyList.php", "urn:Object");
                 if (!($deletedRows = $StoreyList->removeStorey($this->formArray["storeyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: AFSDetails.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
     if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
         $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);
             //print_r($afs);
             foreach ($afs as $key => $value) {
                 $this->formArray[$key] = $value;
                 $this->formArray["totalMarketValue"] = 0;
                 $this->formArray["totalAssessedValue"] = 0;
             }
             //land
             $landList = $afs->getLandArray();
             if (count($landList)) {
                 $this->displayLandList($landList);
             } else {
                 $this->tpl->set_var("landCtr", 0);
                 $this->tpl->set_block("rptsTemplate", "defaultLandList", "defaultLandListBlock");
                 $this->tpl->set_var("defaultLandListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "toggleLandList", "toggleLandListBlock");
                 $this->tpl->set_var("toggleLandListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "LandList", "LandListBlock");
                 $this->tpl->set_var("LandListBlock", "");
             }
             //plantsTrees
             $plantsTreesList = $afs->getPlantsTreesArray();
             if (count($plantsTreesList)) {
                 $this->displayPlantsTreesList($plantsTreesList);
             } else {
                 $this->tpl->set_var("plantsTreesCtr", 0);
                 $this->tpl->set_block("rptsTemplate", "defaultPlantsTreesList", "defaultPlantsTreesListBlock");
                 $this->tpl->set_var("defaultPlantsTreesListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "togglePlantsTreesList", "togglePlantsTreesListBlock");
                 $this->tpl->set_var("togglePlantsTreesListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "PlantsTreesList", "PlantsTreesListBlock");
                 $this->tpl->set_var("PlantsTreesListBlock", "");
             }
             //improvementsBuildings
             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
             if (count($improvementsBuildingsList)) {
                 $this->displayImprovementsBuildingsList($improvementsBuildingsList);
             } else {
                 $this->tpl->set_var("improvementsBuildingsCtr", 0);
                 $this->tpl->set_block("rptsTemplate", "defaultImprovementsBuildingsList", "defaultImprovementsBuildingsListBlock");
                 $this->tpl->set_var("defaultImprovementsBuildingsListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "toggleImprovementsBuildingsList", "toggleImprovementsBuildingsListBlock");
                 $this->tpl->set_var("toggleImprovementsBuildingsListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "ImprovementsBuildingsList", "ImprovementsBuildingsListBlock");
                 $this->tpl->set_var("ImprovementsBuildingsListBlock", "");
             }
             //machineries
             $machineriesList = $afs->getMachineriesArray();
             //print_r($machineriesList);
             if (count($machineriesList)) {
                 $this->displayMachineriesList($machineriesList);
             } else {
                 $this->tpl->set_var("machineriesCtr", 0);
                 $this->tpl->set_block("rptsTemplate", "defaultMachineriesList", "defaultMachineriesListBlock");
                 $this->tpl->set_var("defaultMachineriesListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "toggleMachineriesList", "toggleMachineriesListBlock");
                 $this->tpl->set_var("toggleMachineriesListBlock", "");
                 $this->tpl->set_block("rptsTemplate", "MachineriesList", "MachineriesListBlock");
                 $this->tpl->set_var("MachineriesListBlock", "");
             }
             $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
             if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) {
                 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 {
                     $od = new OD();
                     $od->parseDomDocument($domDoc);
                     foreach ($od as $key => $value) {
                         if ($key == "locationAddress" && is_object($value)) {
                             foreach ($value as $lkey => $lvalue) {
                                 $this->formArray[$lkey] = $lvalue;
                             }
                         } else {
                             $this->formArray[$key] = $value;
                         }
                     }
                     $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
                     $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
                     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
                     if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) {
                         //exit(print_r($OwnerList));
                         $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);
                         }
                     }
                 }
             }
         }
     }
     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
     $afs = new AFS();
     $afs->setAfsID($this->formArray["afsID"]);
     $afs->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]);
     $afs->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]);
     $afs->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]);
     $afs->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]);
     $afs->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]);
     $afs->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]);
     $afs->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]);
     $afs->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]);
     $afs->setTotalMarketValue($this->formArray["totalMarketValue"]);
     $afs->setTotalAssessedValue($this->formArray["totalAssessedValue"]);
     $afs->setDomDocument();
     $doc = $afs->getDomDocument();
     $xmlStr = $doc->dump_mem(true);
     //print_r($AFSEncode);
     //echo $xmlStr;
     if (!($ret = $AFSEncode->updateAFS($xmlStr))) {
         echo "ret=" . $ret;
     }
     //echo $ret;
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Beispiel #9
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "deletePerson":
             //print_r($this->formArray);
             if (count($this->formArray["personID"]) > 0) {
                 $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object");
                 if (!($deletedRows = $PersonList->deleteOwner($this->formArray["personID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             break;
         case "deleteCompany":
             //print_r($this->formArray);
             if (count($this->formArray["companyID"]) > 0) {
                 $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object");
                 if (!($deletedRows = $CompanyList->deleteCompany($this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             break;
         case "cancel":
             header("location: OwnerList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
     if (!($xmlStr = $OwnerList->getOwnerList())) {
         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
         $this->tpl->set_var("TableBlock", "database empty");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
             $this->tpl->set_var("TableBlock", "error xmlDoc");
         } else {
             $personRecords = new OwnerRecords();
             $personRecords->parseDomOwnerRecords($domDoc);
             $list = $personRecords->getOwnerList();
             $this->tpl->set_block("rptsTemplate", "OwnerList", "OwnerListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("personID", $value->getOwnerID());
                 if (!($pname = $value->getFullName())) {
                     $pname = "none";
                 }
                 $this->tpl->set_var("fullName", $pname);
                 $this->tpl->set_var("tin", $value->getTin());
                 $this->tpl->set_var("telephone", $value->getTelephone());
                 $this->tpl->set_var("mobileNumber", $value->getMobileNumber());
                 $this->tpl->parse("OwnerListBlock", "OwnerList", true);
             }
         }
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }