function ProvinceList($http_post_vars, $sess, $sortBy, $sortOrder, $hideInactive) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->sess = $sess; $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "ProvinceList.htm"); $this->tpl->set_var("TITLE", "Province List"); $this->tpl->set_var("Session", $this->sess->url("")); $this->formArray["sortBy"] = $sortBy; $this->formArray["sortOrder"] = $sortOrder; $this->formArray["hideInactive"] = $hideInactive; foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function OwnerPersonList($sess, $sortKey, $sortOrder, $page) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; $this->formArray["sortKey"] = "TRIM(Person.lastName), TRIM(Person.firstName), TRIM(Person.middleName)"; $this->formArray["sortOrder"] = "asc"; $this->formArray["page"] = 1; //if($sortKey!="") // $this->formArray["sortKey"] = $sortKey; if ($sortOrder != "") { $this->formArray["sortOrder"] = $sortOrder; } if ($page != "") { $this->formArray["page"] = $page; } // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "OwnerPersonList.htm"); $this->tpl->set_var("TITLE", "Owner Person List"); }
function ODList($http_post_vars, $sess, $odID, $page, $searchKey, $barangay, $formAction, $sortBy, $sortOrder, $viewArchives, $transactionCode = "", $mergeBasketCSV) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must have atleast AM-EDIT access $pageType = "%1%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "ODList.htm"); $this->tpl->set_var("TITLE", "Consolidation > RPU List"); $this->sess = $sess; $this->formArray["odID"] = $odID; $this->formArray["page"] = $page; $this->formArray["searchKey"] = $searchKey; $this->formArray["barangay"] = $barangay; $this->formArray["sortBy"] = $sortBy; $this->formArray["sortOrder"] = $sortOrder; $this->formArray["viewArchives"] = $viewArchives; $this->formArray["transactionCode"] = $transactionCode; $this->formArray["formAction"] = $formAction; $this->formArray["mergeBasketCSV"] = $mergeBasketCSV; $this->formArray["viewArchivesTitle"] = ""; $this->formArray["archiveValue"] = ""; $this->formArray["odIDArray"] = ""; foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function TreasurySettingsEncode($http_post_vars, $sess, $formAction, $masterTables) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; $this->masterTables = $masterTables; // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "TreasurySettingsEncode.htm"); $this->tpl->set_var("TITLE", "Treasury Settings"); $this->formArray = array("formAction" => $formAction, "message" => "", "cutOff" => ""); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } if ($this->formArray["discountPeriod_month"] != "" && $this->formArray["discountPeriod_month"] != "") { $dateStr = putPreZero($this->formArray["discountPeriod_month"]) . "-" . putPreZero($this->formArray["discountPeriod_day"]); $this->formArray["discountPeriod"] = $dateStr; } }
function GeneralRevision($http_post_vars, $http_get_vars, $sess) { //,$formAction,$totalArchived,$totalCreated,$message,$barang global $auth; // this will attempt to count "latest active RPUs" that have NOT undergone general revision for the // past X number of days from today $this->countBackDays = 30; $this->countBackDaysTimeStr = strtotime("-" . $this->countBackDays . " days"); $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->userID = $auth->auth["uid"]; $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "GeneralRevision.htm"); $this->tpl->set_var("TITLE", "General Revision"); $this->tpl->set_var("Session", $this->sess->url("")); $this->formArray = array("formAction" => $http_get_vars["formAction"], "barangayID" => $http_get_vars["barangayID"], "totalArchived" => $http_get_vars["totalArchived"], "totalCreated" => $http_get_vars["totalCreated"], "message" => $http_get_vars["message"], "countBackDays" => $this->countBackDays, "countBackDaysTimeStr" => $this->countBackDaysTimeStr, "progressLog" => $http_get_vars["progressLog"], "timerStart" => $http_get_vars["timerStart"], "timerEnd" => $http_get_vars["timerEnd"]); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function setPageDetailPerms() { if (!checkPerms($this->user["userType"], "%%%1%%%%%%")) { // hide Blocks if userType is not at least TM-Edit $this->hideBlock("TreasuryMaintenanceLink"); } else { $this->hideBlock("TreasuryMaintenanceLinkText"); } }
function setPageDetailPerms() { if (!checkPerms($this->user["userType"], "%1%%%%%%%%")) { // hide Blocks if userType is not at least AM-Edit $this->tpl->set_var("ownerViewAccess", "viewOnly"); } else { $this->tpl->set_var("ownerViewAccess", "view"); } }
function setPageDetailPerms() { if (!checkPerms($this->user["userType"], "%1%%%%%%%%")) { // hide Blocks if userType is not at least AM-Edit $this->hideBlock("TransactionsLink"); } else { $this->hideBlock("TransactionsLinkText"); } }
function compileCoffee($filename) { global $coffee; // Check if we can write to the javascript file $jsfile = str_replace('.coffee', '.js', $filename); if (!checkPerms($jsfile, 'w')) { die("Can't write to javascript file!"); } // Compile $cmd = $coffee . " -c " . escapeshellarg(getcwd() . '/' . $filename); exec($cmd); }
function setPageDetailPerms() { if (!checkPerms($this->user["userType"], "%1%%%%%%%%")) { // hide Blocks if userType is not at least AM-Edit $this->hideBlock("SearchAddOwnerPersonLink"); $this->hideBlock("SearchAddOwnerCompanyLink"); $this->hideBlock("PropertyInfoEncodeLink"); $this->tpl->set_var("ownerViewAccess", "viewOnly"); $this->tpl->set_var("removeOwnerDisabled", "disabled"); } else { $this->tpl->set_var("ownerViewAccess", "view"); $this->tpl->set_var("removeOwnerDisabled", ""); } }
function RPTREncode() { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must have atleast TM-EDIT access $pageType = "%%%1%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new Template(getcwd()); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); }
function TransactionsHome($sess) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must have atleast AM-EDIT access $pageType = "%1%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "TransactionsHome.htm"); $this->tpl->set_var("TITLE", "AM : Transactions"); }
function OwnersList($sess) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "OwnerList.htm"); $this->tpl->set_var("TITLE", "Owner List"); }
function RPTOPBatchEncode($http_post_vars, $formAction = "", $sess) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must have atleast AM-EDIT access $pageType = "%1%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "RPTOPBatchEncode.htm"); $this->tpl->set_var("TITLE", "Encode RPTOP by Batch"); $this->formArray = array("rptopID" => $rptopID, "rptopNumber" => "", "taxableYear" => "", "cityAssessor" => "", "citytreasurer" => "", "cityAssessorID" => "", "citytreasurerID" => "", "stepNumber" => "01", "limit" => 5, "formAction" => $formAction); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function AssessmentSettingsEncode($http_post_vars, $sess, $formAction) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "AssessmentSettingsEncode.htm"); $this->tpl->set_var("TITLE", "Assessment Settings"); $this->formArray = array("formAction" => $formAction, "message" => ""); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function PurgeReceipt($http_post_vars, $formAction = "", $sess) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must have atleast TM-EDIT access $pageType = "%%%1%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: UnauthorizedPopup.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "PurgeReceipt.htm"); $this->tpl->set_var("TITLE", "TM : Purge Receipt"); $this->formArray = array("formAction" => $formAction); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function setPageDetailPerms() { // Check Admin Permissions if (!checkPerms($this->user["userType"], "1%%%%%%%%%")) { $this->hideBlock("AdminModuleLink"); } else { $this->hideBlock("AdminModuleText"); } // Check Assessor's Module Permissions if (!checkPerms($this->user["userType"], "%%1%%%%%%%")) { $this->hideBlock("AssessorsModuleLink"); } else { $this->hideBlock("AssessorsModuleText"); } // Check Treasurer's Module Permissions if (!checkPerms($this->user["userType"], "%%%%1%%%%%")) { $this->hideBlock("TreasurersModuleLink"); } else { $this->hideBlock("TreasurersModuleText"); } }
function eRPTSSettingsEncode($http_post_vars, $sess, $formAction) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "eRPTSSettingsEncode.htm"); $this->tpl->set_var("TITLE", "eRPTS Settings"); $this->formArray = array("lguName" => "", "lguType" => "", "chiefExecutiveDesignation" => "", "chiefExecutiveFirstName" => "", "chiefExecutiveMiddleName" => "", "chiefExecutiveLastName" => "", "assessorDesignation" => "", "assessorFirstName" => "", "assessorMiddleName" => "", "assessorLastName" => "", "treasurerDesignation" => "", "treasurerFirstName" => "", "treasurerMiddleName" => "", "treasurerLastName" => "", "provincialAssessorDesignation" => "", "provincialAssessorFirstName" => "", "provincialAssessorMiddleName" => "", "provincialAssessorLastName" => "", "provincialTreasurerDesignation" => "", "provincialTreasurerFirstName" => "", "provincialTreasurerMiddleName" => "", "provincialTreasurerLastName" => "", "ordinanceNo" => "", "ordinanceDate" => "", "formAction" => $formAction); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function MergeOwnerPersonConfirm($sess, $http_post_vars) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "MergeOwnerPersonConfirm.htm"); $this->tpl->set_var("TITLE", "Merge Owner Confirm"); $this->formArray = array("personID" => "", "formAction" => $formAction); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function FinalDemandLetterPrint($sess, $ownerID, $http_post_vars) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must have atleast TM-VIEW access $pageType = "%%%%1%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "finalDemandLetter.xml"); $this->tpl->set_var("TITLE", "TM : Final Demand Letter"); $this->formArray["ownerID"] = $ownerID; $this->formArray["date"] = date("F d, Y"); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function ODDetails($http_post_vars, $sess, $odID) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must have atleast AM-EDIT access $pageType = "%1%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->formArray["uid"] = $auth->auth["uid"]; $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "ODDetails.htm"); $this->tpl->set_var("TITLE", "Consolidation > RPU Details"); $this->formArray["odID"] = $odID; foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function GeneralRevision($http_post_vars, $formAction, $totalArchived, $totalCreated, $sess) { global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; // must be Super-User to access $pageType = "1%%%%%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->userID = $auth->auth["uid"]; $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "GeneralRevision.htm"); $this->tpl->set_var("TITLE", "General Revision"); $this->tpl->set_var("Session", $this->sess->url("")); $this->formArray = array("formAction" => $formAction, "totalArchived" => $totalArchived, "totalCreated" => $totalCreated); foreach ($http_post_vars as $key => $value) { $this->formArray[$key] = $value; } }
function setODListBlockPerms() { if (!checkPerms($this->user["userType"], "%1%%%%%%%%")) { $this->tpl->set_var("ownerViewAccess", "viewOnly"); $this->tpl->set_var("odDetailsLinkLabel", "View"); } else { $this->tpl->set_var("ownerViewAccess", "view"); $this->tpl->set_var("odDetailsLinkLabel", "Edit"); } }
function setMachineriesListBlockPerms() { if (!checkPerms($this->user["userType"], "%1%%%%%%%%")) { $this->tpl->set_block("MachineriesList", "EditMachineriesLink", "EditMachineriesLinkBlock"); $this->tpl->set_var("EditMachineriesLinkBlock", "<s>Edit</s>"); } else { } }
function setPageDetailPerms() { // hide Blocks from Treasurer $this->hideBlock("RPUIdentificationEncodeLink"); $this->hideBlock("TDEncodeLink"); $this->hideBlock("AddLandLink"); $this->hideBlock("AddPlantsTreesLink"); $this->hideBlock("AddImprovementsBuildingsLink"); $this->hideBlock("AddMachineriesLink"); $this->tpl->set_var("ownerViewAccess", "viewOnly"); $this->tpl->set_var("removePropertyDisabled", "disabled"); if (!checkPerms($this->user["userType"], "%%%1%%%%%%")) { // hide Blocks if userType is not at least TM-Edit $this->hideBlock("TreasuryMaintenanceLink"); } else { $this->hideBlock("TreasuryMaintenanceLinkText"); } }
//require_once('collection/Collection.php'); require_once 'collection/Payment.php'; //require_once('collection/Due.php'); page_open(array("sess" => "rpts_Session", "auth" => "rpts_Challenge_Auth")); $tpl = new rpts_Template(); $tpl->set_file(array(report => "collectionReport2Form.htm")); global $auth; $this->sess = $sess; $this->user = $auth->auth; $this->formArray["uid"] = $auth->auth["uid"]; $this->user = $auth->auth; $tpl->set_var("uname", $this->user["uname"]); $tpl->set_var("today", date("F j, Y")); // must have atleast TM-VIEW access $pageType = "%%%%1%%%%%"; if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $tpl->set_block(report, LGUBLK, lguBlk); $db = new DB_RPTS(); $sql = "select * from MunicipalityCity order by description;"; $db->query($sql); for ($i = 0; $db->next_record(); $i++) { $tpl->set_var($db->Record); $tpl->parse(lguBlk, LGUBLK, true); } if ($municipalityCityID) { $tpl->set_var("selected_municipalityCityID_" . $municipalityCityID, "selected"); } else { $tpl->set_var("selected_municipalityCityID_" . $municipalityCityID, "");
function setRPTOPListBlockPerms() { if (!checkPerms($this->user["userType"], "%%%%1%%%%%")) { // } else { // } }
function performTests() { global $failed, $test_output, $action, $admin_db_failed, $public_db_failed, $admin_dsn, $public_dsn, $smarty, $global_dd, $alm_connect; $failed = false; $red = '<font color="red">FALLÓ</font>'; $green = '<font color="green">PASÓ</font>'; # Old versions don't use admin_dsn public_dsn but simply a DSN constant if (!isset($admin_dsn)) { $admin_dsn = DSN; } if (!isset($public_dsn)) { $public_dsn = DSN; } $test_output .= "Probando conexion a base de datos (public)... "; unset($alm_connect[$public_dsn]); $db = almdata::connect($public_dsn); if (almdata::basicError($db, $public_dsn) || !$alm_connect[$public_dsn]) { $error_msg = almdata::basicError($db, $public_dsn); $test_output .= "{$red} <i>{$error_msg}</i><br/>"; $failed = true; $public_db_failed = true; } else { $test_output .= "{$green}<br/>"; } # Check admin connection last, so that we stay admin... $test_output = "Probando conexion a base de datos (admin)... "; unset($alm_connect[$admin_dsn]); $db = almdata::connect($admin_dsn); if (almdata::basicError($db, $admin_dsn) || !$alm_connect[$admin_dsn]) { $error_msg = almdata::basicError($db, $admin_dsn); $test_output .= "{$red} <i>{$error_msg}</i><br/>"; $failed = true; $admin_db_failed = true; } else { $test_output .= "{$green}<br/>"; } $test_output .= "Probando configuracion de PHP... "; if (get_cfg_var('short_open_tag') != 1) { $test_output .= "{$red} <i>short_open_tag = " . get_cfg_var('short_open_tag') . "</i><br/>"; $failed = true; } else { $test_output .= "{$green}<br/>"; } $test_output .= "Probando permisos de directorios... "; if (checkPerms($smarty->compile_dir) !== true) { $test_output .= "{$red} <i> {$smarty->compile_dir} = " . checkPerms($smarty->compile_dir) . "</i><br/>"; } if (checkPerms($smarty->cache_dir) !== true) { $test_output .= "{$red} <i> {$smarty->cache_dir} = " . checkPerms($smarty->cache_dir) . "</i><br/>"; } $logs_dir = ROOTDIR . '/logs'; if (checkPerms($logs_dir) !== true) { $test_output .= "{$red} <i> {$logs_dir} = " . checkPerms($logs_dir) . "</i><br/>"; } $files_dir = ROOTDIR . '/files'; if (checkPerms($files_dir) !== true) { $test_output .= "{$red} <i> {$files_dir} = " . checkPerms($files_dir) . "</i><br/>"; } if (checkPerms($smarty->compile_dir) === true && checkPerms($smarty->cache_dir) === true) { $test_output .= "{$green}<br/>"; } else { $failed = true; } $test_output .= "Dónde está almidón? "; if (defined('ALMIDONDIR')) { $test_output .= '<font color="green">' . ALMIDONDIR . '</font><br/>'; } else { $failed = true; $test_output .= $red; } $test_output .= "BD Almidonizada? "; list($type, $tmp) = preg_split('/:\\/\\//', $admin_dsn); if ($type == 'pgsql') { $sqlcmd = "SELECT relname FROM pg_class WHERE pg_class.relkind = 'r' AND pg_class.relname LIKE 'alm_%'"; } elseif ($type == 'mysql') { $sqlcmd = "SHOW TABLES LIKE 'alm_%';"; } $data = new Data(); $var = @$data->getList($sqlcmd); if (count($var) >= 5) { $test_output .= '<font color="green">' . print_r($var, 1) . '</font>'; } else { #$failed = true; $test_output .= $red; } if ($failed) { $action = 'failed'; $test_output .= '<br/><br/><font color="red">Por favor corregir antes de continuar con la instalación</font>'; } }