<?php
/**********************************************************************
***********************************************************************/
$page_security = 'SA_DASHBOARD_UTILITY_VIEW';
$path_to_root = "../..";

include($path_to_root . "/includes/session.inc");
include($path_to_root . "/includes/ui/ui_input.inc"); 
include_once($path_to_root . "/dashboard/includes/ui/view_dashboard_utility_expenses_ui.inc"); 
include_once($path_to_root . "/dashboard/includes/db/view_dashboard_utility_expenses_db.inc"); 
include_once($path_to_root . "/dashboard/includes/db/dashboard_utility_expenses_db.inc"); 
include_once($path_to_root . "/gl/includes/db/utility_expense_types_db.inc"); 
include_once($path_to_root . "/projects/includes/db/projects_db.inc"); 

$js = "";
$js .= get_js_open_window(900, 500);

page(_($help_context = "Dashboard Utility Expenses View"), true, false, "", $js);

$from_date = $to_date = $item_code = '';
$project_id = $expense_category_id = $expense_item_id = -1;

if (isset($_GET['pid'])) {
    $project_id = $_GET['pid'];
}
if (isset($_GET['expc'])) {
    $expense_category_id = $_GET['expc'];
}
if (isset($_GET['expi'])) {
    $expense_item_id = $_GET['expi'];
}

if (isset($_GET['expt'])) {
    $expense_type_id = $_GET['expt'];
}
if (isset($_GET['from_date'])) {
    $from_date = $_GET['from_date'];
}
if (isset($_GET['to_date'])) {
    $to_date = $_GET['to_date'];
}

dashboard_view_utility_expenses($from_date, $to_date, $expense_type_id, $project_id, $expense_category_id, $expense_item_id);

end_page(true, false, false, DASH_SC_PETTY_CASH_EXPENSES, $_GET['expt']);

?>