function Main() { switch ($this->formArray["formAction"]) { case "save": $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) { exit("error xml"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error domDoc"); } else { $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $afs = new AFS(); $afs->parseDomDocument($domDoc); $afs->setArpNumber($this->formArray["arpNumber"]); $afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]); $afs->setTaxability($this->formArray["taxability"]); $afs->setEffectivity($this->formArray["effectivity"]); $afs->setDomDocument(); $doc = $afs->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $AFSEncode->updateAFS($xmlStr))) { exit("error update"); } } } header("location: RPUIdentificationClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"]))); exit; break; default: $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) { exit("error xml"); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error domDoc"); } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["afsID"] = $afs->getAfsID(); $this->formArray["arpNumber"] = $afs->getArpNumber(); $this->formArray["taxability"] = $afs->getTaxability(); $this->formArray["effectivity"] = $afs->getEffectivity(); $this->formArray["propertyIndexNumber"] = $afs->getPropertyIndexNumber(); } } break; } $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 "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 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() { //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 CreateNewRPU_AFS_TD($odID, $userID = "", $transactionCode = "", $copyOwner = true, $copyAFS = true, $copyTD = false) { $od = new OD(); $od->selectRecord($odID); unset($od->oldODArray); $od->setTransactionCode($transactionCode); $od->setOldODArray($odID); // create new OD $ownerID = $od->owner->getOwnerID(); $newOdID = $od->insertRecord(); $newOwnerID = $od->newOwnerID; $od->setDomDocument(); // associate existing Owner to new OD $owner = new Owner(); $owner->selectRecord($ownerID); if (count($owner->personArray)) { foreach ($owner->personArray as $personKey => $personValue) { if ($copyOwner) { $owner->insertOwnerPerson($newOwnerID, $personValue->getPersonID()); } } } if (count($owner->companyArray)) { foreach ($owner->companyArray as $companyKey => $companyValue) { if ($copyOwner) { $owner->insertOwnerCompany($newOwnerID, $companyValue->getCompanyID()); } } } // create new AFS and associate existing properties to new AFS $afs = new AFS(); $afsID = $afs->checkAfsID($odID); $afs->selectRecord($afsID); $afs->setOdID($newOdID); $afs->effectivity = date("Y") + 1; // new arpNumber is blank $afs->arpNumber = ""; // retain PIN except for Consolidation and Subdivision if ($transactionCode == "SD" || $transactionCode == "CS") { $afs->propertyIndexNumber = ""; } $afs->setDomDocument(); if ($copyAFS) { $newAfsID = $afs->insertRecord(); if (count($afs->landArray)) { foreach ($afs->landArray as $landKey => $landValue) { $landValue->setPropertyID(""); $landValue->setAfsID($newAfsID); if (is_object($landValue->propertyAdministrator)) { $landValue->propertyAdministrator->setPersonID(""); } else { $landValue->propertyAdministrator = new Person(); $landValue->propertyAdministrator->setPersonID(""); } // set unitValue from SubClass $landSubclasses = new LandSubclasses(); $landSubclasses->selectRecord(intVal($landValue->subClass)); $landValue->setUnitValue($landSubclasses->getValue()); // set assessmentLevel from ActualUse $landActualUses = new LandActualUses(); $landActualUses->selectRecord(intVal($landValue->actualUse)); $landValue->setAssessmentLevel($landActualUses->getValue()); $landValue->calculateMarketValue(); $landValue->calculateValueAdjustment(); $landValue->calculateAdjustedMarketValue(); $landValue->calculateAssessedValue(); $newP = $landValue->insertRecord(); } } if (count($afs->plantsTreesArray)) { foreach ($afs->plantsTreesArray as $plantsTreesKey => $plantsTreesValue) { $plantsTreesValue->setPropertyID(""); $plantsTreesValue->setAfsID($newAfsID); if (is_object($plantsTreesValue->propertyAdministrator)) { $plantsTreesValue->propertyAdministrator->setPersonID(""); } else { $plantsTreesValue->propertyAdministrator = new Person(); $plantsTreesValue->propertyAdministrator->setPersonID(""); } // set unitPrice from ProductClass $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord(intVal($plantsTreesValue->productClass)); $plantsTreesValue->setUnitPrice($plantsTreesClasses->getValue()); // set assessmentLevel from ActualUse $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord(intVal($plantsTreesValue->actualUse)); $plantsTreesValue->setAssessmentLevel($plantsTreesActualUses->getValue()); $plantsTreesValue->calculateMarketValue(); $plantsTreesValue->calculateValueAdjustment(); $plantsTreesValue->calculateAdjustedMarketValue(); $plantsTreesValue->calculateAssessedValue(); $newP = $plantsTreesValue->insertRecord(); } } if (count($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $improvementsBuildingsKey => $improvementsBuildingsValue) { $improvementsBuildingsValue->setPropertyID(""); $improvementsBuildingsValue->setAfsID($newAfsID); if (is_object($improvementsBuildingsValue->propertyAdministrator)) { $improvementsBuildingsValue->propertyAdministrator->setPersonID(""); } else { $improvementsBuildingsValue->propertyAdministrator = new Person(); $improvementsBuildingsValue->propertyAdministrator->setPersonID(""); } // set unitValue from BuildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); $improvementsBuildingsClasses->selectRecord(intVal($improvementsBuildingsValue->buildingClassification)); $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue()); // this if() line added : November 05 2004: // if master table unit value is not 0, update this unit value with the master table unit value // otherwise, retain this unit value as it is the old one. if ($improvementsBuildingsClasses->getValue() != 0) { $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue()); } // set assessmentLevel from ActualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord(intVal($improvementsBuildingsValue->actualUse)); $improvementsBuildingsValue->setAssessmentLevel($improvementsBuildingsActualUses->getValue()); $improvementsBuildingsValue->calculateMarketValue(); $improvementsBuildingsValue->calculateAccumulatedDepreciation(); $improvementsBuildingsValue->calculatedDepreciatedMarketValue(); $improvementsBuildingsValue->calculateAdjustedMarketValue(); $improvementsBuildingsValue->calculateAssessedValue(); $newP = $improvementsBuildingsValue->insertRecord(); } } if (count($afs->machineriesArray)) { foreach ($afs->machineriesArray as $machineriesKey => $machineriesValue) { $machineriesValue->setPropertyID(""); $machineriesValue->setAfsID($newAfsID); if (is_object($machineriesValue->propertyAdministrator)) { $machineriesValue->propertyAdministrator->setPersonID(""); } else { $machineriesValue->propertyAdministrator = new Person(); $machineriesValue->propertyAdministrator->setPersonID(""); } // set assessmentLevel from ActualUse $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord(intVal($machineriesValue->actualUse)); $machineriesValue->setAssessmentLevel($machineriesActualUses->getValue()); $machineriesValue->calculateMarketValue(); $machineriesValue->calculateDepreciatedMarketValue(); $machineriesValue->calculateAdjustedMarketValue(); $machineriesValue->calculateAssessedValue(); $newP = $machineriesValue->insertRecord(); } } } return $newOdID; }
function Main() { switch ($this->formArray["formAction"]) { case "edit": $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) { echo "xml failed"; } else { 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->parseDomAFS($domDoc); foreach ($afs as $key => $value) { $this->formArray[$key] = $value; } //print_r($afs); //exit(); $administrator = $afs->getAdministratorArray(); foreach ($administrator as $key => $value) { $this->formArray["lastName"] = $value->getLastName(); $this->formArray["firstName"] = $value->getFirstName(); $this->formArray["middleName"] = $value->getMiddleName(); $this->formArray["number"] = $value->getNumber(); $this->formArray["street"] = $value->getStreet(); $this->formArray["barangay"] = $value->getBarangay(); $this->formArray["district"] = $value->getDistrict(); $this->formArray["municipalityCity"] = $value->getMunicipalityCity(); $this->formArray["province"] = $value->getProvince(); $this->formArray["telephone"] = $value->getTelephone(); } } } break; case "save": $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); if ($this->formArray["afsID"] != "") { $afs = new AFS(); $afs->selectAFS($this->formArray["afsID"]); $afs->setOdID($this->formArray["odID"]); $afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]); $afs->setCertificateOfTitleNumber($this->formArray["certificateOfTitleNumber"]); $afs->setCadastralLotNumber($this->formArray["cadastralLotNumber"]); $afs->setNorth($this->formArray["north"]); $afs->setSouth($this->formArray["south"]); $afs->setEast($this->formArray["east"]); $afs->setWest($this->formArray["west"]); $afs->setCreatedBy($this->userID); $afs->setModifiedBy($this->userID); $person = new Person(); $person->setPersonID($afs->getAdministrator()); $person->setLastName($this->formArray["lastName"]); $person->setFirstName($this->formArray["firstName"]); $person->setMiddleName($this->formArray["middleName"]); $person->setNumber($this->formArray["number"]); $person->setStreet($this->formArray["street"]); $person->setBarangay($this->formArray["barangay"]); $person->setDistrict($this->formArray["district"]); $person->setMunicipalityCity($this->formArray["municipalityCity"]); $person->setProvince($this->formArray["province"]); $person->setTelephone($this->formArray["telephone"]); $person->setDom(); $afs->setAdministratorArray($person); $afs->setDomAFS(); $doc = $afs->getDomAFS(); $xmlStr = $doc->dump_mem(); if (!($ret = $AFSEncode->updateAFS($xmlStr))) { echo "error update"; } header("location: AFSClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $ret))); exit; } else { $afs = new AFS(); $afs->setOdID($this->formArray["odID"]); $afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]); $afs->setCertificateOfTitleNumber($this->formArray["certificateOfTitleNumber"]); $afs->setCadastralLotNumber($this->formArray["cadastralLotNumber"]); $afs->setNorth($this->formArray["north"]); $afs->setSouth($this->formArray["south"]); $afs->setEast($this->formArray["east"]); $afs->setWest($this->formArray["west"]); $afs->setCreatedBy($this->userID); $afs->setModifiedBy($this->userID); $adminAddress = new Address(); $adminAddress->setNumber($this->formArray["number"]); $adminAddress->setStreet($this->formArray["street"]); $adminAddress->setBarangay($this->formArray["barangay"]); $adminAddress->setDistrict($this->formArray["district"]); $adminAddress->setMunicipalityCity($this->formArray["municipalityCity"]); $adminAddress->setProvince($this->formArray["province"]); $adminAddress->setDomDocument(); $person = new Person(); $person->setLastName($this->formArray["lastName"]); $person->setFirstName($this->formArray["firstName"]); $person->setMiddleName($this->formArray["middleName"]); $person->setTelephone($this->formArray["telephone"]); $person->setDomDocument(); $afs->setAdministratorArray($person); $afs->setDomDocument(); $doc = $afs->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $AFSEncode->saveAFS($xmlStr))) { echo "ret=" . $ret; } $this->formArray["afsID"] = $ret; header("location: AFSClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $ret))); exit; } break; case "cancel": header("location: AFSList.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 CreateNewRPU_AFS_TDGenRevBrgy($odID, $userID = "", $transactionCode = "", $copyOwner = true, $copyAFS = true, $copyTD = true) { $link = mysql_connect(MYSQLDBHOST, MYSQLDBUSER, MYSQLDBPWD); mysql_select_db(MYSQLDBNAME, $link); $sql = "select Person.firstName, Person.lastName from Person, Owner, OwnerPerson " . "where Person.personID = OwnerPerson.personID and OwnerPerson.ownerID = Owner.ownerID and Owner.odID = " . $odID; $rs = mysql_query($sql, $link); $prevowners = ''; while ($row = mysql_fetch_assoc($rs)) { $prevowners .= $row['firstName'] . ' ' . $row['lastName'] . ', '; } $prevowners = substr($prevowners, 0, strlen($prevowners) - 2); $sql = "select AFS.totalAssessedValue from AFS where AFS.odID = " . $odID; $rs = mysql_query($sql, $link); $prevassdval = 0; if ($row = mysql_fetch_assoc($rs)) { $prevassdval = $row['totalAssessedValue']; } $od = new OD(); $od->selectRecord($odID); unset($od->oldODArray); $od->setTransactionCode($transactionCode); $od->setOldODArray($odID); // create new OD $ownerID = $od->owner->getOwnerID(); $newOdID = $od->insertRecord(); $newOwnerID = $od->newOwnerID; $od->setDomDocument(); // associate existing Owner to new OD $owner = new Owner(); $owner->selectRecord($ownerID); if (count($owner->personArray)) { foreach ($owner->personArray as $personKey => $personValue) { if ($copyOwner) { $owner->insertOwnerPerson($newOwnerID, $personValue->getPersonID()); } } } if (count($owner->companyArray)) { foreach ($owner->companyArray as $companyKey => $companyValue) { if ($copyOwner) { $owner->insertOwnerCompany($newOwnerID, $companyValue->getCompanyID()); } } } // create new AFS and associate existing properties to new AFS $afs = new AFS(); $afsID = $afs->checkAfsID($odID); $afs->selectRecord($afsID); $afs->setOdID($newOdID); $afs->effectivity = date("Y") + 1; // new arpNumber is blank //$afs->arpNumber = ""; // retain PIN except for Consolidation and Subdivision //if($transactionCode=="SD" || $transactionCode=="CS"){ $afs->propertyIndexNumber = ""; //} $afs->setDomDocument(); $newAFSID = $afs->insertRecord(); $afs->arpNumber = '(' . $newAFSID . ')'; $afs->updateRecord(); if ($copyAFS) { if ($copyTD) { $td = new TD(); $td->taxDeclarationNumber = $afs->arpNumber; $td->afsID = $newAFSID; $td->previousOwner = $prevowners; $td->previousAssessedValue = $prevassdval; $td->setDomDocument(); $newTDID = $td->insertRecord(); } if (count($afs->landArray)) { foreach ($afs->landArray as $landKey => $landValue) { $landValue->setPropertyID(""); $landValue->setAfsID($newAFSID); $landValue->propertyAdministrator->setPersonID(""); // set unitValue from SubClass $landSubclasses = new LandSubclasses(); $landSubclasses->selectRecord(intVal($landValue->subClass)); $landValue->setUnitValue($landSubclasses->getValue()); // set assessmentLevel from ActualUse $landActualUses = new LandActualUses(); $landActualUses->selectRecord(intVal($landValue->actualUse)); $landValue->setAssessmentLevel($landActualUses->getValue()); $landValue->calculateMarketValue(); $landValue->calculateValueAdjustment(); $landValue->calculateAdjustedMarketValue(); $landValue->calculateAssessedValue(); $landValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $landValue->appraisedByDate = ""; $landValue->recommendingApprovalDate = ""; $landValue->approvedByDate = ""; $newP = $landValue->insertRecord(); } } if (count($afs->plantsTreesArray)) { foreach ($afs->plantsTreesArray as $plantsTreesKey => $plantsTreesValue) { $plantsTreesValue->setPropertyID(""); $plantsTreesValue->setAfsID($newAFSID); $plantsTreesValue->propertyAdministrator->setPersonID(""); // set unitPrice from ProductClass $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord(intVal($plantsTreesValue->productClass)); $plantsTreesValue->setUnitPrice($plantsTreesClasses->getValue()); // set assessmentLevel from ActualUse $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord(intVal($plantsTreesValue->actualUse)); $plantsTreesValue->setAssessmentLevel($plantsTreesActualUses->getValue()); $plantsTreesValue->calculateMarketValue(); $plantsTreesValue->calculateValueAdjustment(); $plantsTreesValue->calculateAdjustedMarketValue(); $plantsTreesValue->calculateAssessedValue(); $plantsTreesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $plantsTreesValue->appraisedByDate = ""; $plantsTreesValue->recommendingApprovalDate = ""; $plantsTreesValue->approvedByDate = ""; $newP = $plantsTreesValue->insertRecord(); } } if (count($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $improvementsBuildingsKey => $improvementsBuildingsValue) { $improvementsBuildingsValue->setPropertyID(""); $improvementsBuildingsValue->setAfsID($newAFSID); $improvementsBuildingsValue->propertyAdministrator->setPersonID(""); // set unitValue from BuildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); $improvementsBuildingsClasses->selectRecord(intVal($improvementsBuildingsValue->buildingClassification)); $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue()); // set assessmentLevel from ActualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord(intVal($improvementsBuildingsValue->actualUse)); $improvementsBuildingsValue->setAssessmentLevel($improvementsBuildingsActualUses->getValue()); $improvementsBuildingsValue->calculateMarketValue(); $improvementsBuildingsValue->calculateAccumulatedDepreciation(); $improvementsBuildingsValue->calculatedDepreciatedMarketValue(); $improvementsBuildingsValue->calculateAdjustedMarketValue(); $improvementsBuildingsValue->calculateAssessedValue(); $improvementsBuildingsValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $improvementsBuildingsValue->appraisedByDate = ""; $improvementsBuildingsValue->recommendingApprovalDate = ""; $improvementsBuildingsValue->approvedByDate = ""; $newP = $improvementsBuildingsValue->insertRecord(); } } if (count($afs->machineriesArray)) { foreach ($afs->machineriesArray as $machineriesKey => $machineriesValue) { $machineriesValue->setPropertyID(""); $machineriesValue->setAfsID($newAFSID); $machineriesValue->propertyAdministrator->setPersonID(""); // set assessmentLevel from ActualUse $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord(intVal($machineriesValue->actualUse)); $machineriesValue->setAssessmentLevel($machineriesActualUses->getValue()); $machineriesValue->calculateMarketValue(); $machineriesValue->calculateDepreciatedMarketValue(); $machineriesValue->calculateAdjustedMarketValue(); $machineriesValue->calculateAssessedValue(); $machineriesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $machineriesValue->appraisedByDate = ""; $machineriesValue->recommendingApprovalDate = ""; $machineriesValue->approvedByDate = ""; $newP = $machineriesValue->insertRecord(); } } } $sql = "update AFS set archive = 'true' where AFS.odID = " . $odID; mysql_query($sql, $link); $sql = "update OD set archive = 'true' where OD.odID = " . $odID; mysql_query($sql, $link); $sql = "update TD set archive = 'true' where TD.afsID = " . $afsID; mysql_query($sql, $link); mysql_close($link); return $newOdID; echo "OD - " . $odID . "->" . $newOdID . "<br>"; echo "Owner - " . $ownerID . "->" . $newOwnerID . "<br>"; echo "AFS - " . $afsID . "->" . $newAFSID . "<br>" . $newP; }
function Main() { switch ($this->formArray["formAction"]) { case "save": $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) { exit("error xml"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error domDoc"); } else { $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $afs = new AFS(); $afs->parseDomDocument($domDoc); $afs->setArpNumber($this->formArray["arpNumber"]); $afs->setCadastralLotNumber($this->formArray["cadastralLotNumber"]); // convert $pointsArray to $gisTechnicalDescription string // separate each point with "-" and each pointRecord with "," $pointsArray = $this->formArray["pointsArray"]; $pointID = 1; if (is_array($pointsArray)) { for ($pointID = 1; $pointID <= count($pointsArray); $pointID++) { $pointArray = array($pointID, $pointsArray[$pointID]["pointType"], $pointsArray[$pointID]["quadrant"], $pointsArray[$pointID]["bearingDeg"], $pointsArray[$pointID]["bearingMin"], $pointsArray[$pointID]["distance"]); $pointString = implode("-", $pointArray); $gisTechDescArray[$pointID] = $pointString; } $gisTechnicalDescription = implode(",", $gisTechDescArray); $this->formArray["gisTechnicalDescription"] = $gisTechnicalDescription; } $afs->setGISTechnicalDescription($this->formArray["gisTechnicalDescription"]); $afs->setDomDocument(); $doc = $afs->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $AFSEncode->updateAFS($xmlStr))) { exit("error update"); } } } header("location: GISTechnicalDescriptionClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"]))); exit; break; case "del": // temporarily del points $delPointsArray = $this->formArray["pointsArray"]; $pointID = 1; if (is_array($delPointsArray)) { for ($delPointID = 1; $delPointID <= count($delPointsArray); $delPointID++) { if ($delPointID != $this->formArray["delPointID"]) { $pointsArray[$pointID]["pointType"] = $delPointsArray[$delPointID]["pointType"]; $pointsArray[$pointID]["quadrant"] = $delPointsArray[$delPointID]["quadrant"]; $pointsArray[$pointID]["bearingDeg"] = $delPointsArray[$delPointID]["bearingDeg"]; $pointsArray[$pointID]["bearingMin"] = $delPointsArray[$delPointID]["bearingMin"]; $pointsArray[$pointID]["distance"] = $delPointsArray[$delPointID]["distance"]; $pointID++; } } if (is_array($pointsArray)) { $this->tpl->set_block("rptsTemplate", "PointsList", "PointsListBlock"); for ($pointID = 1; $pointID <= count($pointsArray); $pointID++) { $this->tpl->set_var("pointID", $pointID); $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]); $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]); $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]); $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]); $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]); $this->tpl->parse("PointsListBlock", "PointsList", true); } $this->formArray["pointsExist"] = "true"; } else { $this->formArray["pointsExist"] = "false"; $this->hideBlock("PointsList"); } } break; case "add": // temporarily add points $pointsArray = $this->formArray["pointsArray"]; $pointID = 1; if (is_array($pointsArray)) { $this->tpl->set_block("rptsTemplate", "PointsList", "PointsListBlock"); for ($pointID = 1; $pointID <= count($pointsArray); $pointID++) { $this->tpl->set_var("pointID", $pointID); $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]); $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]); $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]); $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]); $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]); $this->tpl->parse("PointsListBlock", "PointsList", true); } $pointsArray[$pointID]["pointType"] = $this->formArray["pointType"]; $pointsArray[$pointID]["quadrant"] = $this->formArray["quadrant"]; $pointsArray[$pointID]["bearingDeg"] = $this->formArray["bearingDeg"]; $pointsArray[$pointID]["bearingMin"] = $this->formArray["bearingMin"]; $pointsArray[$pointID]["distance"] = $this->formArray["distance"]; $this->tpl->set_var("pointID", $pointID); $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]); $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]); $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]); $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]); $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]); $this->tpl->parse("PointsListBlock", "PointsList", true); } else { $pointsArray[$pointID]["pointType"] = $this->formArray["pointType"]; $pointsArray[$pointID]["quadrant"] = $this->formArray["quadrant"]; $pointsArray[$pointID]["bearingDeg"] = $this->formArray["bearingDeg"]; $pointsArray[$pointID]["bearingMin"] = $this->formArray["bearingMin"]; $pointsArray[$pointID]["distance"] = $this->formArray["distance"]; $this->tpl->set_block("rptsTemplate", "PointsList", "PointsListBlock"); $this->tpl->set_var("pointID", $pointID); $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]); $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]); $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]); $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]); $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]); $this->tpl->parse("PointsListBlock", "PointsList", true); } $this->formArray["pointsExist"] = "true"; break; default: $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) { exit("error xml"); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error domDoc"); } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["afsID"] = $afs->getAfsID(); $this->formArray["cadastralLotNumber"] = $afs->getCadastralLotNumber(); $this->formArray["gisTechnicalDescription"] = $afs->getGISTechnicalDescription(); if ($this->formArray["gisTechnicalDescription"] == "") { $this->formArray["pointsExist"] = "false"; $this->hideBlock("PointsList"); } else { $this->formArray["pointsExist"] = "true"; // parse gisTechnicalDescription into $pointsArray // separate each pointRecord at "," and each point at "-" $gisTechDescArray = explode(",", $this->formArray["gisTechnicalDescription"]); foreach ($gisTechDescArray as $pointString) { $pointArray = explode("-", $pointString); $pointID = $pointArray[0]; $pointsArray[$pointID]["pointType"] = $pointArray[1]; $pointsArray[$pointID]["quadrant"] = $pointArray[2]; $pointsArray[$pointID]["bearingDeg"] = $pointArray[3]; $pointsArray[$pointID]["bearingMin"] = $pointArray[4]; $pointsArray[$pointID]["distance"] = $pointArray[5]; } if (is_array($pointsArray)) { $this->tpl->set_block("rptsTemplate", "PointsList", "PointsListBlock"); for ($pointID = 1; $pointID <= count($pointsArray); $pointID++) { $this->tpl->set_var("pointID", $pointID); $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]); $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]); $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]); $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]); $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]); $this->tpl->parse("PointsListBlock", "PointsList", true); } } } } } break; } $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 "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"); }