function ImprovementsBuildingsEncode($http_post_vars, $afsID = "", $type, $propertyID = "", $formAction = "", $sess)
 {
     global $auth;
     $this->sess = $sess;
     $this->userID = $auth->auth["uid"];
     $this->tpl = new rpts_Template(getcwd(), "keep");
     $rptsTemplate = "ImprovementsBuildingsEncode.htm";
     $assessmentSettings = new AssessmentSettings();
     if ($assessmentSettings->selectRecord()) {
         $autoCalculate = $assessmentSettings->getAutoCalculate();
         if ($autoCalculate == "false") {
             $rptsTemplate = "ImprovementsBuildingsEncode_AutoCalculateOFF.htm";
         }
     }
     $this->tpl->set_file("rptsTemplate", $rptsTemplate);
     $this->tpl->set_var("TITLE", "Encode ImprovementsBuildings");
     $this->formArray = array("afsID" => $afsID, "propertyID" => $propertyID, "type" => $type, "arpNumber" => "", "propertyIndexNumber" => "", "propertyAdministrator" => "", "personID" => "", "lastName" => "", "firstName" => "", "middleName" => "", "gender" => "", "birth_month" => "", "birth_day" => "", "birth_year" => "", "maritalStatus" => "", "tin" => "", "addressID" => "", "number" => "", "street" => "", "barangay" => "", "district" => "", "municipalityCity" => "", "province" => "", "telephone" => "", "mobileNumber" => "", "email" => "", "verifiedByID" => "", "verifiedBy" => "", "verifiedByName" => "", "plottingsByID" => "", "plottingsBy" => "", "plottingsByName" => "", "notedByID" => "", "notedBy" => "", "notedByName" => "", "marketValue" => "", "kind" => "", "actualUse" => "", "adjustedMarketValue" => "", "assessmentLevel" => "", "assessedValue" => "", "previousOwner" => "", "previousAssessedValue" => "", "taxability" => "", "effectivity" => "", "appraisedByID" => "", "appraisedBy" => "", "appraisedByName" => "", "appraisedByDate" => "", "recommendingApprovalID" => "", "recommendingApproval" => "", "recommendingApprovalName" => "", "recommendingApprovalDate" => "", "approvedByID" => "", "approvedBy" => "", "approvedByName" => "", "approvedByDate" => "", "memoranda" => "", "postingDate" => "", "landPin" => "", "foundation" => "", "columnsBldg" => "", "beams" => "", "trussFraming" => "", "roof" => "", "exteriorWalls" => "", "flooring" => "", "doors" => "", "ceiling" => "", "structuralTypes" => "", "buildingClassification" => "", "buildingPermit" => "", "buildingAge" => "", "cctNumber" => "", "numberOfStoreys" => "", "windows" => "", "stairs" => "", "partition" => "", "wallFinish" => "", "electrical" => "", "toiletAndBath" => "", "plumbingSewer" => "", "fixtures" => "", "dateConstructed" => "", "dateOccupied" => "", "dateCompleted" => "", "areaOfGroundFloor" => "", "totalBuildingArea" => "", "unitValue" => "", "buildingCoreAndAdditionalItems" => "", "addItems" => "", "depreciationRate" => "", "accumulatedDepreciation" => "", "depreciatedMarketValue" => "", "as_month" => "", "as_day" => "", "as_year" => "", "re_month" => "", "re_day" => "", "re_year" => "", "av_month" => "", "av_day" => "", "av_year" => "", "dc_month" => "", "dc_day" => "", "dc_year" => "", "do_month" => "", "do_day" => "", "do_year" => "", "dm_month" => "", "dm_day" => "", "dm_year" => "", "formAction" => $formAction);
     foreach ($http_post_vars as $key => $value) {
         $this->formArray[$key] = $value;
         //echo $key." = ".$this->formArray[$key]."<br>";
     }
     $as_dateStr = $this->getDateStr("as_year", "as_month", "as_day");
     $this->formArray["appraisedByDate"] = $as_dateStr;
     $re_dateStr = $this->getDateStr("re_year", "re_month", "re_day");
     $this->formArray["recommendingApprovalDate"] = $re_dateStr;
     $av_dateStr = $this->getDateStr("av_year", "av_month", "av_day");
     $this->formArray["approvedByDate"] = $av_dateStr;
     $dc_dateStr = $this->getDateStr("dc_year", "dc_month", "dc_day");
     $this->formArray["dateConstructed"] = $dc_dateStr;
     $do_dateStr = $this->getDateStr("do_year", "do_month", "do_day");
     $this->formArray["dateOccupied"] = $do_dateStr;
     $dm_dateStr = $this->getDateStr("dm_year", "dm_month", "dm_day");
     $this->formArray["dateCompleted"] = $dm_dateStr;
 }
