Ejemplo n.º 1
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
             if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($this->formArray["propertyID"]))) {
                 echo "xml failed";
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $improvementsBuildings = new ImprovementsBuildings();
                     $improvementsBuildings->parseDomDocument($domDoc);
                     foreach ($improvementsBuildings as $key => $value) {
                         switch ($key) {
                             case "propertyAdministrator":
                                 if (is_a($value, Person)) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday());
                                     $this->formArray["personID"] = $value->getPersonID();
                                     $this->formArray["lastName"] = $value->getLastName();
                                     $this->formArray["firstName"] = $value->getFirstName();
                                     $this->formArray["middleName"] = $value->getMiddleName();
                                     $this->formArray["gender"] = $value->getGender();
                                     $this->formArray["birth_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["birth_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["birth_day"] = removePreZero($dateArr["day"]);
                                     $this->formArray["maritalStatus"] = $value->getMaritalStatus();
                                     $this->formArray["tin"] = $value->getTin();
                                     if (is_array($value->addressArray)) {
                                         $this->formArray["addressID"] = $value->addressArray[0]->getAddressID();
                                         $this->formArray["number"] = $value->addressArray[0]->getNumber();
                                         $this->formArray["street"] = $value->addressArray[0]->getStreet();
                                         $this->formArray["barangay"] = $value->addressArray[0]->getBarangay();
                                         $this->formArray["district"] = $value->addressArray[0]->getDistrict();
                                         $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity();
                                         $this->formArray["province"] = $value->addressArray[0]->getProvince();
                                     }
                                     $this->formArray["telephone"] = $value->getTelephone();
                                     $this->formArray["mobileNumber"] = $value->getMobileNumber();
                                     $this->formArray["email"] = $value->getEmail();
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "appraisedByDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["as_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["as_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["as_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "recommendingApprovalDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["re_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["re_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["re_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "approvedByDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["av_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["av_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["av_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateConstructed":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["dc_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["dc_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["dc_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateOccupied":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["do_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["do_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["do_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateCompleted":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["dm_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["dm_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["dm_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             default:
                                 $this->formArray[$key] = $value;
                         }
                     }
                 }
             }
             break;
         case "save":
             if ($this->formArray["verifiedByID"] != "" && $this->formArray["verifiedByID"] != "xx" && $this->formArray["propertyID"] != "") {
                 $this->saveVerified($this->formArray["afsID"], $this->formArray["verifiedByID"], $this->formArray["propertyID"]);
             }
             $ImprovementsBuildingsEncode = new SoapObject(NCCBIZ . "ImprovementsBuildingsEncode.php", "urn:Object");
             if ($this->formArray["propertyID"] != "") {
                 $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
                 if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($this->formArray["propertyID"]))) {
                     $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 {
                         $address = new Address();
                         $address->setAddressID($this->formArray["addressID"]);
                         $address->setNumber($this->formArray["number"]);
                         $address->setStreet($this->formArray["street"]);
                         $address->setBarangay($this->formArray["barangay"]);
                         $address->setDistrict($this->formArray["district"]);
                         $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                         $address->setProvince($this->formArray["province"]);
                         $address->setDomDocument();
                         $propertyAdministrator = new Person();
                         $propertyAdministrator->setPersonID($this->formArray["personID"]);
                         $propertyAdministrator->setLastName($this->formArray["lastName"]);
                         $propertyAdministrator->setFirstName($this->formArray["firstName"]);
                         $propertyAdministrator->setMiddleName($this->formArray["middleName"]);
                         //$propertyAdministrator->setGender($this->formArray["gender"]);
                         //$propertyAdministrator->setBirthday($this->birthdate);
                         //$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]);
                         //$propertyAdministrator->setTin($this->formArray["tin"]);
                         $propertyAdministrator->setAddressArray($address);
                         $propertyAdministrator->setTelephone($this->formArray["telephone"]);
                         //$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]);
                         $propertyAdministrator->setEmail($this->formArray["email"]);
                         $propertyAdministrator->setDomDocument();
                         $improvementsBuildings = new ImprovementsBuildings();
                         $improvementsBuildings->parseDomDocument($domDoc);
                         $improvementsBuildings->setPropertyID($this->formArray["propertyID"]);
                         $improvementsBuildings->setAfsID($this->formArray["afsID"]);
                         $improvementsBuildings->setArpNumber($this->formArray["arpNumber"]);
                         $improvementsBuildings->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                         $improvementsBuildings->setPropertyAdministrator($propertyAdministrator);
                         $improvementsBuildings->setVerifiedBy($this->formArray["verifiedByID"]);
                         $improvementsBuildings->setPlottingsBy($this->formArray["plottingsByID"]);
                         $improvementsBuildings->setNotedBy($this->formArray["notedByID"]);
                         $improvementsBuildings->setMarketValue($this->formArray["marketValue"]);
                         $improvementsBuildings->setKind($this->formArray["kind"]);
                         $improvementsBuildings->setActualUse($this->formArray["actualUse"]);
                         $improvementsBuildings->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]);
                         $improvementsBuildings->setAssessmentLevel($this->formArray["assessmentLevel"]);
                         $improvementsBuildings->setAssessedValue($this->formArray["assessedValue"]);
                         $improvementsBuildings->setPreviousOwner($this->formArray["previousOwner"]);
                         $improvementsBuildings->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                         $improvementsBuildings->setTaxability($this->formArray["taxability"]);
                         $improvementsBuildings->setEffectivity($this->formArray["effectivity"]);
                         $improvementsBuildings->setAppraisedBy($this->formArray["appraisedByID"]);
                         $improvementsBuildings->setAppraisedByDate($this->formArray["appraisedByDate"]);
                         $improvementsBuildings->setRecommendingApproval($this->formArray["recommendingApprovalID"]);
                         $improvementsBuildings->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]);
                         $improvementsBuildings->setApprovedBy($this->formArray["approvedByID"]);
                         $improvementsBuildings->setApprovedByDate($this->formArray["approvedByDate"]);
                         $improvementsBuildings->setMemoranda($this->formArray["memoranda"]);
                         $improvementsBuildings->setPostingDate($this->formArray["postingDate"]);
                         $improvementsBuildings->setLandPin($this->formArray["landPin"]);
                         $improvementsBuildings->setFoundation($this->formArray["foundation"]);
                         $improvementsBuildings->setColumnsBldg($this->formArray["columnsBldg"]);
                         $improvementsBuildings->setBeams($this->formArray["beams"]);
                         $improvementsBuildings->setTrussFraming($this->formArray["trussFraming"]);
                         $improvementsBuildings->setRoof($this->formArray["roof"]);
                         $improvementsBuildings->setExteriorWalls($this->formArray["exteriorWalls"]);
                         $improvementsBuildings->setFlooring($this->formArray["flooring"]);
                         $improvementsBuildings->setDoors($this->formArray["doors"]);
                         $improvementsBuildings->setCeiling($this->formArray["ceiling"]);
                         $improvementsBuildings->setStructuralTypes($this->formArray["structuralTypes"]);
                         $improvementsBuildings->setBuildingClassification($this->formArray["buildingClassification"]);
                         $improvementsBuildings->setBuildingPermit($this->formArray["buildingPermit"]);
                         $improvementsBuildings->setBuildingAge($this->formArray["buildingAge"]);
                         $improvementsBuildings->setCctNumber($this->formArray["cctNumber"]);
                         $improvementsBuildings->setNumberOfStoreys($this->formArray["numberOfStoreys"]);
                         $improvementsBuildings->setWindows($this->formArray["windows"]);
                         $improvementsBuildings->setStairs($this->formArray["stairs"]);
                         $improvementsBuildings->setPartition($this->formArray["partition"]);
                         $improvementsBuildings->setWallFinish($this->formArray["wallFinish"]);
                         $improvementsBuildings->setElectrical($this->formArray["electrical"]);
                         $improvementsBuildings->setToiletAndBath($this->formArray["toiletAndBath"]);
                         $improvementsBuildings->setPlumbingSewer($this->formArray["plumbingSewer"]);
                         $improvementsBuildings->setFixtures($this->formArray["fixtures"]);
                         $improvementsBuildings->setDateConstructed($this->formArray["dateConstructed"]);
                         $improvementsBuildings->setDateOccupied($this->formArray["dateOccupied"]);
                         $improvementsBuildings->setDateCompleted($this->formArray["dateCompleted"]);
                         $improvementsBuildings->setAreaOfGroundFloor($this->formArray["areaOfGroundFloor"]);
                         $improvementsBuildings->setTotalBuildingArea($this->formArray["totalBuildingArea"]);
                         $improvementsBuildings->setUnitValue($this->formArray["unitValue"]);
                         $improvementsBuildings->setBuildingCoreAndAdditionalItems($this->formArray["buildingCoreAndAdditionalItems"]);
                         $improvementsBuildings->setAddItems($this->formArray["addItems"]);
                         $improvementsBuildings->setDepreciationRate($this->formArray["depreciationRate"]);
                         $improvementsBuildings->setAccumulatedDepreciation($this->formArray["accumulatedDepreciation"]);
                         $improvementsBuildings->setDepreciatedMarketValue($this->formArray["depreciatedMarketValue"]);
                         $improvementsBuildings->setCreatedBy($this->userID);
                         $improvementsBuildings->setModifiedBy($this->userID);
                         $improvementsBuildings->setDomDocument();
                         $doc = $improvementsBuildings->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         //echo $xmlStr;
                         $ret = $ImprovementsBuildingsEncode->updateImprovementsBuildings($xmlStr);
                         if (!($ret = $ImprovementsBuildingsEncode->updateImprovementsBuildings($xmlStr))) {
                             exit("error update" . $ret);
                         }
                     }
                 }
             } else {
                 $address = new Address();
                 //$address->setAddressID($this->formArray["addressID"]);
                 $address->setNumber($this->formArray["number"]);
                 $address->setStreet($this->formArray["street"]);
                 $address->setBarangay($this->formArray["barangay"]);
                 $address->setDistrict($this->formArray["district"]);
                 $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                 $address->setProvince($this->formArray["province"]);
                 $address->setDomDocument();
                 $propertyAdministrator = new Person();
                 //$propertyAdministrator->setPersonID($this->formArray["personID"]);
                 $propertyAdministrator->setLastName($this->formArray["lastName"]);
                 $propertyAdministrator->setFirstName($this->formArray["firstName"]);
                 $propertyAdministrator->setMiddleName($this->formArray["middleName"]);
                 //$propertyAdministrator->setGender($this->formArray["gender"]);
                 //$propertyAdministrator->setBirthday($this->birthdate);
                 //$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]);
                 //$propertyAdministrator->setTin($this->formArray["tin"]);
                 $propertyAdministrator->setAddressArray($address);
                 $propertyAdministrator->setTelephone($this->formArray["telephone"]);
                 //$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]);
                 $propertyAdministrator->setEmail($this->formArray["email"]);
                 $propertyAdministrator->setDomDocument();
                 $improvementsBuildings = new ImprovementsBuildings();
                 $improvementsBuildings->parseDomDocument($domDoc);
                 //$improvementsBuildings->setPropertyID($this->formArray["propertyID"]);
                 $improvementsBuildings->setAfsID($this->formArray["afsID"]);
                 $improvementsBuildings->setArpNumber($this->formArray["arpNumber"]);
                 $improvementsBuildings->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                 $improvementsBuildings->setPropertyAdministrator($propertyAdministrator);
                 $improvementsBuildings->setVerifiedBy($this->formArray["verifiedByID"]);
                 $improvementsBuildings->setPlottingsBy($this->formArray["plottingsByID"]);
                 $improvementsBuildings->setNotedBy($this->formArray["notedByID"]);
                 $improvementsBuildings->setMarketValue($this->formArray["marketValue"]);
                 $improvementsBuildings->setKind($this->formArray["kind"]);
                 $improvementsBuildings->setActualUse($this->formArray["actualUse"]);
                 $improvementsBuildings->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]);
                 $improvementsBuildings->setAssessmentLevel($this->formArray["assessmentLevel"]);
                 $improvementsBuildings->setAssessedValue($this->formArray["assessedValue"]);
                 $improvementsBuildings->setPreviousOwner($this->formArray["previousOwner"]);
                 $improvementsBuildings->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                 $improvementsBuildings->setTaxability($this->formArray["taxability"]);
                 $improvementsBuildings->setEffectivity($this->formArray["effectivity"]);
                 $improvementsBuildings->setAppraisedBy($this->formArray["appraisedByID"]);
                 $improvementsBuildings->setAppraisedByDate($this->formArray["appraisedByDate"]);
                 $improvementsBuildings->setRecommendingApproval($this->formArray["recommendingApprovalID"]);
                 $improvementsBuildings->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]);
                 $improvementsBuildings->setApprovedBy($this->formArray["approvedByID"]);
                 $improvementsBuildings->setApprovedByDate($this->formArray["approvedByDate"]);
                 $improvementsBuildings->setMemoranda($this->formArray["memoranda"]);
                 $improvementsBuildings->setPostingDate($this->formArray["postingDate"]);
                 $improvementsBuildings->setLandPin($this->formArray["landPin"]);
                 $improvementsBuildings->setFoundation($this->formArray["foundation"]);
                 $improvementsBuildings->setColumnsBldg($this->formArray["columnsBldg"]);
                 $improvementsBuildings->setBeams($this->formArray["beams"]);
                 $improvementsBuildings->setTrussFraming($this->formArray["trussFraming"]);
                 $improvementsBuildings->setRoof($this->formArray["roof"]);
                 $improvementsBuildings->setExteriorWalls($this->formArray["exteriorWalls"]);
                 $improvementsBuildings->setFlooring($this->formArray["flooring"]);
                 $improvementsBuildings->setDoors($this->formArray["doors"]);
                 $improvementsBuildings->setCeiling($this->formArray["ceiling"]);
                 $improvementsBuildings->setStructuralTypes($this->formArray["structuralTypes"]);
                 $improvementsBuildings->setBuildingClassification($this->formArray["buildingClassification"]);
                 $improvementsBuildings->setBuildingPermit($this->formArray["buildingPermit"]);
                 $improvementsBuildings->setBuildingAge($this->formArray["buildingAge"]);
                 $improvementsBuildings->setCctNumber($this->formArray["cctNumber"]);
                 $improvementsBuildings->setNumberOfStoreys($this->formArray["numberOfStoreys"]);
                 $improvementsBuildings->setWindows($this->formArray["windows"]);
                 $improvementsBuildings->setStairs($this->formArray["stairs"]);
                 $improvementsBuildings->setPartition($this->formArray["partition"]);
                 $improvementsBuildings->setWallFinish($this->formArray["wallFinish"]);
                 $improvementsBuildings->setElectrical($this->formArray["electrical"]);
                 $improvementsBuildings->setToiletAndBath($this->formArray["toiletAndBath"]);
                 $improvementsBuildings->setPlumbingSewer($this->formArray["plumbingSewer"]);
                 $improvementsBuildings->setFixtures($this->formArray["fixtures"]);
                 $improvementsBuildings->setDateConstructed($this->formArray["dateConstructed"]);
                 $improvementsBuildings->setDateOccupied($this->formArray["dateOccupied"]);
                 $improvementsBuildings->setDateCompleted($this->formArray["dateCompleted"]);
                 $improvementsBuildings->setAreaOfGroundFloor($this->formArray["areaOfGroundFloor"]);
                 $improvementsBuildings->setTotalBuildingArea($this->formArray["totalBuildingArea"]);
                 $improvementsBuildings->setUnitValue($this->formArray["unitValue"]);
                 $improvementsBuildings->setBuildingCoreAndAdditionalItems($this->formArray["buildingCoreAndAdditionalItems"]);
                 $improvementsBuildings->setAddItems($this->formArray["addItems"]);
                 $improvementsBuildings->setDepreciationRate($this->formArray["depreciationRate"]);
                 $improvementsBuildings->setAccumulatedDepreciation($this->formArray["accumulatedDepreciation"]);
                 $improvementsBuildings->setDepreciatedMarketValue($this->formArray["depreciatedMarketValue"]);
                 $improvementsBuildings->setCreatedBy($this->userID);
                 $improvementsBuildings->setModifiedBy($this->userID);
                 $improvementsBuildings->setDomDocument();
                 $doc = $improvementsBuildings->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 //echo $xmlStr;
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $ImprovementsBuildingsEncode->saveImprovementsBuildings($xmlStr))) {
                     echo "ret=" . $ret;
                 }
             }
             $this->formArray["propertyID"] = $ret;
             header("location: ImprovementsBuildingsClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         case "cancel":
             header("location: ImprovementsBuildingsList.php");
             exit;
             break;
         default:
             if (!($firstPropertyID = $this->getFirstPropertyID())) {
                 $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock");
                 $this->tpl->set_var("odIDBlock", "");
                 $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
                 $this->tpl->set_var("ACKBlock", "");
             } else {
                 $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
                 if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($firstPropertyID))) {
                     echo "xml failed";
                 } else {
                     //echo $xmlStr;
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                         $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                     } else {
                         $improvementsBuildings = new ImprovementsBuildings();
                         $improvementsBuildings->parseDomDocument($domDoc);
                         foreach ($improvementsBuildings as $key => $value) {
                             switch ($key) {
                                 case "propertyID":
                                     $this->formArray["propertyID"] = "";
                                     break;
                                 case "propertyAdministrator":
                                     if (is_a($value, Person)) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday());
                                         $this->formArray["personID"] = $value->getPersonID();
                                         $this->formArray["lastName"] = $value->getLastName();
                                         $this->formArray["firstName"] = $value->getFirstName();
                                         $this->formArray["middleName"] = $value->getMiddleName();
                                         $this->formArray["gender"] = $value->getGender();
                                         $this->formArray["birth_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["birth_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["birth_day"] = removePreZero($dateArr["day"]);
                                         $this->formArray["maritalStatus"] = $value->getMaritalStatus();
                                         $this->formArray["tin"] = $value->getTin();
                                         $this->formArray["addressID"] = $value->addressArray[0]->getAddressID();
                                         $this->formArray["number"] = $value->addressArray[0]->getNumber();
                                         $this->formArray["street"] = $value->addressArray[0]->getStreet();
                                         $this->formArray["barangay"] = $value->addressArray[0]->getBarangay();
                                         $this->formArray["district"] = $value->addressArray[0]->getDistrict();
                                         $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity();
                                         $this->formArray["province"] = $value->addressArray[0]->getProvince();
                                         $this->formArray["telephone"] = $value->getTelephone();
                                         $this->formArray["mobileNumber"] = $value->getMobileNumber();
                                         $this->formArray["email"] = $value->getEmail();
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "appraisedByDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["as_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["as_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["as_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "recommendingApprovalDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["re_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["re_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["re_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "approvedByDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["av_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["av_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["av_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateConstructed":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["dc_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["dc_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["dc_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateOccupied":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["do_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["do_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["do_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateCompleted":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["dm_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["dm_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["dm_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "arpNumber":
                                 case "propertyIndexNumber":
                                 case "propertyAdministrator":
                                 case "personID":
                                 case "lastName":
                                 case "firstName":
                                 case "middleName":
                                 case "gender":
                                 case "birth_month":
                                 case "birth_day":
                                 case "birth_year":
                                 case "maritalStatus":
                                 case "tin":
                                 case "addressID":
                                 case "number":
                                 case "street":
                                 case "barangay":
                                 case "district":
                                 case "municipalityCity":
                                 case "province":
                                 case "telephone":
                                 case "mobileNumber":
                                 case "email":
                                 case "verifiedByID":
                                 case "verifiedBy":
                                 case "verifiedByName":
                                 case "plottingsByID":
                                 case "plottingsBy":
                                 case "plottingsByName":
                                 case "notedByID":
                                 case "notedBy":
                                 case "notedByName":
                                 case "marketValue":
                                 case "kind":
                                 case "actualUse":
                                 case "adjustedMarketValue":
                                 case "assessmentLevel":
                                 case "assessedValue":
                                 case "previousOwner":
                                 case "previousAssessedValue":
                                 case "taxability":
                                 case "effectivity":
                                 case "appraisedByID":
                                 case "appraisedBy":
                                 case "appraisedByName":
                                 case "appraisedByDate":
                                 case "recommendingApprovalID":
                                 case "recommendingApproval":
                                 case "recommendingApprovalName":
                                 case "recommendingApprovalDate":
                                 case "approvedByID":
                                 case "approvedBy":
                                 case "approvedByName":
                                 case "approvedByDate":
                                 case "memoranda":
                                 case "postingDate":
                                 case "landPin":
                                 case "foundation":
                                 case "columnsBldg":
                                 case "beams":
                                 case "trussFraming":
                                 case "roof":
                                 case "exteriorWalls":
                                 case "flooring":
                                 case "doors":
                                 case "ceiling":
                                 case "structuralTypes":
                                 case "buildingClassification":
                                 case "buildingPermit":
                                 case "buildingAge":
                                 case "cctNumber":
                                 case "numberOfStoreys":
                                 case "windows":
                                 case "stairs":
                                 case "partition":
                                 case "wallFinish":
                                 case "electrical":
                                 case "toiletAndBath":
                                 case "plumbingSewer":
                                 case "fixtures":
                                 case "dateConstructed":
                                 case "dateOccupied":
                                 case "dateCompleted":
                                 case "areaOfGroundFloor":
                                 case "totalBuildingArea":
                                 case "unitValue":
                                 case "buildingCoreAndAdditionalItems":
                                 case "addItems":
                                 case "depreciationRate":
                                 case "accumulatedDepreciation":
                                 case "depreciatedMarketValue":
                                 case "as_month":
                                 case "as_day":
                                 case "as_year":
                                 case "re_month":
                                 case "re_day":
                                 case "re_year":
                                 case "av_month":
                                 case "av_day":
                                 case "av_year":
                                 case "dc_month":
                                 case "dc_day":
                                 case "dc_year":
                                 case "do_month":
                                 case "do_day":
                                 case "do_year":
                                 case "dm_month":
                                 case "dm_day":
                                 case "dm_year":
                                     $this->formArray[$key] = $value;
                                     break;
                             }
                         }
                     }
                 }
             }
     }
     $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");
 }
Ejemplo n.º 2
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
             if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($this->formArray["improvementsBuildingsID"]))) {
                 $this->tpl->set_block("rptsTemplate", "FORM", "FORMBlock");
                 $this->tpl->set_var("FORMBlock", "error xmlDoc");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "FORM", "FORMBlock");
                     $this->tpl->set_var("FORMBlock", "error xmlDoc");
                 } else {
                     $improvementsBuildings = new ImprovementsBuildings();
                     $improvementsBuildings->parseDomImprovementsBuildings($domDoc);
                     foreach ($improvementsBuildings as $key => $value) {
                         $this->formArray[$key] = $value;
                     }
                 }
             }
             break;
         case "save":
             $ImprovementsBuildingsEncode = new SoapObject(NCCBIZ . "ImprovementsBuildingsEncode.php", "urn:Object");
             if ($this->formArray["improvementsBuildingsID"] != "") {
                 $improvementsBuildings = new ImprovementsBuildings();
                 $improvementsBuildings->selectImprovementsBuildings($this->formArray["improvementsBuildingsID"]);
                 $improvementsBuildings->setImprovementsBuildingsID($this->formArray["improvementsBuildingsID"]);
                 $improvementsBuildings->setAfsID($this->formArray["afsID"]);
                 $improvementsBuildings->setSurveyNumber($this->formArray["surveyNumber"]);
                 $improvementsBuildings->setBuildingClassification($this->formArray["buildingClassification"]);
                 $improvementsBuildings->setBuildingPermit($this->formArray["buildingPermit"]);
                 $improvementsBuildings->setBuildingAge($this->formArray["buildingAge"]);
                 $improvementsBuildings->setDateOccupied($this->formArray["dateOccupied"]);
                 $improvementsBuildings->setDateCompleted($this->formArray["dateCompleted"]);
                 $improvementsBuildings->setAreaOfGroundFloor($this->formArray["areaOfGroundFloor"]);
                 $improvementsBuildings->setTotalBuildingArea($this->formArray["totalBuildingArea"]);
                 $improvementsBuildings->setMarketValue($this->formArray["marketValue"]);
                 $improvementsBuildings->setAssessmentLevel($this->formArray["assessmentLevel"]);
                 $improvementsBuildings->setAssessedValue($this->formArray["assessedValue"]);
                 $improvementsBuildings->setPurpose($this->formArray["purpose"]);
                 $improvementsBuildings->setDateAssessed($this->formArray["dateAssessed"]);
                 $improvementsBuildings->setAssessor($this->formArray["assessor"]);
                 $improvementsBuildings->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                 $improvementsBuildings->setDomImprovementsBuildings();
                 $doc = $improvementsBuildings->getDomImprovementsBuildings();
                 $xmlStr = $doc->dump_mem();
                 if (!($ret = $ImprovementsBuildingsEncode->updateImprovementsBuildings($xmlStr))) {
                     echo "error update";
                 }
                 header("location: ImprovementsBuildingsClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
                 //exit($this->formArray["afsID"]);
             } else {
                 $improvementsBuildings = new ImprovementsBuildings();
                 $improvementsBuildings->setAfsID($this->formArray["afsID"]);
                 $improvementsBuildings->setSurveyNumber($this->formArray["surveyNumber"]);
                 $improvementsBuildings->setBuildingClassification($this->formArray["buildingClassification"]);
                 $improvementsBuildings->setBuildingPermit($this->formArray["buildingPermit"]);
                 $improvementsBuildings->setBuildingAge($this->formArray["buildingAge"]);
                 $improvementsBuildings->setDateOccupied($this->formArray["dateOccupied"]);
                 $improvementsBuildings->setDateCompleted($this->formArray["dateCompleted"]);
                 $improvementsBuildings->setAreaOfGroundFloor($this->formArray["areaOfGroundFloor"]);
                 $improvementsBuildings->setTotalBuildingArea($this->formArray["totalBuildingArea"]);
                 $improvementsBuildings->setMarketValue($this->formArray["marketValue"]);
                 $improvementsBuildings->setAssessmentLevel($this->formArray["assessmentLevel"]);
                 $improvementsBuildings->setAssessedValue($this->formArray["assessedValue"]);
                 $improvementsBuildings->setPurpose($this->formArray["purpose"]);
                 $improvementsBuildings->setDateAssessed($this->formArray["dateAssessed"]);
                 $improvementsBuildings->setAssessor($this->formArray["assessor"]);
                 $improvementsBuildings->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                 $improvementsBuildings->setDomImprovementsBuildings();
                 $doc = $improvementsBuildings->getDomImprovementsBuildings();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $ImprovementsBuildingsEncode->saveImprovementsBuildings($xmlStr))) {
                     echo "puke<br>";
                 }
                 $this->formArray["improvementsBuildingsID"] = $ret;
                 header("location: ImprovementsBuildingsClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
                 exit("improvementsBuildingsID = {$ret}" . "<br>afsID=" . $this->formArray["afsID"]);
             }
             break;
         case "cancel":
             header("location: ImprovementsBuildingsList.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");
 }