function Main() { switch ($this->formArray["formAction"]) { case "remove": //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")"; $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) { if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) { $this->tpl->set_var("msg", "SOAP failed"); //echo "SOAP failed"; } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } //select $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { 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 { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $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); } } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID()); $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName()); $this->formArray["cityAssessorName"] = $cityAssessor->getFullName(); } else { $cityAssessor = $value; $this->tpl->set_var("cityAssessorID", $cityAssessor); $this->tpl->set_var("cityAssessorName", $cityAssessor); $this->formArray["cityAssessorName"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID()); $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName()); $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName(); } else { $cityTreasurer = $value; $this->tpl->set_var("cityTreasurerID", $cityTreasurer); $this->tpl->set_var("cityTreasurerName", $cityTreasurer); $this->formArray["cityTreasurerName"] = $cityTreasurer; } break; case "tdArray": $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $tdCtr = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); /* $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); */ foreach ($value as $tkey => $tvalue) { //foreach($tvalue as $column => $val){ // $this->tpl->set_var($column,$val); //} $this->tpl->set_var("taxDeclarationNumber", $tvalue->getTaxDeclarationNumber()); $this->tpl->set_var("afsID", $tvalue->getAfsID()); $this->tpl->set_var("cancelsTDNumber", $tvalue->getCancelsTDNumber()); $this->tpl->set_var("canceledByTDNumber", $tvalue->getCanceledByTDNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $tvalue->getTaxBeginsWithTheYear()); $this->tpl->set_var("ceasesWithTheYear", $tvalue->getCeasesWithTheYear()); $this->tpl->set_var("enteredInRPARForBy", $tvalue->getEnteredInRPARForBy()); $this->tpl->set_var("enteredInRPARForYear", $tvalue->getEnteredInRPARForYear()); $this->tpl->set_var("previousOwner", $tvalue->getPreviousOwner()); $this->tpl->set_var("previousAssessedValue", $tvalue->getPreviousAssessedValue()); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getProvincialAssessorDate()); $this->tpl->set_var("pa_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("pa_month", removePreZero($dateArr["month"])); $this->tpl->set_var("pa_dayValue", removePreZero($dateArr["day"])); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getCityMunicipalAssessorDate()); $this->tpl->set_var("cm_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("cm_month", removePreZero($dateArr["month"])); $this->tpl->set_var("cm_dayValue", removePreZero($dateArr["day"])); $this->tpl->set_var("provincialAssessorName", $tvalue->provincialAssessor); $this->tpl->set_var("cityMunicipalAssessorName", $tvalue->cityMunicipalAssessor); //$this->tpl->set_var("assessedValue",$tvalue->getAssessedValue()); $this->tpl->set_var("basicTax", ""); $this->tpl->set_var("sefTax", ""); $this->tpl->set_var("total", ""); //$this->tpl->set_var("basicTax",$tvalue->getBasicTax()); //$this->tpl->set_var("sefTax",$tvalue->getSefTax()); //$this->tpl->set_var("total",$tvalue->getTotal()); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFSForList($tvalue->getAfsID()))) { //$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); $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue(); $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue(); $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); } } $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("defaultTDListBlock", "defaultTDList", true); $this->tpl->parse("toggleTDListBlock", "toggleTDList", true); $this->tpl->parse("TDListBlock", "TDList", true); /* $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); */ $tdCtr++; } } else { $this->tpl->set_var("defaultTDListBlock", "//no default"); $this->tpl->set_var("toggleTDListBlock", "//no Toggle"); $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; case "landTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "landTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; default: $this->formArray[$key] = $value; } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; unset($rptop); $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $rptop = new RPTOP(); $rptop->setRptopID($this->formArray["rptopID"]); $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]); $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]); $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]); $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]); $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]); $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]); $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]); $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]); $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]); $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]); $rptop->setCreatedBy($this->userID); $rptop->setModifiedBy($this->userID); $rptop->setDomDocument(); $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object"); $rptop->setDomDocument(); $doc = $rptop->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $RPTOPEncode->updateRPTOPtotals($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("rptopID" => $this->formArray["rptopID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object"); if (!($xmlStr = $LandDetails->getLand($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 { $land = new Land(); $land->parseDomDocument($domDoc); foreach ($land 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(); $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 "verifiedBy": if (is_a($value, Assessor)) { $this->formArray["verifiedByID"] = $value->getAssessorID(); $this->formArray["verifiedByName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "plottingsBy": if (is_a($value, Assessor)) { $this->formArray["plottingsByID"] = $value->getAssessorID(); $this->formArray["plottingsByName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "notedBy": if (is_a($value, Assessor)) { $this->formArray["notedByID"] = $value->getAssessorID(); $this->formArray["notedByName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "appraisedBy": if (is_a($value, Assessor)) { $this->formArray["appraisedByID"] = $value->getAssessorID(); $this->formArray["appraisedByName"] = $value->getFullName(); } 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 "recommendingApproval": if (is_a($value, Assessor)) { $this->formArray["recommendingApprovalID"] = $value->getAssessorID(); $this->formArray["recommendingApprovalName"] = $value->getFullName(); } 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] = ""; } case "approvedBy": if (is_a($value, Assessor)) { $this->formArray["approvedByID"] = $value->getAssessorID(); $this->formArray["approvedByName"] = $value->getFullName(); } 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; default: $this->formArray[$key] = $value; } } } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function displayDetails($value) { //print_r($value); foreach ($value as $lkey => $lvalue) { switch ($lkey) { case "propertyAdministrator": if (is_a($lvalue, Person)) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue->getBirthday()); $this->tpl->set_var("personID", $lvalue->getPersonID()); $this->tpl->set_var("lastName", $lvalue->getLastName()); $this->tpl->set_var("firstName", $lvalue->getFirstName()); $this->tpl->set_var("middleName", $lvalue->getMiddleName()); $this->tpl->set_var("gender", $lvalue->getGender()); $this->tpl->set_var("birth_year", removePreZero($dateArr["year"])); $this->tpl->set_var("birth_month", removePreZero($dateArr["month"])); $this->tpl->set_var("birth_day", removePreZero($dateArr["day"])); $this->tpl->set_var("maritalStatus", $lvalue->getMaritalStatus()); $this->tpl->set_var("tin", $lvalue->getTin()); if (is_a($lvalue->addressArray[0], "address")) { $this->tpl->set_var("addressID", $lvalue->addressArray[0]->getAddressID()); $this->tpl->set_var("number", $lvalue->addressArray[0]->getNumber()); $this->tpl->set_var("street", $lvalue->addressArray[0]->getStreet()); $this->tpl->set_var("barangay", $lvalue->addressArray[0]->getBarangay()); $this->tpl->set_var("district", $lvalue->addressArray[0]->getDistrict()); $this->tpl->set_var("municipalityCity", $lvalue->addressArray[0]->getMunicipalityCity()); $this->tpl->set_var("province", $lvalue->addressArray[0]->getProvince()); } $this->tpl->set_var("telephone", $lvalue->getTelephone()); $this->tpl->set_var("mobileNumber", $lvalue->getMobileNumber()); $this->tpl->set_var("email", $lvalue->getEmail()); } else { $this->tpl->set_var($lkey, ""); } break; case "verifiedBy": if (is_numeric($lvalue)) { $verifiedBy = new Person(); $verifiedBy->selectRecord($lvalue); $this->tpl->set_var("verifiedByID", $verifiedBy->getPersonID()); $this->tpl->set_var("verifiedByName", $verifiedBy->getFullName()); } else { $verifiedBy = $lvalue; $this->tpl->set_var("verifiedByID", $verifiedBy); $this->tpl->set_var("verifiedByName", $verifiedBy); } break; case "plottingsBy": if (is_numeric($lvalue)) { $plottingsBy = new Person(); $plottingsBy->selectRecord($lvalue); $this->tpl->set_var("plottingsByID", $plottingsBy->getPersonID()); $this->tpl->set_var("plottingsByName", $plottingsBy->getFullName()); } else { $plottingsBy = $lvalue; $this->tpl->set_var("plottingsByID", $plottingsBy); $this->tpl->set_var("plottingsByName", $plottingsBy); } break; case "notedBy": if (is_numeric($lvalue)) { $notedBy = new Person(); $notedBy->selectRecord($lvalue); $this->tpl->set_var("notedByID", $notedBy->getPersonID()); $this->tpl->set_var("notedByName", $notedBy->getFullName()); } else { $notedBy = $lvalue; $this->tpl->set_var("notedByID", $notedBy); $this->tpl->set_var("notedByName", $notedBy); } break; case "appraisedBy": if (is_numeric($lvalue)) { $appraisedBy = new Person(); $appraisedBy->selectRecord($lvalue); $this->tpl->set_var("appraisedByID", $appraisedBy->getPersonID()); $this->tpl->set_var("appraisedByName", $appraisedBy->getFullName()); } else { $appraisedBy = $lvalue; $this->tpl->set_var("appraisedByID", $appraisedBy); $this->tpl->set_var("appraisedByName", $appraisedBy); } break; case "appraisedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("as_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("as_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("as_dayValue", removePreZero($dateArr["day"])); } else { $this->tpl->set_var("as_yearValue", ""); $this->tpl->set_var("as_month", ""); $this->tpl->set_var("as_dayValue", ""); } break; case "recommendingApproval": if (is_numeric($lvalue)) { $recommendingApproval = new Person(); $recommendingApproval->selectRecord($lvalue); $this->tpl->set_var("recommendingApprovalID", $recommendingApproval->getPersonID()); $this->tpl->set_var("recommendingApprovalName", $recommendingApproval->getFullName()); } else { $recommendingApproval = $lvalue; $this->tpl->set_var("recommendingApprovalID", $recommendingApproval); $this->tpl->set_var("recommendingApprovalName", $recommendingApproval); } break; case "recommendingApprovalDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("re_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("re_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("re_dayValue", removePreZero($dateArr["day"])); } else { $this->tpl->set_var("re_yearValue", ""); $this->tpl->set_var("re_month", ""); $this->tpl->set_var("re_dayValue", ""); } break; case "approvedBy": if (is_numeric($lvalue)) { $approvedBy = new Person(); $approvedBy->selectRecord($lvalue); $this->tpl->set_var("approvedByID", $approvedBy->getPersonID()); $this->tpl->set_var("approvedByName", $approvedBy->getFullName()); } else { $approvedBy = $lvalue; $this->tpl->set_var("approvedByID", $approvedBy); $this->tpl->set_var("approvedByName", $approvedBy); } break; case "approvedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("av_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("av_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("av_dayValue", removePreZero($dateArr["day"])); } else { $this->tpl->set_var("av_yearValue", ""); $this->tpl->set_var("av_month", ""); $this->tpl->set_var("av_dayValue", ""); } break; case "dateConstructed": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("dc_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("dc_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("dc_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateOccupied": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("do_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("do_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("do_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateCompleted": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("dm_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("dm_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("dm_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateAcquired": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("da_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("da_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("da_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateOfInstallation": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("di_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("di_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("di_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateOfOperation": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("do_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("do_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("do_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "propertyID": if (true) { //echo $lvalue."=>".get_class($value)."<br>"; switch (get_class($value)) { case "land": $propertyType = "Land"; break; case "improvementsbuildings": $propertyType = "ImprovementsBuildings"; break; case "plantstrees": $propertyType = "PlantsTrees"; break; case "machineries": $propertyType = "Machineries"; break; } $this->tpl->set_var($lkey, $lvalue); } else { $this->formArray[$key] = ""; } break; case "arpNumber": $lvalue = $lvalue ? $lvalue : ""; $this->tpl->set_var($lkey, $lvalue); break; case "adjustedMarketValue": case "valueAdjustment": case "marketValue": $this->tpl->set_var($lkey, number_format($lvalue, 2, '.', ',')); break; default: if ($lkey != "") { eval('$tmpval = $value->get' . ucfirst($lkey) . '();'); //echo '$tmpval = $value->get'.ucfirst($lkey).'();<br>'; $this->tpl->set_var($lkey, $tmpval); } } } }
function displayTDDetails($propertyType) { $afsID = $this->formArray["afsID"]; $propertyID = $this->formArray["propertyID"]; $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD("", $afsID, $propertyID, $propertyType))) { $this->formArray["tdNumber"] = ""; $this->formArray["tdID"] = ""; $this->formArray["propertyType"] = $propertyType; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->formArray["tdNumber"] = ""; $this->formArray["tdID"] = ""; $this->formArray["propertyType"] = $propertyType; } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["tdNumber"] = $td->getTaxDeclarationNumber(); //$this->formArray["effectivity"] = $td->taxBeginsWithTheYear(); foreach ($td as $tdkey => $tdvalue) { switch ($tdkey) { case "provincialAssessor": if (is_a($tdvalue, Assessor)) { $this->formArray["provincialAssessorID"] = $tdvalue->getAssessorID(); $this->formArray["provincialAssessorName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->formArray["pa_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["pa_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["pa_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray[$tdkey] = ""; } $this->formArray[$tdkey] = $tdvalue; //RC 20091007 break; case "cityMunicipalAssessor": if (is_a($tdvalue, Assessor)) { $this->formArray["cityMunicipalAssessorID"] = $tdvalue->getAssessorID(); $this->formArray["cityMunicipalAssessorName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->formArray["cm_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["cm_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["cm_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray[$tdkey] = ""; } $this->formArray[$tdkey] = $tdvalue; //RC 20091007 break; case "enteredInRPARForBy": if (is_a($tdvalue, Assessor)) { $this->formArray["enteredInRPARForByID"] = $tdvalue->getAssessorID(); $this->formArray["enteredInRPARForByName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "previousOwner": // RC 20091006 This case allows for extra info $posSlash = strpos($tdvalue, "/"); if ($posSlash !== false) { $this->formArray[$tdkey] = substr($tdvalue, 0, $posSlash); $this->formArray["previousOwnerExtra"] = substr($tdvalue, $posSlash + 1); } else { $this->formArray[$tdkey] = $tdvalue; } break; case "cancelsTDNumber": // RC 20091006 allow for extra info $posSlash = strpos($tdvalue, "/"); if ($posSlash !== false) { $this->formArray[$tdkey] = substr($tdvalue, 0, $posSlash); $this->formArray["cancelsTDNumberExtra"] = substr($tdvalue, $posSlash + 1); } else { $this->formArray[$tdkey] = $tdvalue; } break; default: $this->formArray[$tdkey] = $tdvalue; } } } } }
function displayTDDetails($propertyType) { $afsID = $this->formArray["afsID"]; $propertyID = $this->formArray["propertyID"]; $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD("", $afsID, $propertyID, $propertyType))) { $this->formArray["tdNumber"] = ""; $this->formArray["tdID"] = ""; $this->formArray["propertyType"] = $propertyType; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->formArray["tdNumber"] = ""; $this->formArray["tdID"] = ""; $this->formArray["propertyType"] = $propertyType; } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["tdNumber"] = $td->getTaxDeclarationNumber(); foreach ($td as $tdkey => $tdvalue) { switch ($tdkey) { case "provincialAssessor": if (is_a($tdvalue, Assessor)) { $this->formArray["provincialAssessorID"] = $tdvalue->getAssessorID(); $this->formArray["provincialAssessorName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->formArray["pa_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["pa_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["pa_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray[$tdkey] = ""; } break; case "cityMunicipalAssessor": if (is_a($tdvalue, Assessor)) { $this->formArray["cityMunicipalAssessorID"] = $tdvalue->getAssessorID(); $this->formArray["cityMunicipalAssessorName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->formArray["cm_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["cm_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["cm_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray[$tdkey] = ""; } break; case "enteredInRPARForBy": if (is_a($tdvalue, Assessor)) { $this->formArray["enteredInRPARForByID"] = $tdvalue->getAssessorID(); $this->formArray["enteredInRPARForByName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; default: $this->formArray[$tdkey] = $tdvalue; } } } } }
function displayDetails($value) { foreach ($value as $lkey => $lvalue) { switch ($lkey) { case "propertyAdministrator": if (is_a($lvalue, Person)) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue->getBirthday()); $this->tpl->set_var("personID", $lvalue->getPersonID()); $this->tpl->set_var("lastName", $lvalue->getLastName()); $this->tpl->set_var("firstName", $lvalue->getFirstName()); $this->tpl->set_var("middleName", $lvalue->getMiddleName()); $this->tpl->set_var("gender", $lvalue->getGender()); $this->tpl->set_var("birth_year", removePreZero($dateArr["year"])); $this->tpl->set_var("birth_month", removePreZero($dateArr["month"])); $this->tpl->set_var("birth_day", removePreZero($dateArr["day"])); $this->tpl->set_var("maritalStatus", $lvalue->getMaritalStatus()); $this->tpl->set_var("tin", $lvalue->getTin()); $this->tpl->set_var("addressID", $lvalue->addressArray[0]->getAddressID()); $this->tpl->set_var("number", $lvalue->addressArray[0]->getNumber()); $this->tpl->set_var("street", $lvalue->addressArray[0]->getStreet()); $this->tpl->set_var("barangay", $lvalue->addressArray[0]->getBarangay()); $this->tpl->set_var("district", $lvalue->addressArray[0]->getDistrict()); $this->tpl->set_var("municipalityCity", $lvalue->addressArray[0]->getMunicipalityCity()); $this->tpl->set_var("province", $lvalue->addressArray[0]->getProvince()); $this->tpl->set_var("telephone", $lvalue->getTelephone()); $this->tpl->set_var("mobileNumber", $lvalue->getMobileNumber()); $this->tpl->set_var("email", $lvalue->getEmail()); } else { $this->tpl->set_var($lkey, ""); } break; case "verifiedBy": if (is_a($lvalue, Assessor)) { $this->tpl->set_var("verifiedByID", $lvalue->getAssessorID()); $this->tpl->set_var("verifiedByName", $lvalue->getFullName()); } else { $this->tpl->set_var($lkey, ""); } break; case "plottingsBy": if (is_a($lvalue, Assessor)) { $this->tpl->set_var("plottingsByID", $lvalue->getAssessorID()); $this->tpl->set_var("plottingsByName", $lvalue->getFullName()); } else { $this->tpl->set_var($lkey, ""); } break; case "notedBy": if (is_a($lvalue, Assessor)) { $this->tpl->set_var("notedByID", $lvalue->getAssessorID()); $this->tpl->set_var("notedByName", $lvalue->getFullName()); } else { $this->tpl->set_var($lkey, ""); } break; case "appraisedBy": if (is_a($lvalue, Assessor)) { $this->tpl->set_var("appraisedByID", $lvalue->getAssessorID()); $this->tpl->set_var("appraisedByName", $lvalue->getFullName()); } else { $this->tpl->set_var($lkey, ""); } break; case "appraisedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("as_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("as_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("as_dayValue", removePreZero($dateArr["day"])); } else { $this->tpl->set_var($lkey, ""); } break; case "recommendingApproval": if (is_a($lvalue, Assessor)) { $this->tpl->set_var("recommendingApprovalID", $lvalue->getAssessorID()); $this->tpl->set_var("recommendingApprovalName", $lvalue->getFullName()); } else { $this->tpl->set_var($lkey, ""); } break; case "recommendingApprovalDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("re_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("re_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("re_dayValue", removePreZero($dateArr["day"])); } else { $this->tpl->set_var($lkey, ""); } case "approvedBy": if (is_a($lvalue, Assessor)) { $this->tpl->set_var("approvedByID", $lvalue->getAssessorID()); $this->tpl->set_var("approvedByName", $lvalue->getFullName()); } else { $this->tpl->set_var($lkey, ""); } break; case "approvedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("av_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("av_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("av_dayValue", removePreZero($dateArr["day"])); } else { $this->tpl->set_var($lkey, ""); } break; case "dateConstructed": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("dc_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("dc_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("dc_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateOccupied": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("do_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("do_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("do_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateCompleted": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("dm_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("dm_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("dm_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateAcquired": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("da_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("da_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("da_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateOfInstallation": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("di_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("di_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("di_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "dateOfOperation": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $lvalue); $this->tpl->set_var("do_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("do_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("do_dayValue", removePreZero($dateArr["day"])); } else { $this->formArray[$key] = ""; } break; case "propertyID": if (true) { switch (get_class($value)) { case "land": $propertyType = "Land"; break; case "improvementsbuildings": $propertyType = "ImprovementsBuildings"; break; case "plantstrees": $propertyType = "PlantsTrees"; break; case "machineries": $propertyType = "Machineries"; break; } $this->tpl->set_var($lkey, $lvalue); $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD("", $lvalue, $propertyType))) { $this->tpl->set_var("tdNumber", "enter TD"); $this->tpl->set_var("tdID", ""); $this->tpl->set_var("propertyType", $propertyType); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_var("tdNumber", "enter TD"); $this->tpl->set_var("tdID", ""); $this->tpl->set_var("propertyType", $propertyType); } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->tpl->set_var("tdNumber", $td->getTaxDeclarationNumber()); foreach ($td as $tdkey => $tdvalue) { switch ($tdkey) { case "provincialAssessor": if (is_a($tdvalue, Assessor)) { $this->tpl->set_var("provincialAssessorID", $tdvalue->getAssessorID()); $this->tpl->set_var("provincialAssessorName", $tdvalue->getFullName()); } else { $this->tpl->set_var($tdkey, ""); } break; case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->tpl->set_var("pa_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("pa_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("pa_dayValue", removePreZero($dateArr["day"])); } else { $this->tpl->set_var($tdkey, ""); } break; case "cityMunicipalAssessor": if (is_a($tdvalue, Assessor)) { $this->tpl->set_var("cityMunicipalAssessorID", $tdvalue->getAssessorID()); $this->tpl->set_var("cityMunicipalAssessorName", $tdvalue->getFullName()); } else { $this->tpl->set_var($tdkey, ""); } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->tpl->set_var("cm_yearValue", removePreZero($dateArr["year"])); eval(MONTH_ARRAY); //$monthArray $this->tpl->set_var("cm_month", $monthArray[removePreZero($dateArr["month"])]); $this->tpl->set_var("cm_dayValue", removePreZero($dateArr["day"])); } else { $this->tpl->set_var($tdkey, ""); } break; case "enteredInRPARForBy": if (is_a($tdvalue, Assessor)) { $this->tpl->set_var("enteredInRPARForByID", $tdvalue->getAssessorID()); $this->tpl->set_var("enteredInRPARForByName", $tdvalue->getFullName()); } else { $this->tpl->set_var($tdkey, ""); } break; default: $this->tpl->set_var($tdkey, $tdvalue); } } } } } else { $this->formArray[$key] = ""; } break; default: $this->tpl->set_var($lkey, $lvalue); } } }
function Main() { switch ($this->formArray["formAction"]) { case "remove": //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")"; $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) { if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) { $this->tpl->set_var("msg", "SOAP failed"); //echo "SOAP failed"; } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } //select $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { 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 { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $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); } } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID()); $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName()); $this->formArray["cityAssessorName"] = $cityAssessor->getFullName(); } else { $cityAssessor = $value; $this->tpl->set_var("cityAssessorID", $cityAssessor); $this->tpl->set_var("cityAssessorName", $cityAssessor); $this->formArray["cityAssessorName"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID()); $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName()); $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName(); } else { $cityTreasurer = $value; $this->tpl->set_var("cityTreasurerID", $cityTreasurer); $this->tpl->set_var("cityTreasurerName", $cityTreasurer); $this->formArray["cityTreasurerName"] = $cityTreasurer; } break; case "tdArray": $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("rptsTemplate", "JSTDList", "JSTDListBlock"); $this->tpl->set_block("TDList", "DueTypeList", "DueTypeListBlock"); $this->tpl->set_block("TDList", "BacktaxesList", "BacktaxesListBlock"); $this->tpl->set_block("JSTDList", "JSBacktaxesList", "JSBacktaxesListBlock"); $this->tpl->set_block("BacktaxesList", "BacktaxDueTypeList", "BacktaxDueTypeListBlock"); $tdCtr = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); foreach ($value as $tkey => $tvalue) { $this->tpl->set_var("tdID", $tvalue->getTDID()); $this->tpl->set_var("taxDeclarationNumber", $tvalue->getTaxDeclarationNumber()); $this->tpl->set_var("afsID", $tvalue->getAfsID()); $this->tpl->set_var("cancelsTDNumber", $tvalue->getCancelsTDNumber()); $this->tpl->set_var("canceledByTDNumber", $tvalue->getCanceledByTDNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $tvalue->getTaxBeginsWithTheYear()); $this->tpl->set_var("ceasesWithTheYear", $tvalue->getCeasesWithTheYear()); $this->tpl->set_var("enteredInRPARForBy", $tvalue->getEnteredInRPARForBy()); $this->tpl->set_var("enteredInRPARForYear", $tvalue->getEnteredInRPARForYear()); $this->tpl->set_var("previousOwner", $tvalue->getPreviousOwner()); $this->tpl->set_var("previousAssessedValue", $tvalue->getPreviousAssessedValue()); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getProvincialAssessorDate()); $this->tpl->set_var("pa_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("pa_month", removePreZero($dateArr["month"])); $this->tpl->set_var("pa_dayValue", removePreZero($dateArr["day"])); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getCityMunicipalAssessorDate()); $this->tpl->set_var("cm_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("cm_month", removePreZero($dateArr["month"])); $this->tpl->set_var("cm_dayValue", removePreZero($dateArr["day"])); $this->tpl->set_var("provincialAssessorName", $tvalue->provincialAssessor); $this->tpl->set_var("cityMunicipalAssessorName", $tvalue->cityMunicipalAssessor); $this->tpl->set_var("propertyType", $tvalue->getPropertyType()); $this->tpl->set_var("basicTax", ""); $this->tpl->set_var("sefTax", ""); $this->tpl->set_var("total", ""); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { // } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue(); $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue(); $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxability", $afs->getTaxability()); $this->tpl->set_var("effectivity", $afs->getEffectivity()); $this->formArray["idle"] = "No"; if ($tvalue->getPropertyType() == "Land") { if (is_array($afs->landArray)) { // if land is stripped if (count($afs->landArray) > 1) { foreach ($afs->landArray as $land) { if ($land->getIdle() == "Yes") { $this->formArray["idle"] = "Yes"; break; } } } else { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } if ($this->formArray["idle"] == "") { $this->formArray["idle"] = "No"; } $this->tpl->set_var("idle", $this->formArray["idle"]); } } // grab DueRecords from tdID $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object"); $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => ""); $this->tpl->set_var("dueYear", $rptop->getTaxableYear()); if (!($xmlStr = $DueList->getDueList($tvalue->getTdID(), $rptop->getTaxableYear()))) { foreach ($dueArrayList as $dueKey => $dueValue) { $this->tpl->set_var("basicTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("sefTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("idleTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("taxDue[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("dueDate[" . $dueKey . "]", "-"); } } else { if (!($domDoc = domxml_open_mem($xmlStr))) { foreach ($dueArrayList as $dueKey => $dueValue) { $this->tpl->set_var("basicTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("sefTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("idleTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("taxDue[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("dueDate[" . $dueKey . "]", "-"); } } else { $dueRecords = new DueRecords(); $dueRecords->parseDomDocument($domDoc); foreach ($dueRecords->getArrayList() as $due) { foreach ($due as $dueKey => $dueValue) { switch ($dueKey) { case "dueType": if ($dueValue == "Annual") { $this->formArray["totalTaxDue"] += $due->getTaxDue(); } $dueArrayList[$dueValue] = $due; $this->tpl->set_var("basicTax[" . $dueValue . "]", formatCurrency($due->getBasicTax())); $this->tpl->set_var("sefTax[" . $dueValue . "]", formatCurrency($due->getSEFTax())); $this->tpl->set_var("idleTax[" . $dueValue . "]", formatCurrency($due->getIdleTax())); $this->tpl->set_var("taxDue[" . $dueValue . "]", formatCurrency($due->getTaxDue())); $this->tpl->set_var("dueDate[" . $dueValue . "]", date("M. d, Y", strtotime($due->getDueDate()))); $this->tpl->set_var("dueID[" . $dueValue . "]", $due->getDueID()); break; } } } // initialize discountPeriod and discountPercentage for earlyPaymentDiscount $treasurySettings = $this->getTreasurySettings(); $this->tpl->set_var("discountPercentage", $treasurySettings->getDiscountPercentage() . "%"); $this->tpl->set_var("discountPeriod", "January 01, " . $rptop->getTaxableYear() . " - " . date("F d, Y", strtotime($rptop->getTaxableYear() . "-" . $treasurySettings->getDiscountPeriod()))); $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $this->formArray["discountPeriod_End"] = strtotime($rptop->getTaxableYear() . "-" . $this->formArray["discountPeriod"]); $this->formArray["discountPeriod_Start"] = strtotime($rptop->getTaxableYear() . "-01-01"); // initialize advancedDiscountPercentage for advancedPayment $this->tpl->set_var("advancedDiscountPercentage", $treasurySettings->getAdvancedDiscountPercentage() . "%"); $this->formArray["advancedDiscountPercentage"] = $treasurySettings->getAdvancedDiscountPercentage(); $this->tpl->set_var("q1AdvancedDiscountPercentage", $treasurySettings->getQ1AdvancedDiscountPercentage() . "%"); $this->formArray["q1AdvancedDiscountPercentage"] = $treasurySettings->getQ1AdvancedDiscountPercentage(); // initialize penaltyLUTArray $penaltyLUTArray = $this->getPenaltyLUTArray(); // get paymentHistory $defaultDueType = "Annual"; $allowableDueTypesArray = array("Annual", "Q1", "Q2", "Q3", "Q4"); /* alxjvr 2006.03.22 if(!$paymentHistory = $this->getPaymentHistory($dueArrayList,"")){ $defaultDueType = "Annual"; $allowableDueTypesArray = array("Annual","Q1"); } else{ $defaultDueType = $paymentHistory->arrayList[0]->getDueType(); if($defaultDueType=="Annual"){ $allowableDueTypesArray = array("Annual"); } else{ switch($defaultDueType){ case "Q1": $allowableDueTypesArray = array("Q1", "Q2"); break; case "Q2": $allowableDueTypesArray = array("Q2", "Q3"); break; case "Q3": $allowableDueTypesArray = array("Q3", "Q4"); break; case "Q4": $allowableDueTypesArray = array("Q4"); break; } } } */ foreach ($dueArrayList as $dKey => $due) { $dueArrayList[$dKey]->setEarlyPaymentDiscountPeriod($this->formArray["discountPeriod"]); $dueArrayList[$dKey]->setEarlyPaymentDiscountPercentage($this->formArray["discountPercentage"]); // compute earlyPaymentDiscount as of today // check if today is within the discountPeriod and compute Discount // AND if today is BEFORE annual dueDate $dueArrayList[$dKey]->setEarlyPaymentDiscount(0.0); if ($due->getDueType() == "Annual") { if (strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]) { if (strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } } } else { // if today is BEFORE dueDate if (strtotime($this->now) <= strtotime($due->getDueDate()) && strtotime($this->now) >= $this->formArray["discountPeriod_Start"]) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } // commented out: February 08, 2005 // earlyPaymentDiscount aren't given to Quarterly Dues except for Quarter 1 /* if($due->getDueType()=="Q1"){ if(strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]){ if(strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())){ $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"]/100)); } } } */ } // compute advancedPaymentDiscount as of today // check if today is BEFORE January 1 of the year of the annual dueDate $dueArrayList[$dKey]->setAdvancedPaymentDiscount(0.0); if (strtotime($this->now) < strtotime(date("Y", strtotime($dueArrayList[$dKey]->getDueDate())) . "-01-01")) { // for advanced payments, give 20% discount to annual dues [advanced discount] // give 10% discount to quarterly dues [early discount] if ($due->getDueType() == "Annual") { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["advancedDiscountPercentage"] / 100)); } else { // commented out: February 08, 2005 // advancedPaymentDiscount aren't given to Quarterly Dues // except for Quarter 1 if ($due->getDueType() == "Q1") { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["q1AdvancedDiscountPercentage"] / 100)); } else { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } } } $latestPaymentDate[$dKey] = $this->getLatestPaymentDateForDue($dueArrayList[$dKey]); $amountPaidForDue = $this->getAmountPaidForDue($dueArrayList); $amnestyStatus = $this->getAmnestyStatusForDue($dueArrayList); $totalEarlyPaymentDiscount = $this->getTotalEarlyPaymentDiscountForDue($dueArrayList); $totalAdvancedPaymentDiscount = $this->getTotalAdvancedPaymentDiscountForDue($dueArrayList); if ($totalEarlyPaymentDiscount > 0) { $earlyPaymentDiscountForDueType = $this->getTotalEarlyPaymentDiscountForDueType($dueArrayList[$dKey]); if ($earlyPaymentDiscountForDueType > 0) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($earlyPaymentDiscountForDueType); } } if ($totalAdvancedPaymentDiscount > 0) { $advancedPaymentDiscountForDueType = $this->getTotalAdvancedPaymentDiscountForDueType($dueArrayList[$dKey]); if ($advancedPaymentDiscountForDueType > 0) { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($advancedPaymentDiscountForDueType); } } if ($amnestyStatus) { $this->tpl->set_var("amnesty_status", "checked"); } else { $this->tpl->set_var("amnesty_status", ""); } // calculate Penalties verses either today or verses the last paymentDate if ($latestPaymentDate[$dKey] != "" || $latestPaymentDate[$dKey] != "now") { $dueArrayList[$dKey] = $this->computePenalty($latestPaymentDate[$dKey], $dueArrayList[$dKey]); // if balance is 0 leave penalty as is, otherwise calculatePenalty according to date now $balance = $dueArrayList[$dKey]->getInitialNetDue() - $amountPaidForDue; // 0.1 is used instead of 0 because sometimes rounded off balances intended to be 0 end up appearing as 0.002 or so... if (round($balance, 4) > 0.1) { $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]); } } else { $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]); } $this->tpl->set_var("advancedPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty())); $this->tpl->set_var("totalPaid[" . $dKey . "]", formatCurrency($this->getAmountPaidForDueID($dueArrayList[$dKey]->getDueID()))); $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getInitialNetDue())); $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue(); } // revert Back to Annual mode if Quarterly Dues have Penalties foreach ($dueArrayList as $dKey => $due) { if ($dKey != "Annual") { if ($dueArrayList[$dKey]->getPenalty() > 0) { $defaultDueType = "Annual"; $allowableDueTypesArray = array("Annual"); $revertedBackToAnnual = true; break; } } } foreach ($allowableDueTypesArray as $allowableDueType) { $this->tpl->set_var("allowableDueType", $allowableDueType); $this->tpl->parse("DueTypeListBlock", "DueTypeList", true); } $this->tpl->set_var("dueType[Annual]_status", "checked"); $this->tpl->set_var("dueType[Q1]_status", ""); $this->tpl->set_var("dueType[Q2]_status", ""); $this->tpl->set_var("dueType[Q3]_status", ""); $this->tpl->set_var("dueType[Q4]_status", ""); $this->tpl->set_var("dueDate", date("M. d, Y", strtotime($dueArrayList[$defaultDueType]->getDueDate()))); $this->tpl->set_var("basicTax", formatCurrency($dueArrayList[$defaultDueType]->getBasicTax())); $this->tpl->set_var("sefTax", formatCurrency($dueArrayList[$defaultDueType]->getSEFTax())); $this->tpl->set_var("idleTax", formatCurrency($dueArrayList[$defaultDueType]->getIdleTax())); $this->tpl->set_var("taxDue", formatCurrency($dueArrayList[$defaultDueType]->getTaxDue())); $this->tpl->set_var("advancedPaymentDiscount", formatCurrency($dueArrayList[$defaultDueType]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount", formatCurrency($dueArrayList[$defaultDueType]->getEarlyPaymentDiscount())); $this->tpl->set_var("penalty", formatCurrency($dueArrayList[$defaultDueType]->getPenalty())); // get amountPaid for defaultDueType // but if dues have been reverted back to "Annual" mode from "Quarterly" mode // get amountPaid for all the quarters that have been paid so far if ($revertedBackToAnnual) { $amountPaid = 0; $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Annual"]->getDueID()); $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Q1"]->getDueID()); $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Q2"]->getDueID()); $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Q3"]->getDueID()); $amountPaid += $this->getAmountpaidForDueID($dueArrayList["Q4"]->getDueID()); } else { $amountPaid = $this->getAmountPaidForDueID($dueArrayList[$defaultDueType]->getDueID()); } $this->tpl->set_var("amountPaid", formatCurrency($amountPaid)); $balance = $dueArrayList[$defaultDueType]->getTaxDue(); if ($dueArrayList[$defaultDueType]->getAdvancedPaymentDiscount() > 0) { $balance = $dueArrayList[$defaultDueType]->getTaxDue() - $dueArrayList[$defaultDueType]->getAdvancedPaymentDiscount(); } else { if ($dueArrayList[$defaultDueType]->getEarlyPaymentDiscount() > 0) { $balance = $dueArrayList[$defaultDueType]->getTaxDue() - $dueArrayList[$defaultDueType]->getEarlyPaymentDiscount(); } } $balance = round($balance + $dueArrayList[$defaultDueType]->getPenalty() - $amountPaid, 2); $this->tpl->set_var("balance", formatCurrency($balance)); } } // display Backtaxes and previousTD Backtaxes $this->formArray["totalBacktaxesBalance"] = 0; $this->displayBacktaxTD($tvalue->getTdID()); $precedingTDArray = $this->getPrecedingTDArray($tvalue); if (is_array($precedingTDArray)) { foreach ($precedingTDArray as $precedingTD) { $this->displayBacktaxTD($precedingTD->getTdID()); } } $this->tpl->set_var("total", number_format($this->formArray["totalBacktaxesDue"], 2)); $this->tpl->set_var("totalBacktaxesBalance", number_format($this->formArray["totalBacktaxesBalance"], 2)); // grab dueID's and backtaxTDID's to run through payments // create $dueIDArray foreach ($dueArrayList as $due) { $this->dueIDArray[] = $due->getDueID(); } $this->displayTotalPaid(); $this->displayNetDue(); $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("defaultTDListBlock", "defaultTDList", true); $this->tpl->parse("toggleTDListBlock", "toggleTDList", true); $this->tpl->parse("TDListBlock", "TDList", true); $this->tpl->parse("JSTDListBlock", "JSTDList", true); $this->tpl->set_var("DueTypeListBlock", ""); // added following line Feb.22,2005 to solve erpts issue (2005-22), backtaxTD blocking bug. $this->tpl->set_var("BacktaxesListBlock", ""); $tdCtr++; } } else { $this->tpl->set_var("defaultTDListBlock", "//no default"); $this->tpl->set_var("toggleTDListBlock", "//no Toggle"); $this->tpl->set_var("TDListBlock", ""); $this->tpl->set_var("JSTDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; case "landTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "landTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; default: $this->formArray[$key] = $value; } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; unset($rptop); $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $rptop = new RPTOP(); $rptop->setRptopID($this->formArray["rptopID"]); $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]); $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]); $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]); $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]); $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]); $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]); $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]); $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]); $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]); $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]); $rptop->setCreatedBy($this->userID); $rptop->setModifiedBy($this->userID); $rptop->setDomDocument(); $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object"); $rptop->setDomDocument(); $doc = $rptop->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $RPTOPEncode->updateRPTOPtotals($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", strtotime($this->now))); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "edit": $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object"); if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($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 { $plantsTrees = new PlantsTrees(); $plantsTrees->parseDomDocument($domDoc); foreach ($plantsTrees 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(); $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] = ""; } 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 "dateAcquired": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["da_year"] = removePreZero($dateArr["year"]); $this->formArray["da_month"] = removePreZero($dateArr["month"]); $this->formArray["da_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "dateOfInstallation": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["di_year"] = removePreZero($dateArr["year"]); $this->formArray["di_month"] = removePreZero($dateArr["month"]); $this->formArray["di_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "dateOfOperation": 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; 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"]); } $PlantsTreesEncode = new SoapObject(NCCBIZ . "PlantsTreesEncode.php", "urn:Object"); if ($this->formArray["propertyID"] != "") { $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object"); if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($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(); $plantsTrees = new PlantsTrees(); $plantsTrees->parseDomDocument($domDoc); $plantsTrees->setPropertyID($this->formArray["propertyID"]); $plantsTrees->setAfsID($this->formArray["afsID"]); $plantsTrees->setArpNumber($this->formArray["arpNumber"]); $plantsTrees->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]); $plantsTrees->setPropertyAdministrator($propertyAdministrator); $plantsTrees->setVerifiedBy($this->formArray["verifiedByID"]); $plantsTrees->setPlottingsBy($this->formArray["plottingsByID"]); $plantsTrees->setNotedBy($this->formArray["notedByID"]); $plantsTrees->setMarketValue($this->formArray["marketValue"]); $plantsTrees->setKind($this->formArray["kind"]); $plantsTrees->setActualUse($this->formArray["actualUse"]); $plantsTrees->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]); $plantsTrees->setAssessmentLevel($this->formArray["assessmentLevel"]); $plantsTrees->setAssessedValue($this->formArray["assessedValue"]); $plantsTrees->setPreviousOwner($this->formArray["previousOwner"]); $plantsTrees->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $plantsTrees->setTaxability($this->formArray["taxability"]); $plantsTrees->setEffectivity($this->formArray["effectivity"]); $plantsTrees->setAppraisedBy($this->formArray["appraisedByID"]); $plantsTrees->setAppraisedByDate($this->formArray["appraisedByDate"]); $plantsTrees->setRecommendingApproval($this->formArray["recommendingApprovalID"]); $plantsTrees->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]); $plantsTrees->setApprovedBy($this->formArray["approvedByID"]); $plantsTrees->setApprovedByDate($this->formArray["approvedByDate"]); $plantsTrees->setMemoranda($this->formArray["memoranda"]); $plantsTrees->setPostingDate($this->formArray["postingDate"]); $plantsTrees->setLandPin($this->formArray["landPin"]); $plantsTrees->setSurveyNumber($this->formArray["surveyNumber"]); $plantsTrees->setProductClass($this->formArray["productClass"]); $plantsTrees->setAreaPlanted($this->formArray["areaPlanted"]); $plantsTrees->setTotalNumber($this->formArray["totalNumber"]); $plantsTrees->setNonFruitBearing($this->formArray["nonFruitBearing"]); $plantsTrees->setFruitBearing($this->formArray["fruitBearing"]); $plantsTrees->setAge($this->formArray["age"]); $plantsTrees->setUnitPrice($this->formArray["unitPrice"]); $plantsTrees->setAdjustmentFactor($this->formArray["adjustmentFactor"]); $plantsTrees->setPercentAdjustment($this->formArray["percentAdjustment"]); $plantsTrees->setValueAdjustment($this->formArray["valueAdjustment"]); $plantsTrees->setCreatedBy($this->userID); $plantsTrees->setModifiedBy($this->userID); $plantsTrees->setDomDocument(); $doc = $plantsTrees->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $PlantsTreesEncode->updatePlantsTrees($xmlStr))) { exit("error update"); } } } } 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(); $plantsTrees = new PlantsTrees(); $plantsTrees->parseDomDocument($domDoc); //$plantsTrees->setPropertyID($this->formArray["propertyID"]); $plantsTrees->setAfsID($this->formArray["afsID"]); $plantsTrees->setArpNumber($this->formArray["arpNumber"]); $plantsTrees->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]); $plantsTrees->setPropertyAdministrator($propertyAdministrator); $plantsTrees->setVerifiedBy($this->formArray["verifiedByID"]); $plantsTrees->setPlottingsBy($this->formArray["plottingsByID"]); $plantsTrees->setNotedBy($this->formArray["notedByID"]); $plantsTrees->setMarketValue($this->formArray["marketValue"]); $plantsTrees->setKind($this->formArray["kind"]); $plantsTrees->setActualUse($this->formArray["actualUse"]); $plantsTrees->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]); $plantsTrees->setAssessmentLevel($this->formArray["assessmentLevel"]); $plantsTrees->setAssessedValue($this->formArray["assessedValue"]); $plantsTrees->setPreviousOwner($this->formArray["previousOwner"]); $plantsTrees->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $plantsTrees->setTaxability($this->formArray["taxability"]); $plantsTrees->setEffectivity($this->formArray["effectivity"]); $plantsTrees->setAppraisedBy($this->formArray["appraisedByID"]); $plantsTrees->setAppraisedByDate($this->formArray["appraisedByDate"]); $plantsTrees->setRecommendingApproval($this->formArray["recommendingApprovalID"]); $plantsTrees->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]); $plantsTrees->setApprovedBy($this->formArray["approvedByID"]); $plantsTrees->setApprovedByDate($this->formArray["approvedByDate"]); $plantsTrees->setMemoranda($this->formArray["memoranda"]); $plantsTrees->setPostingDate($this->formArray["postingDate"]); $plantsTrees->setLandPin($this->formArray["landPin"]); $plantsTrees->setSurveyNumber($this->formArray["surveyNumber"]); $plantsTrees->setProductClass($this->formArray["productClass"]); $plantsTrees->setAreaPlanted($this->formArray["areaPlanted"]); $plantsTrees->setTotalNumber($this->formArray["totalNumber"]); $plantsTrees->setNonFruitBearing($this->formArray["nonFruitBearing"]); $plantsTrees->setFruitBearing($this->formArray["fruitBearing"]); $plantsTrees->setAge($this->formArray["age"]); $plantsTrees->setUnitPrice($this->formArray["unitPrice"]); $plantsTrees->setAdjustmentFactor($this->formArray["adjustmentFactor"]); $plantsTrees->setPercentAdjustment($this->formArray["percentAdjustment"]); $plantsTrees->setValueAdjustment($this->formArray["valueAdjustment"]); $plantsTrees->setCreatedBy($this->userID); $plantsTrees->setModifiedBy($this->userID); $plantsTrees->setDomDocument(); $doc = $plantsTrees->getDomDocument(); $xmlStr = $doc->dump_mem(true); //exit($xmlStr); if (!($ret = $PlantsTreesEncode->savePlantsTrees($xmlStr))) { echo "ret=" . $ret; } } $this->formArray["propertyID"] = $ret; header("location: PlantsTreesClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"]))); exit; break; case "cancel": header("location: PlantsTreesList.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 { $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object"); if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($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 { $plantsTrees = new PlantsTrees(); $plantsTrees->parseDomDocument($domDoc); foreach ($plantsTrees 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] = ""; } 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 "dateAcquired": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["da_year"] = removePreZero($dateArr["year"]); $this->formArray["da_month"] = removePreZero($dateArr["month"]); $this->formArray["da_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "dateOfInstallation": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["di_year"] = removePreZero($dateArr["year"]); $this->formArray["di_month"] = removePreZero($dateArr["month"]); $this->formArray["di_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "dateOfOperation": 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 "arpNumber": case "propertyIndexNumber": 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 "surveyNumber": case "productClass": case "areaPlanted": case "totalNumber": case "nonFruitBearing": case "fruitBearing": case "age": case "unitPrice": case "adjustmentFactor": case "percentAdjustment": case "valueAdjustment": 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": $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"); }
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"); }
function Main() { //echo $this->formArray["formAction"]; switch ($this->formArray["formAction"]) { case "save": $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object"); if ($this->formArray["tdID"] != "") { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { $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 { $td = new TD(); $td->parseDomDocument($domDoc); $td->setTdID($this->formArray["tdID"]); $td->setAfsID($this->formArray["afsID"]); $td->setPropertyID($this->formArray["propertyID"]); $td->setPropertyType($this->formArray["propertyType"]); $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]); $td->setProvincialAssessor($this->formArray["provincialAssessorID"]); $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]); $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]); $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]); $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]); $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]); $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]); $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]); $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]); $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]); $td->setPreviousOwner($this->formArray["previousOwner"]); $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $td->setCreatedBy($this->userID); $td->setModifiedBy($this->userID); $td->setDomDocument(); $doc = $td->getDomDocument(); $xmlStr = $doc->dump_mem(true); //exit($xmlStr); if (!($ret = $TDEncode->updateTD($xmlStr))) { exit("error update"); } } } } else { $td = new TD(); $td->parseDomDocument($domDoc); //$td->setTdID($this->formArray["tdID"]); $td->setAfsID($this->formArray["afsID"]); $td->setPropertyID($this->formArray["propertyID"]); $td->setPropertyType($this->formArray["propertyType"]); $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]); $td->setProvincialAssessor($this->formArray["provincialAssessorID"]); $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]); $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]); $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]); $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]); $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]); $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]); $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]); $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]); $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]); $td->setPreviousOwner($this->formArray["previousOwner"]); $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $td->setCreatedBy($this->userID); $td->setModifiedBy($this->userID); $td->setDomDocument(); $doc = $td->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $TDEncode->saveTD($xmlStr))) { echo "Error saving"; } } $this->formArray["propertyID"] = $ret; header("location: TDClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"]))); exit($ret); break; case "cancel": header("location: TDList.php"); exit; break; default: if ($this->formArray["tdID"]) { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { 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 { $td = new TD(); $td->parseDomDocument($domDoc); foreach ($td as $key => $value) { switch ($key) { case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["pa_year"] = removePreZero($dateArr["year"]); $this->formArray["pa_month"] = removePreZero($dateArr["month"]); $this->formArray["pa_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["cm_year"] = removePreZero($dateArr["year"]); $this->formArray["cm_month"] = removePreZero($dateArr["month"]); $this->formArray["cm_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; default: //echo $key."=>".$value."<br>"; $this->formArray[$key] = $value; } } } } } $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("tdID" => $this->formArray["tdID"], "propertyType" => $this->formArray["propertyType"], "propertyID" => $this->formArray["propertyID"], "afsID" => $this->formArray["afsID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "edit": $PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object"); if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) { $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 { $person = new Person(); $person->parseDomDocument($domDoc); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $person->getBirthday()); $this->formArray["personID"] = $person->getPersonID(); $this->formArray["lastName"] = $person->getLastName(); $this->formArray["firstName"] = $person->getFirstName(); $this->formArray["middleName"] = $person->getMiddleName(); $this->formArray["gender"] = $person->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"] = $person->getMaritalStatus(); $this->formArray["tin"] = $person->getTin(); $address = $person->addressArray[0]; if (is_a($address, Address)) { $this->formArray["addressID"] = $address->getAddressID(); $this->formArray["number"] = $address->getNumber(); $this->formArray["street"] = $address->getStreet(); $this->formArray["barangay"] = $address->getBarangay(); $this->formArray["district"] = $address->getDistrict(); $this->formArray["municipalityCity"] = $address->getMunicipalitycity(); $this->formArray["province"] = $address->getProvince(); } $this->formArray["telephone"] = $person->getTelephone(); $this->formArray["mobileNumber"] = $person->getMobileNumber(); $this->formArray["email"] = $person->getEmail(); } } break; case "save": $PersonEncode = new SoapObject(NCCBIZ . "PersonEncode.php", "urn:Object"); if ($this->formArray["personID"] != "") { $PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object"); if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) { $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 { $person = new Person(); $person->parseDomDocument($domDoc); $address = $person->addressArray[0]; if (is_a($address, 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(); } $person->setPersonID($this->formArray["personID"]); $person->setLastName($this->formArray["lastName"]); $person->setFirstName($this->formArray["firstName"]); $person->setMiddleName($this->formArray["middleName"]); $person->setGender($this->formArray["gender"]); $person->setBirthday($this->birthdate); $person->setMaritalStatus($this->formArray["maritalStatus"]); $person->setTin($this->formArray["tin"]); $person->setAddressArray($address); $person->setTelephone($this->formArray["telephone"]); $person->setMobileNumber($this->formArray["mobileNumber"]); $person->setEmail($this->formArray["email"]); $person->setDomDocument(); $doc = $person->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $PersonEncode->updatePerson($xmlStr))) { exit("error update"); } } } } else { $address = new Address(); $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(); $person = new Person(); $person->setPersonID($this->formArray["personID"]); $person->setLastName($this->formArray["lastName"]); $person->setFirstName($this->formArray["firstName"]); $person->setMiddleName($this->formArray["middleName"]); $person->setGender($this->formArray["gender"]); $person->setBirthday($this->birthdate); $person->setMaritalStatus($this->formArray["maritalStatus"]); $person->setTin($this->formArray["tin"]); $person->setAddressArray($address); $person->setTelephone($this->formArray["telephone"]); $person->setMobileNumber($this->formArray["mobileNumber"]); $person->setEmail($this->formArray["email"]); $person->setDomDocument(); $doc = $person->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $this->formArray["ownerID"].$xmlStr; if (!($ret = $PersonEncode->savePerson($xmlStr, $this->formArray["ownerID"]))) { exit("error save"); } } $this->formArray["personID"] = $ret; header("location: ChangeOfOwnershipPropertyInfoClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "personID" => $ret, "formAction" => "view"))); exit; break; case "cancel": header("location: PersonList.php"); exit; break; default: if ($this->formArray["locID"]) { $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if (!($xmlStr = $ODDetails->getLocation($this->formArray["locID"]))) { exit("xml failed"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { } else { $loc = new LocationAddress(); $loc->parseDomDocument($domDoc); foreach ($loc as $key => $value) { $this->formArray[$key] = $value; } } } } $this->tpl->set_block("rptsTemplate", "personID", "personIDBlock"); $this->tpl->set_var("personIDBlock", ""); $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock"); $this->tpl->set_var("ACKBlock", ""); } $this->setForm(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "edit": $UserDetails = new SoapObject(NCCBIZ . "UserDetails.php", "urn:Object"); if (!($xmlStr = $UserDetails->getUserDetails($this->formArray["userID"]))) { $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", "User 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 { $user = new User(); $user->parseDomDocument($domDoc); $this->formArray["userID"] = $user->getUserID(); $this->formArray["userType"] = $user->getUserType(); $this->formArray["username"] = $user->getUsername(); $this->formArray["password"] = $user->getPassword(); $this->formArray["personID"] = $user->getPersonID(); $this->formArray["status"] = $user->getStatus(); } } $PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object"); if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) { $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", "Person 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 { $person = new Person(); $person->parseDomDocument($domDoc); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $person->getBirthday()); $this->formArray["personID"] = $person->getPersonID(); $this->formArray["lastName"] = $person->getLastName(); $this->formArray["firstName"] = $person->getFirstName(); $this->formArray["middleName"] = $person->getMiddleName(); $this->formArray["gender"] = $person->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"] = $person->getMaritalStatus(); $this->formArray["tin"] = $person->getTin(); $address = $person->addressArray[0]; if (is_a($address, Address)) { $this->formArray["addressID"] = $address->getAddressID(); $this->formArray["number"] = $address->getNumber(); $this->formArray["street"] = $address->getStreet(); $this->formArray["barangay"] = $address->getBarangay(); $this->formArray["district"] = $address->getDistrict(); $this->formArray["municipalityCity"] = $address->getMunicipalitycity(); $this->formArray["province"] = $address->getProvince(); } $this->formArray["telephone"] = $person->getTelephone(); $this->formArray["mobileNumber"] = $person->getMobileNumber(); $this->formArray["email"] = $person->getEmail(); } } $this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock"); $this->tpl->set_var("NewUserPasswordBlock", ""); $this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock"); $this->tpl->set_var("oldNewUserRowspan", 5); //$this->tpl->set_var("oldNewUserRowspan", 3); $this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true); break; case "save": /* if($this->isOldPasswordCorrect()==false){ $this->message = "Error. Cannot Save. Old password incorrect to create new password."; $this->tpl->set_var("message", $this->message); $this->tpl->parse("MessageBlock", "Message", true); $this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock"); $this->tpl->set_var("NewUserPasswordBlock", ""); $this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock"); $this->tpl->set_var("oldNewUserRowspan", 3); $this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true); break; } */ if ($this->formArray["newPassword"] != "" && $this->formArray["newPassword"] != "null") { $this->formArray["password"] = md5($this->formArray["newPassword"]); } if ($this->usernameAlreadyExists() == true) { $this->message = "Error. Cannot Save. Username already exists."; $this->tpl->set_var("message", $this->message); $this->tpl->parse("MessageBlock", "Message", true); $this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock"); $this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock"); if ($this->formArray["personID"] != "") { $this->tpl->set_var("NewUserPasswordBlock", ""); $this->tpl->set_var("oldNewUserRowspan", 3); $this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true); } else { $this->tpl->set_var("oldNewUserRowspan", 2); $this->tpl->parse("NewUserPasswordBlock", "NewUserPassword", true); $this->tpl->set_var("OldUserPasswordBlock", ""); } break; } $PersonEncode = new SoapObject(NCCBIZ . "PersonEncode.php", "urn:Object"); if ($this->formArray["personID"] != "") { $PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object"); if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) { $this->tpl->set_block("rptsTemplate", "Table", "TableBlock"); $this->tpl->set_var("TableBlock", "Person 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 { $person = new Person(); $person->parseDomDocument($domDoc); $address = $person->addressArray[0]; if (is_a($address, 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(); } $person->setPersonID($this->formArray["personID"]); $person->setPersonType("adminUser"); $person->setLastName($this->formArray["lastName"]); $person->setFirstName($this->formArray["firstName"]); $person->setMiddleName($this->formArray["middleName"]); $person->setGender($this->formArray["gender"]); $person->setBirthday($this->birthdate); $person->setMaritalStatus($this->formArray["maritalStatus"]); $person->setTin($this->formArray["tin"]); $person->setAddressArray($address); $person->setTelephone($this->formArray["telephone"]); $person->setMobileNumber($this->formArray["mobileNumber"]); $person->setEmail($this->formArray["email"]); $person->setDomDocument(); $doc = $person->getDomDocument(); //echo $doc->html_dump_mem(); $xmlStr = $doc->dump_mem(true); if (!($ret = $PersonEncode->updatePerson($xmlStr))) { exit("error update"); } } } } else { $address = new Address(); $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(); $person = new Person(); $person->setPersonID($this->formArray["personID"]); $person->setPersonType("adminUser"); $person->setLastName($this->formArray["lastName"]); $person->setFirstName($this->formArray["firstName"]); $person->setMiddleName($this->formArray["middleName"]); $person->setGender($this->formArray["gender"]); $person->setBirthday($this->birthdate); $person->setMaritalStatus($this->formArray["maritalStatus"]); $person->setTin($this->formArray["tin"]); $person->setAddressArray($address); $person->setTelephone($this->formArray["telephone"]); $person->setMobileNumber($this->formArray["mobileNumber"]); $person->setEmail($this->formArray["email"]); $person->setDomDocument(); $doc = $person->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $this->formArray["ownerID"].$xmlStr; if (!($ret = $PersonEncode->savePerson($xmlStr, $this->formArray["ownerID"]))) { exit("error save"); } } $this->formArray["personID"] = $ret; $UserEncode = new SoapObject(NCCBIZ . "UserEncode.php", "urn:Object"); if ($this->formArray["userID"] != "") { $UserDetails = new SoapObject(NCCBIZ . "UserDetails.php", "urn:Object"); if (!($xmlStr = $UserDetails->getUserDetails($this->formArray["userID"]))) { exit("User 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 { $user = new User(); $user->parseDomDocument($domDoc); $user->setUserID($this->formArray["userID"]); $user->setUserType($this->formArray["userType"]); $user->setUsername($this->formArray["username"]); $user->setPassword($this->formArray["password"]); $user->setPersonID($this->formArray["personID"]); $user->setStatus($this->formArray["status"]); $user->setDomDocument(); $doc = $user->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $UserEncode->updateUser($xmlStr))) { exit("error update"); } } } } else { $user = new User(); //$user->setUserID($this->formArray["userID"]); $user->setUserType($this->formArray["userType"]); $user->setUsername($this->formArray["username"]); $user->setPassword(md5($this->formArray["password"])); $user->setPersonID($this->formArray["personID"]); $user->setStatus($this->formArray["status"]); $user->setDomDocument(); $doc = $user->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $UserEncode->saveUser($xmlStr))) { exit("error save"); } } header("location: UserClose.php" . $this->sess->url("")); exit; break; case "cancel": header("location: UserClose.php" . $this->sess->url("")); exit; break; default: $this->tpl->set_block("rptsTemplate", "UserID", "UserIDBlock"); $this->tpl->set_var("UserIDBlock", ""); $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock"); $this->tpl->set_var("ACKBlock", ""); $this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock"); $this->tpl->set_var("oldNewUserRowspan", 2); $this->tpl->parse("NewUserPasswordBlock", "NewUserPassword", true); $this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock"); $this->tpl->set_var("OldUserPasswordBlock", ""); } $this->setForm(); if ($this->message == "") { $this->tpl->set_var("MessageBlock", ""); } $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "remove": //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")"; $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) { if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) { $this->tpl->set_var("msg", "SOAP failed"); //echo "SOAP failed"; } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } //select $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { 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 { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $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); } } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID()); $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName()); $this->formArray["cityAssessorName"] = $cityAssessor->getFullName(); } else { $cityAssessor = $value; $this->tpl->set_var("cityAssessorID", $cityAssessor); $this->tpl->set_var("cityAssessorName", $cityAssessor); $this->formArray["cityAssessorName"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID()); $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName()); $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName(); } else { $cityTreasurer = $value; $this->tpl->set_var("cityTreasurerID", $cityTreasurer); $this->tpl->set_var("cityTreasurerName", $cityTreasurer); $this->formArray["cityTreasurerName"] = $cityTreasurer; } break; case "tdArray": $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("TDList", "BacktaxesList", "BacktaxesListBlock"); $tdCtr = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); /* $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); */ foreach ($value as $tkey => $tvalue) { //foreach($tvalue as $column => $val){ // $this->tpl->set_var($column,$val); //} $this->tpl->set_var("tdID", $tvalue->getTDID()); $this->tpl->set_var("taxDeclarationNumber", $tvalue->getTaxDeclarationNumber()); $this->tpl->set_var("afsID", $tvalue->getAfsID()); $this->tpl->set_var("cancelsTDNumber", $tvalue->getCancelsTDNumber()); $this->tpl->set_var("canceledByTDNumber", $tvalue->getCanceledByTDNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $tvalue->getTaxBeginsWithTheYear()); $this->tpl->set_var("ceasesWithTheYear", $tvalue->getCeasesWithTheYear()); $this->tpl->set_var("enteredInRPARForBy", $tvalue->getEnteredInRPARForBy()); $this->tpl->set_var("enteredInRPARForYear", $tvalue->getEnteredInRPARForYear()); $this->tpl->set_var("previousOwner", $tvalue->getPreviousOwner()); $this->tpl->set_var("previousAssessedValue", $tvalue->getPreviousAssessedValue()); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getProvincialAssessorDate()); $this->tpl->set_var("pa_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("pa_month", removePreZero($dateArr["month"])); $this->tpl->set_var("pa_dayValue", removePreZero($dateArr["day"])); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getCityMunicipalAssessorDate()); $this->tpl->set_var("cm_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("cm_month", removePreZero($dateArr["month"])); $this->tpl->set_var("cm_dayValue", removePreZero($dateArr["day"])); $this->tpl->set_var("provincialAssessorName", $tvalue->provincialAssessor); $this->tpl->set_var("cityMunicipalAssessorName", $tvalue->cityMunicipalAssessor); //$this->tpl->set_var("assessedValue",$tvalue->getAssessedValue()); $this->tpl->set_var("propertyType", $tvalue->getPropertyType()); $this->tpl->set_var("basicTax", ""); $this->tpl->set_var("sefTax", ""); $this->tpl->set_var("total", ""); //$this->tpl->set_var("basicTax",$tvalue->getBasicTax()); //$this->tpl->set_var("sefTax",$tvalue->getSefTax()); //$this->tpl->set_var("total",$tvalue->getTotal()); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { //$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); $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue(); $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue(); $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxability", $afs->getTaxability()); $this->tpl->set_var("effectivity", $afs->getEffectivity()); $this->formArray["idle"] = "No"; if ($tvalue->getPropertyType() == "Land") { if (is_array($afs->landArray)) { // if land is stripped if (count($afs->landArray) > 1) { foreach ($afs->landArray as $land) { if ($land->getIdle() == "Yes") { $this->formArray["idle"] = "Yes"; break; } } } else { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } if ($this->formArray["idle"] == "") { $this->formArray["idle"] = "No"; } $this->tpl->set_var("idle", $this->formArray["idle"]); } } // grab DueRecords from tdID $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object"); $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => ""); if (!($xmlStr = $DueList->getDueList($tvalue->getTdID(), $rptop->getTaxableYear()))) { if ($this->formArray["rptopID"] != "") { $redirectMessage = "Dues are uncalculated. <a href='CalculateRPTOPDetails.php" . $this->sess->url("") . "&rptopID=" . $this->formArray["rptopID"] . "'>Click here</a> to go to calculation page or <a href='SOA.php" . $this->sess->url("") . "'>return to list</a>."; } else { $redirectMessage = "Dues are uncalculated. <a href='SOA.php" . $this->sess->url("") . "'>Click here</a> to return to list."; } exit($redirectMessage); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { if ($this->formArray["rptopID"] != "") { $redirectMessage = "Dues are uncalculated. <a href='CalculateRPTOPDetails.php" . $this->sess->url("") . "&rptopID=" . $this->formArray["rptopID"] . "'>Click here</a> to go to calculation page or <a href='SOA.php" . $this->sess->url("") . "'>return to list</a>."; } else { $redirectMessage = "Dues are uncalculated. <a href='SOA.php" . $this->sess->url("") . "'>Click here</a> to return to list."; } exit($redirectMessage); } else { $dueRecords = new DueRecords(); $dueRecords->parseDomDocument($domDoc); foreach ($dueRecords->getArrayList() as $due) { foreach ($due as $dueKey => $dueValue) { switch ($dueKey) { case "dueType": if ($dueValue == "Annual") { $this->formArray["totalTaxDue"] += $due->getTaxDue(); } $dueArrayList[$dueValue] = $due; $this->tpl->set_var("basicTax[" . $dueValue . "]", formatCurrency($due->getBasicTax())); $this->tpl->set_var("sefTax[" . $dueValue . "]", formatCurrency($due->getSEFTax())); $this->tpl->set_var("idleTax[" . $dueValue . "]", formatCurrency($due->getIdleTax())); $this->tpl->set_var("taxDue[" . $dueValue . "]", formatCurrency($due->getTaxDue())); $this->tpl->set_var("dueDate[" . $dueValue . "]", date("M. d, Y", strtotime($due->getDueDate()))); $dueDateYear = date("Y", strtotime($due->getDueDate())); break; } } } $treasurySettings = new TreasurySettings(); $treasurySettings->selectRecord(); // initialize discountPeriod and discountPercentage for earlyPaymentDiscount $this->tpl->set_var("discountPercentage", $treasurySettings->getDiscountPercentage() . "%"); $this->tpl->set_var("discountPeriod", "January 01, " . $dueDateYear . " - " . date("F d, Y", strtotime($dueDateYear . "-" . $treasurySettings->getDiscountPeriod()))); $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $this->formArray["discountPeriod_End"] = strtotime($dueDateYear . "-" . $this->formArray["discountPeriod"]); $this->formArray["discountPeriod_Start"] = strtotime($dueDateYear . "-01-01"); // initialize advancedDiscountPercentage for advancedPayment $this->tpl->set_var("advancedDiscountPercentage", $treasurySettings->getAdvancedDiscountPercentage() . "%"); $this->formArray["advancedDiscountPercentage"] = $treasurySettings->getAdvancedDiscountPercentage(); $this->tpl->set_var("q1AdvancedDiscountPercentage", $treasurySettings->getQ1AdvancedDiscountPercentage() . "%"); $this->formArray["q1AdvancedDiscountPercentage"] = $treasurySettings->getQ1AdvancedDiscountPercentage(); // initialize penaltyLUTArray $penaltyLUTArray = $treasurySettings->getPenaltyLUT(); $this->penaltyLUTArray = $treasurySettings->getPenaltyLUT(); foreach ($dueArrayList as $dKey => $due) { $dueArrayList[$dKey]->setEarlyPaymentDiscountPeriod($this->formArray["discountPeriod"]); $dueArrayList[$dKey]->setEarlyPaymentDiscountPercentage($this->formArray["discountPercentage"]); // compute earlyPaymentDiscount as of today // check if today is within the discountPeriod and compute Discount // AND if today is BEFORE annual dueDate $dueArrayList[$dKey]->setEarlyPaymentDiscount(0.0); if ($due->getDueType() == "Annual") { if (strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]) { if (strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } } } else { // if today is BEFORE dueDate if (strtotime($this->now) <= strtotime($due->getDueDate()) && strtotime($this->now) >= $this->formArray["discountPeriod_Start"]) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } // commented out Febuary 08, 2005 : Provide Quarterly Discounts // earlyPaymentDiscount aren't given to Quarterly Dues except for Quarter 1 /* if($due->getDueType()=="Q1"){ if(strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]){ if(strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())){ $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"]/100)); } } } */ } // compute advancedPaymentDiscount as of today // check if today is BEFORE January 1 of the year of the annual dueDate $dueArrayList[$dKey]->setAdvancedPaymentDiscount(0.0); if (strtotime($this->now) < strtotime(date("Y", strtotime($dueArrayList[$dKey]->getDueDate())) . "-01-01")) { // for advanced payments, give 20% discount to annual dues [advanced discount] // give 10% discount to quarterly dues [early discount] if ($due->getDueType() == "Annual") { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["advancedDiscountPercentage"] / 100)); } else { if ($due->getDueType() == "Q1") { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["q1AdvancedDiscountPercentage"] / 100)); } else { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } // commented out: February 08, 2005 // advancedPaymentDiscount aren't given to Quarterly Dues except for Quarter 1 /* if($due->getDueType()=="Q1"){ $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["q1AdvancedDiscountPercentage"]/100)); } */ } } $latestPaymentDate[$dKey] = $this->getLatestPaymentDateForDue($dueArrayList[$dKey]); $amountPaidForDue = $this->getAmountPaidForDue($dueArrayList); $latestPaymentDueType = $this->getLatestPaymentDueType($dueArrayList); $amnestyStatus[$dKey] = $this->getAmnestyStatusForDue($dueArrayList[$dKey]); $totalEarlyPaymentDiscount = $this->getTotalEarlyPaymentDiscountForDue($dueArrayList); $totalAdvancedPaymentDiscount = $this->getTotalAdvancedPaymentDiscountForDue($dueArrayList); if ($totalEarlyPaymentDiscount > 0) { $earlyPaymentDiscountForDueType = $this->getTotalEarlyPaymentDiscountForDueType($dueArrayList[$dKey]); if ($earlyPaymentDiscountForDueType > 0) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($earlyPaymentDiscountForDueType); } } if ($totalAdvancedPaymentDiscount > 0) { $advancedPaymentDiscountForDueType = $this->getTotalAdvancedPaymentDiscountForDueType($dueArrayList[$dKey]); if ($advancedPaymentDiscountForDueType > 0) { $dueArrayList[$dKey]->setAdvancedPaymentDiscount($advancedPaymentDiscountForDueType); } } // calculate Penalties verses either today or verses the last paymentDate if ($latestPaymentDate[$dKey] != "" || $latestPaymentDate[$dKey] != "now") { $dueArrayList[$dKey] = $this->computePenalty($latestPaymentDate[$dKey], $dueArrayList[$dKey]); // if balance is 0 leave penalty as is, otherwise calculatePenalty according to date now $balance = round($dueArrayList[$dKey]->getInitialNetDue() - $amountPaidForDue, 4); // 0.1 is used instead of 0 because a lot of balances may end up as 0.002 or so... if ($balance > 0.1) { $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]); } } else { $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]); } //print_r($dueArrayList[$dKey]); //echo "<hr>"; $this->tpl->set_var("advancedPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty())); $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue(); if ($amnestyStatus[$dKey]) { $this->initialNetDue[$dKey] -= $dueArrayList[$dKey]->getPenalty(); $this->tpl->set_var("amnesty[" . $dKey . "]", "Yes"); } else { $this->tpl->set_var("amnesty[" . $dKey . "]", "No"); } $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($this->initialNetDue[$dKey])); } // out of the loop, // verify balances to make disable penalties and discounts for Annual if ALL QUARTERS have been paid // and to disable penalties and discounts for Quarters if ALL of ANNUAL has been paid // example: Q1, Q2, Q3 and Q4 have been fully paid. Annual should not show any payables. // Likewise if Annual has been fully paid, Q1, Q2, Q3 and Q4 should not show any payables. $totalQuarterlyNetDue = 0; $totalQuarterlyNetDue += $dueArrayList["Q1"]->getBasicTax() + $dueArrayList["Q1"]->getSefTax() + $dueArrayList["Q1"]->getIdleTax(); $totalQuarterlyNetDue -= $dueArrayList["Q1"]->getEarlyPaymentDiscount() + $dueArrayList["Q1"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Q1"]) { $totalQuarterlyNetDue += $dueArrayList["Q1"]->getPenalty(); } $totalQuarterlyNetDue += $dueArrayList["Q2"]->getBasicTax() + $dueArrayList["Q2"]->getSefTax() + $dueArrayList["Q2"]->getIdleTax(); $totalQuarterlyNetDue -= $dueArrayList["Q2"]->getEarlyPaymentDiscount() + $dueArrayList["Q2"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Q2"]) { $totalQuarterlyNetDue += $dueArrayList["Q2"]->getPenalty(); } $totalQuarterlyNetDue += $dueArrayList["Q3"]->getBasicTax() + $dueArrayList["Q3"]->getSefTax() + $dueArrayList["Q3"]->getIdleTax(); $totalQuarterlyNetDue -= $dueArrayList["Q3"]->getEarlyPaymentDiscount() + $dueArrayList["Q3"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Q3"]) { $totalQuarterlyNetDue += $dueArrayList["Q3"]->getPenalty(); } $totalQuarterlyNetDue += $dueArrayList["Q4"]->getBasicTax() + $dueArrayList["Q4"]->getSefTax() + $dueArrayList["Q4"]->getIdleTax(); $totalQuarterlyNetDue -= $dueArrayList["Q4"]->getEarlyPaymentDiscount() + $dueArrayList["Q4"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Q4"]) { $totalQuarterlyNetDue += $dueArrayList["Q4"]->getPenalty(); } $totalAnnualNetDue = 0; $totalAnnualNetDue += $dueArrayList["Annual"]->getBasicTax() + $dueArrayList["Annual"]->getSefTax() + $dueArrayList["Annual"]->getIdleTax(); $totalAnnualNetDue -= $dueArrayList["Annual"]->getEarlyPaymentDiscount() + $dueArrayList["Annual"]->getAdvancedPaymentDiscount(); if (!$amnestyStatus["Annual"]) { $totalAnnualNetDue += $dueArrayList["Annual"]->getPenalty(); } if ($latestPaymentDueType != "Annual" && $totalQuarterlyNetDue - $amountPaidForDue <= 0) { // all QUARTERLY DUES have been paid, modify Annual Due values $dueArrayList["Annual"]->setAdvancedPaymentDiscount(0); $dueArrayList["Annual"]->setEarlyPaymentDiscount(0); $dueArrayList["Annual"]->setMonthsOverDue(0); $dueArrayList["Annual"]->setPenaltyPercentage(0); $dueArrayList["Annual"]->setPenalty(0); $this->initialNetDue["Annual"] = $dueArrayList["Annual"]->getInitialNetDue(); $this->tpl->set_var("advancedPaymentDiscount[Annual]", formatCurrency($dueArrayList["Annual"]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount[Annual]", formatCurrency($dueArrayList["Annual"]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[Annual]", $dueArrayList["Annual"]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[Annual]", $dueArrayList["Annual"]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[Annual]", formatCurrency($dueArrayList["Annual"]->getPenalty())); $this->tpl->set_var("amnesty[Annual]", "No"); $this->tpl->set_var("initialNetDue[Annual]", formatCurrency($this->initialNetDue["Annual"])); } else { if ($latestPaymentDueType == "Annual" && $totalAnnualNetDue - $amountPaidForDue <= 0) { // all of ANNUAL Due has been fully paid, modify Quarterly Due values $quarterlyDueKeys = array("Q1", "Q2", "Q3", "Q4"); foreach ($quarterlyDueKeys as $dKey) { $dueArrayList[$dKey]->setAdvancedPaymentDiscount(0); $dueArrayList[$dKey]->setEarlyPaymentDiscount(0); $dueArrayList[$dKey]->setMonthsOverDue(0); $dueArrayList[$dKey]->setPenaltyPercentage(0); $dueArrayList[$dKey]->setPenalty(0); $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue(); $this->tpl->set_var("advancedPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getAdvancedPaymentDiscount())); $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty())); $this->tpl->set_var("amnesty[" . $dKey . "]", "No"); $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($this->initialNetDue[$dKey])); } } } } } // display Backtaxes and previousTD Backtaxes $this->formArray["totalBacktaxesBalance"] = 0; $this->displayBacktaxTD($tvalue->getTdID()); $precedingTDArray = $this->getPrecedingTDArray($tvalue); if (is_array($precedingTDArray)) { foreach ($precedingTDArray as $precedingTD) { $this->displayBacktaxTD($precedingTD->getTdID()); } } $this->tpl->set_var("total", number_format($this->formArray["totalBacktaxesDue"], 2)); $this->tpl->set_var("totalBacktaxesBalance", number_format($this->formArray["totalBacktaxesBalance"], 2)); // grab dueID's and backtaxTDID's to run through payments // create $dueIDArray foreach ($dueArrayList as $due) { $this->dueIDArray[] = $due->getDueID(); } $this->displayTotalPaid(); $this->displayNetDue(); $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("defaultTDListBlock", "defaultTDList", true); $this->tpl->parse("toggleTDListBlock", "toggleTDList", true); $this->tpl->parse("TDListBlock", "TDList", true); $this->tpl->set_var("BacktaxesListBlock", ""); /* $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); */ $tdCtr++; } } else { $this->tpl->set_var("defaultTDListBlock", "//no default"); $this->tpl->set_var("toggleTDListBlock", "//no Toggle"); $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; case "landTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "landTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; default: $this->formArray[$key] = $value; } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; unset($rptop); $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $rptop = new RPTOP(); $rptop->setRptopID($this->formArray["rptopID"]); $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]); $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]); $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]); $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]); $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]); $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]); $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]); $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]); $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]); $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]); $rptop->setCreatedBy($this->userID); $rptop->setModifiedBy($this->userID); $rptop->setDomDocument(); $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object"); $rptop->setDomDocument(); $doc = $rptop->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $RPTOPEncode->updateRPTOPtotals($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", strtotime($this->now))); // $this->tpl->set_var("Session", $this->sess->url("").$this->sess->add_query(array("rptopID"=>$this->formArray["rptopID"],"ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "remove": //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")"; $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) { if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) { $this->tpl->set_var("msg", "SOAP failed"); //echo "SOAP failed"; } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } //select $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { 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 { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); //print_r($rptop); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $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); } } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID()); $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName()); $this->formArray["cityAssessorName"] = $cityAssessor->getFullName(); } else { $cityAssessor = $value; $this->tpl->set_var("cityAssessorID", $cityAssessor); $this->tpl->set_var("cityAssessorName", $cityAssessor); $this->formArray["cityAssessorName"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID()); $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName()); $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName(); } else { $cityTreasurer = $value; $this->tpl->set_var("cityTreasurerID", $cityTreasurer); $this->tpl->set_var("cityTreasurerName", $cityTreasurer); $this->formArray["cityTreasurerName"] = $cityTreasurer; } break; case "tdArray": $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $tdCtr = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); /* $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); */ foreach ($value as $tkey => $tvalue) { //foreach($tvalue as $column => $val){ // $this->tpl->set_var($column,$val); //} $this->tpl->set_var("tdID", $tvalue->getTDID()); $this->tpl->set_var("taxDeclarationNumber", $tvalue->getTaxDeclarationNumber()); $this->tpl->set_var("afsID", $tvalue->getAfsID()); $this->tpl->set_var("cancelsTDNumber", $tvalue->getCancelsTDNumber()); $this->tpl->set_var("canceledByTDNumber", $tvalue->getCanceledByTDNumber()); $this->tpl->set_var("taxBeginsWithTheYear", $tvalue->getTaxBeginsWithTheYear()); $this->tpl->set_var("ceasesWithTheYear", $tvalue->getCeasesWithTheYear()); $this->tpl->set_var("enteredInRPARForBy", $tvalue->getEnteredInRPARForBy()); $this->tpl->set_var("enteredInRPARForYear", $tvalue->getEnteredInRPARForYear()); $this->tpl->set_var("previousOwner", $tvalue->getPreviousOwner()); $this->tpl->set_var("previousAssessedValue", $tvalue->getPreviousAssessedValue()); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getProvincialAssessorDate()); $this->tpl->set_var("pa_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("pa_month", removePreZero($dateArr["month"])); $this->tpl->set_var("pa_dayValue", removePreZero($dateArr["day"])); list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tvalue->getCityMunicipalAssessorDate()); $this->tpl->set_var("cm_yearValue", removePreZero($dateArr["year"])); $this->tpl->set_var("cm_month", removePreZero($dateArr["month"])); $this->tpl->set_var("cm_dayValue", removePreZero($dateArr["day"])); $this->tpl->set_var("provincialAssessorName", $tvalue->provincialAssessor); $this->tpl->set_var("cityMunicipalAssessorName", $tvalue->cityMunicipalAssessor); //$this->tpl->set_var("assessedValue",$tvalue->getAssessedValue()); $this->tpl->set_var("propertyType", $tvalue->getPropertyType()); $this->tpl->set_var("basicTax", ""); $this->tpl->set_var("sefTax", ""); $this->tpl->set_var("total", ""); //$this->tpl->set_var("basicTax",$tvalue->getBasicTax()); //$this->tpl->set_var("sefTax",$tvalue->getSefTax()); //$this->tpl->set_var("total",$tvalue->getTotal()); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) { //$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); $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue(); $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue(); $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue(); $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue(); $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue(); $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue(); $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue(); $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue(); $this->formArray["totalMarketValue"] += $afs->getTotalMarketValue(); $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue(); $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ',')); $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ',')); $this->tpl->set_var("taxability", $afs->getTaxability()); $this->tpl->set_var("effectivity", $afs->getEffectivity()); $this->formArray["idle"] = "No"; if ($tvalue->getPropertyType() == "Land") { if (is_array($afs->landArray)) { // if land is stripped if (count($afs->landArray) > 1) { foreach ($afs->landArray as $land) { if ($land->getIdle() == "Yes") { $this->formArray["idle"] = "Yes"; break; } } } else { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } if ($this->formArray["idle"] == "") { $this->formArray["idle"] = "No"; } $this->tpl->set_var("idle", $this->formArray["idle"]); } } // grab DueRecords from tdID $this->formArray["totalTaxDue"] = 0.0; $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object"); $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => ""); if (!($xmlStr = $DueList->getDueList($tvalue->getTdID()))) { foreach ($dueArrayList as $dueKey => $dueValue) { $this->tpl->set_var("basicTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("sefTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("idleTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("taxDue[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("dueDate[" . $dueKey . "]", "-"); } } else { if (!($domDoc = domxml_open_mem($xmlStr))) { foreach ($dueArrayList as $dueKey => $dueValue) { $this->tpl->set_var("basicTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("sefTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("idleTax[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("taxDue[" . $dueKey . "]", "uncalculated"); $this->tpl->set_var("dueDate[" . $dueKey . "]", "-"); } } else { $dueRecords = new DueRecords(); $dueRecords->parseDomDocument($domDoc); foreach ($dueRecords->getArrayList() as $due) { foreach ($due as $dueKey => $dueValue) { switch ($dueKey) { case "dueType": if ($dueValue == "Annual") { $this->formArray["totalTaxDue"] += $due->getTaxDue(); } $dueArrayList[$dueValue] = $due; $this->tpl->set_var("basicTax[" . $dueValue . "]", formatCurrency($due->getBasicTax())); $this->tpl->set_var("sefTax[" . $dueValue . "]", formatCurrency($due->getSEFTax())); $this->tpl->set_var("idleTax[" . $dueValue . "]", formatCurrency($due->getIdleTax())); $this->tpl->set_var("taxDue[" . $dueValue . "]", formatCurrency($due->getTaxDue())); $this->tpl->set_var("dueDate[" . $dueValue . "]", date("M. d, Y", strtotime($due->getDueDate()))); break; } } } $treasurySettings = new TreasurySettings(); $treasurySettings->selectRecord(); // initialize discountPeriod and discountPercentage for earlyPaymentDiscount $this->tpl->set_var("discountPercentage", $treasurySettings->getDiscountPercentage() . "%"); $this->tpl->set_var("discountPeriod", "January 01, " . date("Y") . " - " . date("F d, Y", strtotime(date("Y") . "-" . $treasurySettings->getDiscountPeriod()))); $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $this->formArray["discountPeriod_End"] = strtotime(date("Y") . "-" . $this->formArray["discountPeriod"]); $this->formArray["discountPeriod_Start"] = strtotime(date("Y") . "-01-01"); // initialize penaltyLUTArray $penaltyLUTArray = $treasurySettings->getPenaltyLUT(); foreach ($dueArrayList as $dKey => $due) { $dueArrayList[$dKey]->setEarlyPaymentDiscountPeriod($this->formArray["discountPeriod"]); $dueArrayList[$dKey]->setEarlyPaymentDiscountPercentage($this->formArray["discountPercentage"]); // compute earlyPaymentDiscount as of today // check if today is within the discountPeriod and compute Discount if (strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]) { $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100)); } else { $dueArrayList[$dKey]->setEarlyPaymentDiscount(0.0); } // compute Penalty as of today // check if today is exceeding dueDate and compute penalty if (strtotime($this->now) > strtotime($dueArrayList[$dKey]->getDueDate())) { // count months // numYears = today[year] - dueDate[year] $numYears = date("Y", strtotime($this->now)) - date("Y", strtotime($dueArrayList[$dKey]->getDueDate())); // numMonths = today[month] - dueDate[month] $numMonths = date("n", strtotime($this->now)) - date("n", strtotime($dueArrayList[$dKey]->getDueDate())); // totalMonths = (numYears*12) + numMonths $totalMonths = $numYears * 12 + $numMonths; // associate penaltyPercentage if ($totalMonths >= count($penaltyLUTArray)) { $penaltyPercentage = 0.72; } else { $penaltyPercentage = $penaltyLUTArray[$totalMonths]; } $penalty = $dueArrayList[$dKey]->getTaxDue() * $penaltyPercentage; $dueArrayList[$dKey]->setMonthsOverDue($totalMonths); $dueArrayList[$dKey]->setPenaltyPercentage($penaltyPercentage); $dueArrayList[$dKey]->setPenalty($penalty); } else { $dueArrayList[$dKey]->setMonthsOverDue(0); $dueArrayList[$dKey]->setPenaltyPercentage(0.0); $dueArrayList[$dKey]->setPenalty(0.0); } $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount())); $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue()); $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100); $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty())); } $this->tpl->set_var("netDue", formatCurrency($dueArrayList["Annual"]->getNetDue())); } } $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("defaultTDListBlock", "defaultTDList", true); $this->tpl->parse("toggleTDListBlock", "toggleTDList", true); $this->tpl->parse("TDListBlock", "TDList", true); /* $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); */ $tdCtr++; } } else { $this->tpl->set_var("defaultTDListBlock", "//no default"); $this->tpl->set_var("toggleTDListBlock", "//no Toggle"); $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; case "landTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "landTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; default: $this->formArray[$key] = $value; } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; unset($rptop); $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $rptop = new RPTOP(); $rptop->setRptopID($this->formArray["rptopID"]); $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]); $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]); $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]); $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]); $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]); $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]); $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]); $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]); $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]); $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]); $rptop->setCreatedBy($this->userID); $rptop->setModifiedBy($this->userID); $rptop->setDomDocument(); $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object"); $rptop->setDomDocument(); $doc = $rptop->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $RPTOPEncode->updateRPTOPtotals($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", strtotime($this->now))); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { //echo $this->formArray["formAction"]; switch ($this->formArray["formAction"]) { case "save": $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object"); if ($this->formArray["tdID"] != "") { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { $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 { $td = new TD(); $td->parseDomDocument($domDoc); $td->setTdID($this->formArray["tdID"]); $td->setAfsID($this->formArray["afsID"]); $td->setPropertyID($this->formArray["propertyID"]); $td->setPropertyType($this->formArray["propertyType"]); $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]); $td->setProvincialAssessor($this->formArray["provincialAssessorID"]); $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]); $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]); $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]); $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]); $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]); $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]); $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]); $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]); $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]); $td->setPreviousOwner($this->formArray["previousOwner"]); $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $td->setMemoranda($this->formArray["memoranda"]); $td->setCreatedBy($this->userID); $td->setModifiedBy($this->userID); $td->setDomDocument(); $doc = $td->getDomDocument(); $xmlStr = $doc->dump_mem(true); //exit($xmlStr); if (!($ret = $TDEncode->updateTD($xmlStr))) { exit("error update"); } } } } else { $td = new TD(); $td->parseDomDocument($domDoc); //$td->setTdID($this->formArray["tdID"]); $td->setAfsID($this->formArray["afsID"]); $td->setPropertyID($this->formArray["propertyID"]); $td->setPropertyType($this->formArray["propertyType"]); $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]); $td->setProvincialAssessor($this->formArray["provincialAssessorID"]); $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]); $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]); $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]); $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]); $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]); $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]); $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]); $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]); $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]); $td->setPreviousOwner($this->formArray["previousOwner"]); $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $td->setMemoranda($this->formArray["memoranda"]); $td->setCreatedBy($this->userID); $td->setModifiedBy($this->userID); $td->setDomDocument(); $doc = $td->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $TDEncode->saveTD($xmlStr))) { echo "Error saving"; } } $this->formArray["propertyID"] = $ret; header("location: TDClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"]))); exit($ret); break; case "cancel": header("location: TDList.php"); exit; break; default: if ($this->formArray["tdID"]) { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { 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 { $td = new TD(); $td->parseDomDocument($domDoc); if ($td->getCancelsTDNumber() == "") { $td = $this->updateTDCancelsTDNumber($td); } if ($td->getCanceledByTDNumber() == "") { $td = $this->updateTDCanceledByTDNumber($td); } foreach ($td as $key => $value) { switch ($key) { case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["pa_year"] = removePreZero($dateArr["year"]); $this->formArray["pa_month"] = removePreZero($dateArr["month"]); $this->formArray["pa_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["cm_year"] = removePreZero($dateArr["year"]); $this->formArray["cm_month"] = removePreZero($dateArr["month"]); $this->formArray["cm_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "propertyType": // so it wont go to the default loop. so that propertyType can refresh from the GET input break; default: //echo $key."=>".$value."<br>"; $this->formArray[$key] = $value; } } } } } else { $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // domDoc empty } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["taxDeclarationNumber"] = $afs->getARPNumber(); $this->formArray["odID"] = $afs->getOdID(); // default cancelsTDNumber and canceledByTDNumber $cancelsTDNumberArray = $this->getCancelsTDNumberArray(); if (is_array($cancelsTDNumberArray)) { $this->formArray["cancelsTDNumber"] = implode(", ", $cancelsTDNumberArray); } $canceledByTDNumberArray = $this->getCanceledByTDNumberArray(); if (is_array($canceledByTDNumberArray)) { $this->formArray["canceledByTDNumber"] = implode(", ", $canceledByTDNumberArray); } // default memoranda from properties $this->formArray["memoranda"] = ""; if (is_array($afs->landArray)) { if (is_object($afs->landArray[0])) { if ($afs->landArray[0]->memoranda != "") { $this->formArray["memoranda"] .= "Land Memo:\n" . $afs->landArray[0]->memoranda; } } } if (is_array($afs->plantsTreesArray)) { if (is_object($afs->plantsTreesArray[0])) { if ($afs->plantsTreesArray[0]->memoranda != "") { $this->formArray["memoranda"] .= "\nPlants Trees Memo:\n" . $afs->plantsTreesArray[0]->memoranda; } } } if (is_array($afs->improvementsBuildingsArray)) { if (is_object($afs->improvementsBuildingsArray[0])) { if ($afs->improvementsBuildingsArray[0]->memoranda != "") { $this->formArray["memoranda"] .= "\nImprovements/Buildings Memo:\n" . $afs->improvementsBuildingsArray[0]->memoranda; } } } if (is_array($afs->machineriesArray)) { if (is_object($afs->machineriesArray[0])) { if ($afs->machineriesArray[0]->memoranda != "") { $this->formArray["memoranda"] .= "\nMachineries Memo:\n" . $afs->machineriesArray[0]->memoranda; } } } } } } $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("tdID" => $this->formArray["tdID"], "propertyType" => $this->formArray["propertyType"], "propertyID" => $this->formArray["propertyID"], "afsID" => $this->formArray["afsID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }