function displayODAFS($afsID) { $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($odID = $AFSDetails->getOdID($afsID))) { echo "get od id failed"; } else { $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($odID))) { exit("xml failed"); } else { //exit($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $od = new OD(); $od->parseDomDocument($domDoc); if (is_object($od->locationAddress)) { $location = $od->locationAddress->getFullAddress(); $this->formArray["location"] = $location; $this->formArray["number"] = $od->locationAddress->getNumber(); $this->formArray["street"] = $od->locationAddress->getStreet(); $this->formArray["barangay"] = $od->locationAddress->getBarangay(); $this->formArray["municipalityCity"] = $od->locationAddress->getMunicipalityCity(); $this->formArray["provinceName"] = $od->locationAddress->getProvince(); // RC 20091006 for BLGF standard //$this->formArray["numberStreet"] = $od->locationAddress->getStreetNumber(); } $this->formArray["lotNumber"] = $od->getLotNumber(); $this->formArray["blockNumber"] = $od->getBlockNumber(); $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { echo "error xml"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $this->displayOwnerList($domDoc); } } } } } }
function displayODAFS($afsID) { $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($odID = $AFSDetails->getOdID($afsID))) { exit("get od id failed"); } else { $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($odID))) { exit("xml failed"); } else { //exit($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error open xml"); } else { $od = new OD(); $od->parseDomDocument($domDoc); if (is_object($od->locationAddress)) { $this->formArray["number"] = $od->locationAddress->getNumber(); $this->formArray["street"] = $od->locationAddress->getStreet(); $this->formArray["barangay"] = $od->locationAddress->getBarangay(); $this->formArray["district"] = $od->locationAddress->getDistrict(); $this->formArray["cityMunicipality"] = $od->locationAddress->getMunicipalityCity(); $this->formArray["province"] = $od->locationAddress->getProvince(); } $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { exit("error xml"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error open xml"); } else { $this->displayOwnerList($domDoc); } } } } } }
function Main() { //echo $this->formArray["formAction"]; switch ($this->formArray["formAction"]) { case "delete": if (count($this->formArray["personID"]) > 0) { $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object"); if (!($deletedRows = $PersonList->deleteRecord($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) { $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object"); if (!($deletedRows = $CompanyList->deleteRecord($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: ChangeOfOwnershipODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); 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: ChangeOfOwnershipODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) { exit("xml failed"); } else { //exit($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; } } $this->formArray["landArea"] = number_format($od->getLandArea(), 4, '.', ','); $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); //$OwnerList = new SoapObject(NCCBIZ."OwnerList.php", "urn:Object"); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { //exit(print_r($OwnerList)); $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { //echo $xmlStr; 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"); if (!($afsID = $AFSEncode->getAfsID($this->formArray["odID"]))) { //$this->tpl->set_block("rptsTemplate", "AFSDetails", "AFSDetailsBlock"); //$this->tpl->set_var("AFSDetailsBlock", ""); //echo "1afsID=".$afsID."=>".$this->formArray["odID"]; $afs = new AFS(); $afs->setOdID($this->formArray["odID"]); $afs->setDomDocument(); $doc = $afs->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($afsID = $AFSEncode->saveAFS($xmlStr))) { echo "ret=" . $afsID; } //echo "<br>afsID=".$afsID; } else { //echo "2afsID=".$afsID."=>".$this->formArray["odID"]; //$this->tpl->set_block("rptsTemplate", "AFSEncode", "AFSEncodeBlock"); //$this->tpl->set_var("AFSEncodeBlock", ""); } $this->formArray["afsID"] = $afsID; $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"); }
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"); }
function displayODAFS($afsID) { $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($odID = $AFSDetails->getOdID($afsID))) { echo "get od id failed"; } else { $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($odID))) { exit("xml failed"); } else { //exit($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $od = new OD(); $od->parseDomDocument($domDoc); if (is_object($od->locationAddress)) { $location = $od->locationAddress->getFullAddress(); $this->formArray["location"] = $location; } $this->formArray["lotNumber"] = $od->getLotNumber(); $this->formArray["blockNumber"] = $od->getBlockNumber(); $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { echo "error xml"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $this->displayOwnerList($domDoc); } } } } } }
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"); }
function Main() { //echo $this->formArray["formAction"]; switch ($this->formArray["formAction"]) { case "delete": if (count($this->formArray["personID"]) > 0) { $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object"); if (!($deletedRows = $PersonList->deleteRecord($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) { $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object"); if (!($deletedRows = $CompanyList->deleteRecord($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: ODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); 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: ODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) { exit("xml failed"); } else { //exit($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; } } $this->formArray["landArea"] = number_format($od->getLandArea(), 4, '.', ','); // confirmation for double transaction $this->formArray["TRANSACTION_MAX_DAYDIFFERENCE"] = TRANSACTION_MAX_DAYDIFFERENCE; $this->formArray["dayDifference"] = getDateDifference($od->getDateCreated(), strtotime("now"), "d"); $this->formArray["dayDifferenceText"] = getOnlyDays($this->formArray["dayDifference"]); $this->formArray["transactionCode"] = $od->getTransactionCode(); $this->formArray["blockDoubleTransaction"] = $od->getArchive(); $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); //$OwnerList = new SoapObject(NCCBIZ."OwnerList.php", "urn:Object"); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { //exit(print_r($OwnerList)); $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { //echo $xmlStr; 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"); if (!($afsID = $AFSEncode->getAfsID($this->formArray["odID"]))) { //$this->tpl->set_block("rptsTemplate", "AFSDetails", "AFSDetailsBlock"); //$this->tpl->set_var("AFSDetailsBlock", ""); //echo "1afsID=".$afsID."=>".$this->formArray["odID"]; $afs = new AFS(); $afs->setOdID($this->formArray["odID"]); $afs->setDomDocument(); $doc = $afs->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($afsID = $AFSEncode->saveAFS($xmlStr))) { echo "ret=" . $afsID; } //echo "<br>afsID=".$afsID; } else { //echo "2afsID=".$afsID."=>".$this->formArray["odID"]; //$this->tpl->set_block("rptsTemplate", "AFSEncode", "AFSEncodeBlock"); //$this->tpl->set_var("AFSEncodeBlock", ""); } $this->displayODHistory(); $this->formArray["afsID"] = $afsID; $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("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function displayODAFS($afsID) { $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($odID = $AFSDetails->getOdID($afsID))) { echo "get od id failed"; } else { $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($odID))) { exit("xml failed"); } else { //exit($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $od = new OD(); $od->parseDomDocument($domDoc); if (is_object($od->locationAddress)) { $this->formArray["location"] = $od->locationAddress->getFullAddress(); if ($od->locationAddress->getNumber() != "" && $od->locationAddress->getNumber() != "--" && $od->locationAddress->getNumber() != " ") { $this->formArray["numberStreet"] = $od->locationAddress->getNumber(); } if ($od->locationAddress->getStreet() != "" && $od->locationAddress->getStreet() != "--" && $od->locationAddress->getStreet() != " ") { $this->formArray["numberStreet"] .= " " . $od->locationAddress->getStreet(); } $this->formArray["barangay"] = $od->locationAddress->getBarangay(); $this->formArray["municipalityCity"] = $od->locationAddress->getMunicipalityCity(); } $this->formArray["lotNumber"] = $od->getLotNumber(); $this->formArray["blockNumber"] = $od->getBlockNumber(); // format textbox for lotNumber (maxlength for first line is:19) if (strlen($this->formArray["lotNumber"]) <= 19) { $spaceDifference = 19 - strlen($this->formarray["lotNumber"]); for ($spaceCount = 0; $spaceCount < $spaceDifference; $spaceCount++) { $this->formArray["lotNumber"] = " " . $this->formArray["lotNumber"]; } } // format textbox for blockNumber (maxlength for first line is:19) if (strlen($this->formArray["blockNumber"]) <= 19) { $spaceDifference = 19 - strlen($this->formarray["blockNumber"]); for ($spaceCount = 0; $spaceCount < $spaceDifference; $spaceCount++) { $this->formArray["blockNumber"] = " " . $this->formArray["blockNumber"]; } } $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { echo "error xml"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $this->displayOwnerList($domDoc); } } } } } }
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); } } }
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"); }
function displayODAFS($afsID) { $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($odID = $AFSDetails->getOdID($afsID))) { echo "get od id failed"; } else { $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getOD($odID))) { exit("xml failed"); } else { //exit($xmlStr); if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $od = new OD(); $od->parseDomDocument($domDoc); if (is_object($od->locationAddress)) { $this->tpl->set_var("location", htmlentities($od->locationAddress->getFullAddress())); //$this->tpl->set_var("numberStreet",htmlentities($od->locationAddress->getNumber()." ".$od->locationAddress->getStreet())); //$this->tpl->set_var("barangayDistrict",htmlentities($od->locationAddress->getBarangay().", ".$od->locationAddress->getDistrict())); //$this->tpl->set_var("municipalityCityProvince",htmlentities($od->locationAddress->getMunicipalityCity().", ".$od->locationAddress->getProvince())); } $this->tpl->set_var("lotNumber", htmlentities($od->getLotNumber())); $this->tpl->set_var("blockNumber", htmlentities($od->getBlockNumber())); $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); $xmlStr = $od->owner->domDocument->dump_mem(true); if (!$xmlStr) { echo "error xml"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $this->displayOwnerList($domDoc); } } } } } }
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"); }
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: ODEncode.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: ODEncode.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", ""); } $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); echo $this->formArray["odID"] . "ownerID=" . $this->formArray["ownerID"]; $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", "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", "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"); }