<?php
/**********************************************************************
***********************************************************************/

$page_security = 'SA_EDIT_GL_TRANS_TYPE';
$path_to_root="..";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/gl/includes/ui/edit_gl_transaction_type_ui.inc");
include_once($path_to_root . "/gl/includes/db/edit_gl_transaction_type_db.inc");
include_once($path_to_root . "/includes/db/comments_db.inc");
include_once($path_to_root . "/admin/db/list_values_db.inc");
include_once($path_to_root . "/payroll/includes/db/emp_trans_db.inc"); 

$js = "";
$js .= get_js_open_window(800, 500);
$js .= get_js_date_picker();

page(_($help_context = "Edit GL Transaction Type"), false, false, "", $js);

$status = true;

if (isset($_POST['Update'])) {
    $msg = update_edit_gl_transaction_type();
        if ($msg['success'] !== true) {
            display_error($msg['message']);
            set_focus($msg['set_focus']);
            $status = false;
        } else {
            display_notification($msg['message']);
        }
}

global $Ajax;

start_form();

    display_edit_gl_transaction_type_filterings();
    
    $Ajax->activate('edit_gl_trans_tpx');
    div_start('edit_gl_trans_tpx');
    
    display_edit_gl_transaction_type_details($_POST['type_id'], $_POST['trans_no'], $_POST['reference'], $_POST['from_date'], $_POST['to_date'], $status);

    div_end();
    
    submit_center('Update', _("Update Selected Records"), true, false, false, ICON_SUBMIT);
    
    
end_form(3);

end_page();

?>
