// Author: Herman Tolentino MD // if (file_exists('../modules/appointment/class.appointment.php')) { include '../modules/appointment/class.appointment.php'; $appointment = new appointment; if (!$module->activated('appointment') && $initmod) { $appointment->init_sql(); $appointment->init_menu(); $appointment->init_deps(); $appointment->init_lang(); $appointment->init_help(); } } if (file_exists('../modules/barangay/class.barangay.php')) { include '../modules/barangay/class.barangay.php'; $barangay = new barangay; if (!$module->activated('barangay') && $initmod) { $barangay->init_sql(); $barangay->init_menu(); $barangay->init_deps(); $barangay->init_lang(); $barangay->init_help(); } } if (file_exists('../modules/birthday/class.birthday.php')) { include '../modules/birthday/class.birthday.php'; $birthday = new birthday; if (!$module->activated('birthday') && $initmod) { $birthday->init_sql(); $birthday->init_menu(); $birthday->init_deps();
function form_folder() { if (func_num_args()>0) { $arg_list = func_get_args(); $menu_id = $arg_list[0]; $post_vars = $arg_list[1]; $get_vars = $arg_list[2]; $validuser = $arg_list[3]; $isadmin = $arg_list[4]; //print_r($arg_list); } print "<a name='family_form'>"; print "<table width='300'>"; if ($get_vars["family_id"]) { print "<form action = '".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=$menu_id&family_id=".$get_vars["family_id"].($get_vars["edit_family_id"]?"&edit_family_id".$get_vars["edit_family_id"]:"")."' name='form_search' method='post'>"; } else { print "<form action = '".$_SERVER["PHP_SELF"]."?page=".$get_vars["page"]."&menu_id=$menu_id' name='form_search' method='post'>"; } if ($get_vars["edit_family_id"]) { // get latest address $sql = "select family_id, address_year, address, barangay_id ". "from m_family_address ". "where family_id = '".$get_vars["edit_family_id"]."' ". "order by address_year desc limit 1"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { list($fid, $year, $address, $barangay_id) = mysql_fetch_array($result); } } } print "<tr valign='top'><td>"; if (!$fid && !$get_vars["edit_family_id"]) { print "<b>".INSTR_FAMILY_FOLDER."</b><br/>"; } print "</td></tr>"; print "<tr valign='top'><td>"; print "<span class='boxtitle'>".LBL_FAMILY_ADDRESS."</span><br> "; print "<textarea class='textbox' name='family_address' cols='35' rows='5' style='border: 1px solid #000000'>".$address."</textarea>"; print "</td></tr>"; print "<tr valign='top'><td>"; print "<span class='boxtitle'>".LBL_FAMILY_BARANGAY."</span><br> "; print barangay::show_barangays($barangay_id); print "</td></tr>"; print "<tr><td><br/>"; print "<input type='hidden' name='family_id' value='".$get_vars["family_id"]."'/>"; print "<input type='hidden' name='address_year' value='$year'/>"; if ($fid) { if ($_SESSION["priv_update"]) { print "<input type='submit' value = 'Update Folder' class='textbox' name='submitfolder' style='border: 1px solid #000000'> "; } if ($_SESSION["priv_delete"]) { print "<input type='submit' value = 'Delete Folder' class='textbox' name='submitfolder' style='border: 1px solid #000000'> "; } } else { if ($_SESSION["priv_add"]) { print "<input type='submit' value = 'Create Folder' class='textbox' name='submitfolder' style='border: 1px solid #000000'><br>"; } } print "</td></tr>"; print "</form>"; print "</table><br>"; }
function display_reminder_data() { if (func_num_args() > 0) { $arg_list = func_get_args(); $menu_id = $arg_list[0]; $post_vars = $arg_list[1]; $get_vars = $arg_list[2]; $validuser = $arg_list[3]; $isadmin = $arg_list[4]; //print_r($arg_list); } print "<form method='post' action='" . $_SERVER["PHP_SELF"] . "?page=" . $get_vars["page"] . "&menu_id=" . $get_vars["menu_id"] . "&consult_id=" . $get_vars["consult_id"] . "&ptmenu=DETAILS&module=reminder&reminder=DATA'>"; print "<table width='300' cellpadding='2' style='border: 1px dotted black'><tr><td>"; $patient_id = healthcenter::get_patient_id($get_vars["consult_id"]); print "<b>NAME: " . strtoupper(patient::get_name($patient_id)) . "</b><br/>"; $sql = "select patient_id, cellular_phone, home_phone, " . "office_phone, email_address, home_address, " . "barangay, reg_timestamp, user_id " . "from m_patient_reminder_data " . "where patient_id = {$patient_id}"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $reminder = mysql_fetch_array($result); print "<span class='tinylight'>"; if (strlen($reminder["cellular_phone"]) > 0) { print "CELLULAR PHONE: " . $reminder["cellular_phone"] . "<br/>"; } if (strlen($reminder["home_phone"]) > 0) { print "HOME PHONE: " . $reminder["home_phone"] . "<br/>"; } if (strlen($reminder["office_phone"]) > 0) { print "OFFICE PHONE: " . $reminder["office_phone"] . "<br/>"; } if (strlen($reminder["email_address"]) > 0) { print "EMAIL ADDRESS: " . $reminder["email_address"] . "<br/>"; } if (strlen($reminder["home_address"]) > 0) { print "HOME ADDRESS: " . $reminder["home_address"] . "<br/>"; } if ($reminder["barangay"]) { print "BARANGAY: " . barangay::barangay_name($reminder["barangay"]) . "<br/>"; } print "<br/></span>"; print "<input type='hidden' name='patient_id' value='" . $reminder["patient_id"] . "' />"; if ($_SESSION["priv_update"] || $_SESSION["priv_delete"]) { print "<input type='submit' name='submitdetail' value='Edit Reminder Data' class='tinylight' style='border: 1px solid black' />"; } } else { print "<font color='red'>No reminder data</font><br/>"; } } print "</td></tr></table>"; print "</form>"; }
require 'path.php'; init_cobalt('Delete barangay'); if (isset($_GET['barangay_id'])) { $barangay_id = urldecode($_GET['barangay_id']); require_once 'form_data_barangay.php'; } if (xsrf_guard()) { init_var($_POST['btn_cancel']); init_var($_POST['btn_delete']); require 'components/query_string_standard.php'; if ($_POST['btn_cancel']) { log_action('Pressed cancel button'); redirect("listview_barangay.php?{$query_string}"); } elseif ($_POST['btn_delete']) { log_action('Pressed delete button'); require_once 'subclasses/barangay.php'; $dbh_barangay = new barangay(); $object_name = 'dbh_barangay'; require 'components/create_form_data.php'; $dbh_barangay->delete($arr_form_data); redirect("listview_barangay.php?{$query_string}"); } } require 'subclasses/barangay_html.php'; $html = new barangay_html(); $html->draw_header('Delete Barangay', $message, $message_type); $html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc); $html->draw_hidden('barangay_id'); $html->detail_view = TRUE; $html->draw_controls('delete'); $html->draw_footer();
<?php require 'components/get_listview_referrer.php'; require 'subclasses/barangay.php'; $dbh_barangay = new barangay(); $dbh_barangay->set_where("barangay_id='" . quote_smart($barangay_id) . "'"); if ($result = $dbh_barangay->make_query()->result) { $data = $result->fetch_assoc(); extract($data); }
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com //Cobalt developed by JV Roig (jvroig@jvroig.com) //**************************************************************************************** require 'path.php'; init_cobalt('View barangay'); if (xsrf_guard()) { init_var($_POST['btn_cancel']); init_var($_POST['btn_submit']); if ($_POST['btn_cancel']) { log_action('Pressed cancel button'); redirect("listview_barangay.php"); } if ($_POST['btn_submit']) { log_action('Pressed submit button'); require 'subclasses/barangay.php'; $dbh_barangay = new barangay(); if ($message == "") { log_action('Exported table data to CSV'); $timestamp = date('Y-m-d'); $token = generate_token(0, 'fs'); $csv_name = $token . $_SESSION['user'] . '_barangay_' . $timestamp . '.csv'; $filename = TMP_DIRECTORY . '/' . $csv_name; $csv_contents = $dbh_barangay->export_to_csv(); $csv_file = fopen($filename, "wb"); fwrite($csv_file, $csv_contents); fclose($csv_file); chmod($filename, 0755); $csv_name = urlencode($csv_name); $message = 'CSV file successfully generated: <a href="/' . BASE_DIRECTORY . '/download_generic.php?filename=' . $csv_name . '">Download the CSV file.</a>'; $message_type = 'system'; }
<?php //**************************************************************************************** //Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com //Cobalt developed by JV Roig (jvroig@jvroig.com) //**************************************************************************************** require 'path.php'; init_cobalt('Add barangay'); require 'components/get_listview_referrer.php'; if (xsrf_guard()) { init_var($_POST['btn_cancel']); init_var($_POST['btn_submit']); require 'components/query_string_standard.php'; require 'subclasses/barangay.php'; $dbh_barangay = new barangay(); $object_name = 'dbh_barangay'; require 'components/create_form_data.php'; extract($arr_form_data); if ($_POST['btn_cancel']) { log_action('Pressed cancel button'); redirect("listview_barangay.php?{$query_string}"); } if ($_POST['btn_submit']) { log_action('Pressed submit button'); $message .= $dbh_barangay->sanitize($arr_form_data)->lst_error; extract($arr_form_data); if ($dbh_barangay->check_uniqueness($arr_form_data)->is_unique) { //Good, no duplicate in database } else { $message = "Record already exists with the same primary identifiers!"; }