Exemple #2
0
 function LandEncode($http_post_vars, $afsID = "", $propertyID = "", $formAction = "", $sess)
 {
     global $auth;
     $this->sess = $sess;
     $this->userID = $auth->auth["uid"];
     $this->tpl = new rpts_Template(getcwd(), "keep");
     $rptsTemplate = "LandEncode.htm";
     $assessmentSettings = new AssessmentSettings();
     if ($assessmentSettings->selectRecord()) {
         $autoCalculate = $assessmentSettings->getAutoCalculate();
         if ($autoCalculate == "false") {
             $rptsTemplate = "LandEncode_AutoCalculateOFF.htm";
         }
     }
     $this->tpl->set_file("rptsTemplate", $rptsTemplate);
     $this->tpl->set_var("TITLE", "Encode Land");
     $this->formArray = array("afsID" => $afsID, "propertyID" => $propertyID, "arpNumber" => "", "propertyIndexNumber" => "", "propertyAdministrator" => "", "personID" => "", "lastName" => "", "firstName" => "", "middleName" => "", "gender" => "", "birth_month" => "", "birth_day" => "", "birth_year" => "", "maritalStatus" => "", "tin" => "", "addressID" => "", "number" => "", "street" => "", "barangay" => "", "district" => "", "municipalityCity" => "", "province" => "", "telephone" => "", "mobileNumber" => "", "email" => "", "verifiedByID" => "", "verifiedBy" => "", "verifiedByName" => "", "plottingsByID" => "", "plottingsBy" => "", "plottingsByName" => "", "notedByID" => "", "notedBy" => "", "notedByName" => "", "marketValue" => "", "kind" => "", "actualUse" => "", "adjustedMarketValue" => "", "assessmentLevel" => "", "assessedValue" => "", "previousOwner" => "", "previousAssessedValue" => "", "taxability" => "Taxable", "effectivity" => "", "appraisedByID" => "", "appraisedBy" => "", "appraisedByName" => "", "appraisedByDate" => "", "recommendingApprovalID" => "", "recommendingApproval" => "", "recommendingApprovalName" => "", "recommendingApprovalDate" => "", "approvedByID" => "", "approvedBy" => "", "approvedByName" => "", "approvedByDate" => "", "memoranda" => "", "postingDate" => "", "octTctNumber" => "", "surveyNumber" => "", "north" => "", "east" => "", "south" => "", "west" => "", "boundaryDescription" => "", "classification" => "", "subClass" => "", "area" => "", "unit" => "square meters", "unitValue" => "", "adjustmentFactor" => "", "percentAdjustment" => 100, "valueAdjustment" => "", "as_month" => "", "as_day" => "", "as_year" => "", "re_month" => "", "re_day" => "", "re_year" => "", "av_month" => "", "av_day" => "", "av_year" => "", "idle" => "no", "contested" => "no", "formAction" => $formAction);
     foreach ($http_post_vars as $key => $value) {
         $this->formArray[$key] = $value;
         //echo $key." = ".$this->formArray[$key]."<br>";
     }
     $as_dateStr = $this->getDateStr("as_year", "as_month", "as_day");
     $this->formArray["appraisedByDate"] = $as_dateStr;
     $re_dateStr = $this->getDateStr("re_year", "re_month", "re_day");
     $this->formArray["recommendingApprovalDate"] = $re_dateStr;
     $av_dateStr = $this->getDateStr("av_year", "av_month", "av_day");
     $this->formArray["approvedByDate"] = $av_dateStr;
 }
 function Main()
 {
     $assessmentSettings = new AssessmentSettings();
     switch ($this->formArray["formAction"]) {
         case "reset":
             // If AssessmentSettings Table doesn't exist, Create table and insert defaults
             $assessmentSettings->setAutoCalculate("true");
             if (!$assessmentSettings->tableExists()) {
                 $assessmentSettings->createTable();
                 $assessmentSettings->insertRecord();
             } else {
                 $assessmentSettings->updateRecord();
             }
             $this->formArray["message"] = "Variables reset to default values.";
             break;
         case "save":
             if ($assessmentSettings->tableExists()) {
                 $assessmentSettings->setAutoCalculate($this->formArray["autoCalculate"]);
                 if ($assessmentSettings->updateRecord()) {
                     $this->formArray["message"] = "Assessment Settings saved.";
                 } else {
                     $this->formArray["message"] = "Error saving. Try clicking 'Reset' to restore defaults.";
                 }
             } else {
                 $this->formArray["message"] = "Error saving. Try clicking 'Reset' to restore defaults.";
             }
             break;
         default:
             // If AssessmentSettings Table doesn't exist, Create table and insert defaults from masterTables (upon installation)
             if (!$assessmentSettings->tableExists()) {
                 $assessmentSettings->createTable();
             }
             // If somehow no record exists in AssessmentSettings, Insert a Record (unlikely to occur)
             if (!$assessmentSettings->selectRecord()) {
                 $assessmentSettings->setAutoCalculate("true");
                 $assessmentSettings->insertRecord();
             }
             // If somehow more than 1 record exists in Treasury Settings, delete all records and Insert Record (unlikely to occur)
             if ($assessmentSettings->countRecord() > 1) {
                 $assessmentSettings->deleteRecord();
                 $assessmentSettings->setAutoCalculate("true");
                 $assessmentSettings->insertRecord();
             }
     }
     if ($assessmentSettings->selectRecord()) {
         $this->formArray["autoCalculate"] = $assessmentSettings->getAutoCalculate();
     } else {
         $this->formArray["autoCalculate"] = "true";
     }
     $this->setForm();
     $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->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }