コード例 #1
0
ファイル: ODRecords.php プロジェクト: armic/erpts
 function parseDomDocument($domDoc)
 {
     $baseNode = $domDoc->document_element();
     // IF statement for bug fix of December 04, 2003
     // when an error occured on a blank FAAS list
     if (!is_object($baseNode)) {
         return false;
     }
     if ($baseNode->has_child_nodes()) {
         $child = $baseNode->first_child();
         while ($child) {
             //if ($child->tagname=="OD") {
             if ($child->tagname) {
                 $tempXmlStr = $domDoc->dump_node($child);
                 $tempDomDoc = domxml_open_mem($tempXmlStr);
                 $od = new OD();
                 if ($od->parseDomDocument($tempDomDoc)) {
                     $this->arrayList[] = $od;
                 }
             }
             $child = $child->next_sibling();
         }
     }
     $ret = $this->setDomDocument() ? true : false;
     return $ret;
 }
コード例 #2
0
ファイル: PropertyInfoEncode.php プロジェクト: armic/erpts
 function updatePropertyInfo($xmlStr)
 {
     if (!($domDoc = domxml_open_mem($xmlStr))) {
         $ret = false;
     }
     $od = new OD();
     $od->parseDomDocument($domDoc);
     $ret = $od->updateRecord();
     return $ret;
 }
コード例 #3
0
ファイル: ODRecords_test.php プロジェクト: armic/erpts
 function parseDomDocument($domDoc)
 {
     $baseNode = $domDoc->document_element();
     if ($baseNode->has_child_nodes()) {
         $child = $baseNode->first_child();
         while ($child) {
             //if ($child->tagname=="OD") {
             if ($child->tagname) {
                 $tempXmlStr = $domDoc->dump_node($child);
                 $tempDomDoc = domxml_open_mem($tempXmlStr);
                 $od = new OD();
                 if ($od->parseDomDocument($tempDomDoc)) {
                     $this->arrayList[] = $od;
                 }
             }
             $child = $child->next_sibling();
         }
     }
     $ret = $this->setDomDocument() ? true : false;
     return $ret;
 }
コード例 #4
0
 function checkTDIsInLocation($tdID)
 {
     $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
     if ($odID = $ODDetails->getOdIDFromTdID($tdID)) {
         if (!($xmlStr = $ODDetails->getOD($odID))) {
             return false;
         } else {
             if (!($domDoc = domxml_open_mem($xmlStr))) {
                 return false;
             } else {
                 $od = new OD();
                 $od->parseDomDocument($domDoc);
                 $locationAddress = $od->getLocationAddress();
                 if (is_object($locationAddress)) {
                     // ideally, locationAddress->municipalityCity is an ID
                     // but old data still stores textual municipalityCity information
                     $municipalityCity = $locationAddress->getMunicipalityCity();
                     if ($municipalityCity == $this->formArray["municipalityCityID"]) {
                         return true;
                     } else {
                         if ($municipalityCity == $this->formArray["municipalityCity"]) {
                             return true;
                         }
                     }
                 }
                 return false;
             }
         }
     } else {
         return false;
     }
 }
コード例 #5
0
ファイル: RPTOPAFSDetails.php プロジェクト: armic/erpts
 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");
 }
コード例 #6
0
 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");
 }
コード例 #7
0
 function getOD($odID)
 {
     $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
     if (!($xmlStr = $ODDetails->getOD($odID))) {
         // error xmlStr
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $od = new OD();
             $od->parseDomDocument($domDoc);
             return $od;
         }
     }
 }
コード例 #8
0
ファイル: PropertyInfoEncode.php プロジェクト: armic/erpts
 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");
 }
コード例 #9
0
ファイル: PrintTDsumm.php プロジェクト: armic/erpts
 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);
                     }
                 }
             }
         }
     }
 }
コード例 #10
0
 function displayPrecedingOD()
 {
     $ODHistoryList = new SoapObject(NCCBIZ . "ODHistoryList.php", "urn:Object");
     if (!($xmlStr = $ODHistoryList->getPrecedingODList($this->formArray["odID"]))) {
         $this->tpl->set_var("precedingUpdateCode", "");
         $this->tpl->set_var("precedingARPNumber", "");
         $this->tpl->set_var("precedingAssessedValue", "");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var("precedingUpdateCode", "");
             $this->tpl->set_var("precedingARPNumber", "");
             $this->tpl->set_var("precedingAssessedValue", "");
         } else {
             $odHistoryRecords = new ODHistoryRecords();
             $odHistoryRecords->parseDomDocument($domDoc);
             $arrayList = $odHistoryRecords->getArrayList();
             if (count($arrayList)) {
                 $value = $arrayList[0];
                 $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
                 if (!($xmlStr = $ODDetails->getOD($value->getPreviousODID()))) {
                     $this->tpl->set_var("precedingUpdateCode", "");
                     $this->tpl->set_var("precedingARPNumber", "");
                     $this->tpl->set_var("precedingAssessedValue", "");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_var("precedingUpdateCode", "");
                         $this->tpl->set_var("precedingARPNumber", "");
                         $this->tpl->set_var("precedingAssessedValue", "");
                     } else {
                         $precedingOD = new OD();
                         $precedingOD->parseDomDocument($domDoc);
                         $precedingODID = $precedingOD->getOdID();
                         $precedingAFS = $this->getAFSDetails($precedingODID);
                         $this->tpl->set_var("precedingUpdateCode", $value->getTransactionCode());
                         $this->tpl->set_var("precedingARPNumber", $precedingAFS->getARPNumber());
                         $this->tpl->set_var("precedingAssessedValue", number_format($precedingAFS->getTotalAssessedValue(), 2, ".", ","));
                         // get previous owner of Auctioned property
                         $owner = $precedingOD->owner;
                         if (is_array($owner->personArray)) {
                             foreach ($owner->personArray as $p) {
                                 $ownerNamesArray[] = $p->getLastName() . ", " . $p->getFirstName() . " " . substr($p->getMiddleName(), 0, 1) . ".";
                             }
                         }
                         if (is_array($owner->companyArray)) {
                             foreach ($owner->companyArray as $c) {
                                 $ownerNamesArray[] = $c->getCompanyName();
                             }
                         }
                         if (is_array($ownerNamesArray)) {
                             $ownerNamesString = implode("<br>", $ownerNamesArray);
                             unset($ownerNamesArray);
                             $this->tpl->set_var("ownerNames", $ownerNamesString);
                         } else {
                             $this->tpl->set_var("ownerNames", "");
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #11
0
ファイル: PrintTD.php プロジェクト: armic/erpts
 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);
                     }
                 }
             }
         }
     }
 }
コード例 #12
0
 function displaySucceedingOD()
 {
     $ODHistoryList = new SoapObject(NCCBIZ . "ODHistoryList.php", "urn:Object");
     if (!($xmlStr = $ODHistoryList->getSucceedingODList($this->formArray["odID"]))) {
         $this->tpl->set_var("succeedingARPNumber", "");
         $this->tpl->set_var("succeedingUpdateCode", "");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var("succeedingARPNumber", "");
             $this->tpl->set_var("succeedingUpdateCode", "");
         } else {
             $odHistoryRecords = new ODHistoryRecords();
             $odHistoryRecords->parseDomDocument($domDoc);
             $arrayList = $odHistoryRecords->getArrayList();
             if (count($arrayList)) {
                 $value = $arrayList[0];
                 $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
                 if (!($xmlStr = $ODDetails->getOD($value->getPresentODID()))) {
                     $this->tpl->set_var("succeedingARPNumber", "");
                     $this->tpl->set_var("succeedingUpdateCode", "");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_var("succeedingARPNumber", "");
                         $this->tpl->set_var("succeedingUpdateCode", "");
                     } else {
                         $succeedingOD = new OD();
                         $succeedingOD->parseDomDocument($domDoc);
                         $succeedingODID = $succeedingOD->getOdID();
                         $succeedingAFS = $this->getAFSDetails($succeedingODID);
                         $this->tpl->set_var("succeedingARPNumber", $succeedingAFS->getARPNumber());
                         $this->tpl->set_var("succeedingUpdateCode", $value->getTransactionCode());
                     }
                 }
             }
         }
     }
 }
コード例 #13
0
ファイル: ODDetails.php プロジェクト: armic/erpts
 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");
 }
コード例 #14
0
ファイル: PrintTD_old.php プロジェクト: armic/erpts
 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);
                     }
                 }
             }
         }
     }
 }
コード例 #15
0
ファイル: PrintTDsumm.php プロジェクト: armic/erpts
 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);
                     }
                 }
             }
         }
     }
 }
コード例 #16
0
ファイル: PrintLandFAAS.php プロジェクト: armic/erpts
 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);
                     }
                 }
             }
         }
     }
 }
コード例 #17
0
ファイル: testAFSDetails.php プロジェクト: armic/erpts
 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");
 }