Example #1
0
            $goto_skill = TRUE;
        } else {
            $goto_region = TRUE;
        }
    }
    if ($arr_form_data['skill_set_id'] != "") {
        $chosen_skill = $arr_form_data['skill_set_id'];
    }
}
?>
<main>
	<div class="register_layout">
	<?php 
require 'subclasses/citizen_html.php';
$html = new citizen_html();
$html->draw_header(' ', $message, $message_type, TRUE, TRUE);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
if (empty($arr_error)) {
    //Don't do anything
} else {
    $first_field_check = TRUE;
    foreach ($arr_error as $field_name => $error_message) {
        if ($first_field_check) {
            $first_field = $field_name;
            $first_field_check = FALSE;
        }
        $html->fields["{$field_name}"]['extra'] .= ' style = "box-shadow: 0 0 8px #ff0000"';
        $html->fields["{$field_name}"]['companion'] = '<p style="color: #dd0000; margin-bottom: 10px; padding-left: 5px">' . $error_message . '</p>';
    }
}
require 'components/set_region_province_city.php';
Example #2
0
    require 'subclasses/citizen.php';
    $dbh_citizen = new citizen();
    $object_name = 'dbh_citizen';
    require 'components/create_form_data.php';
    extract($arr_form_data);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_citizen.php?{$query_string}");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button');
        $message .= $dbh_citizen->sanitize($arr_form_data)->lst_error;
        extract($arr_form_data);
        if ($dbh_citizen->check_uniqueness_for_editing($arr_form_data)->is_unique) {
            //Good, no duplicate in database
        } else {
            $message = "Record already exists with the same primary identifiers!";
        }
        if ($message == "") {
            $dbh_citizen->edit($arr_form_data);
            redirect("listview_citizen.php?{$query_string}");
        }
    }
}
require 'subclasses/citizen_html.php';
$html = new citizen_html();
$html->draw_header('Edit Citizen', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('citizen_id');
$html->draw_controls('edit');
$html->draw_footer();
Example #3
0
        $chosen_province = $arr_form_data['province'];
    }
    if ($arr_form_data['city'] != "") {
        $chosen_city = $arr_form_data['city'];
    }
    if ($arr_form_data['barangay'] != "") {
        $chosen_barangay = $arr_form_data['barangay'];
    }
    if (!$_POST['btn_cancel'] && !$_POST['btn_submit']) {
        $goto_skill = TRUE;
        $goto_region = TRUE;
    }
}
require 'subclasses/citizen_html.php';
$html = new citizen_html();
$html->draw_header('Add Citizen', $message, $message_type, TRUE, TRUE);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
require 'components/set_region_province_city.php';
require 'components/set_skill.php';
$html->draw_hidden('trigger_field');
$html->draw_controls('add');
$html->draw_footer();
if ($goto_region) {
    ?>
	<script>
 
	window.location.href= "#region_tag" 
	</script>
<?php 
}
if ($goto_skill) {
Example #4
0
            $csv_name = $token . $_SESSION['user'] . '_citizen_' . $timestamp . '.csv';
            $filename = TMP_DIRECTORY . '/' . $csv_name;
            $csv_contents = $dbh_citizen->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';
        }
    }
}
require 'subclasses/citizen_html.php';
$html = new citizen_html();
$html->draw_header('CSV Exporter: Citizen', $message, $message_type);
echo '<div class="container">';
echo '<fieldset class="container_invisible">';
$html->draw_fieldset_header('Table Data to CSV Export');
$html->draw_fieldset_body_start();
echo '<tr><td>';
$html->display_info('Exporting data to CSV will let you have an offline backup of this module.');
$html->display_tip('Your system admin can use this CSV file to restore data for this module in case of catastrophic data loss on the server.');
echo '</td></tr>';
$html->draw_fieldset_body_end();
$html->draw_fieldset_footer_start();
$html->draw_submit_cancel();
$html->draw_fieldset_footer_end();
echo '</fieldset>';
echo '</div>';
$html->draw_footer();
Example #5
0
require 'path.php';
init_cobalt('Delete citizen');
if (isset($_GET['citizen_id'])) {
    $citizen_id = urldecode($_GET['citizen_id']);
    require_once 'form_data_citizen.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_citizen.php?{$query_string}");
    } elseif ($_POST['btn_delete']) {
        log_action('Pressed delete button');
        require_once 'subclasses/citizen.php';
        $dbh_citizen = new citizen();
        $object_name = 'dbh_citizen';
        require 'components/create_form_data.php';
        $dbh_citizen->delete($arr_form_data);
        redirect("listview_citizen.php?{$query_string}");
    }
}
require 'subclasses/citizen_html.php';
$html = new citizen_html();
$html->draw_header('Delete Citizen', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('citizen_id');
$html->detail_view = TRUE;
$html->draw_controls('delete');
$html->draw_footer();
<?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('View citizen');
if (isset($_GET['citizen_id'])) {
    $citizen_id = urldecode($_GET['citizen_id']);
    require 'form_data_citizen.php';
}
if (xsrf_guard()) {
    init_var($_POST['btn_back']);
    if ($_POST['btn_back']) {
        log_action('Pressed cancel button');
        require 'components/query_string_standard.php';
        redirect("listview_citizen.php?{$query_string}");
    }
}
require 'subclasses/citizen_html.php';
$html = new citizen_html();
$html->draw_header('Detail View: Citizen', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->detail_view = TRUE;
$html->draw_controls('view');
$html->draw_footer();