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

include($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/services/includes/ui/service_complains_ui.inc"); 
include_once($path_to_root . "/services/includes/db/service_complains_db.inc");
include_once($path_to_root . "/services/includes/db/job_orders_db.inc"); 
include_once($path_to_root . "/assets/includes/db/assets_db.inc");   
include_once($path_to_root . "/payroll/includes/db/employees_db.inc");   

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

global $systypes_array;

page(_($help_context = "View ".$systypes_array[ST_SERVICE_COMPLAIN]), true, false, "", $js);

$id = 0;
if (isset($_GET["trans_no"])) {
    $id = $_GET["trans_no"];
}

br();

    $tp_name = $systypes_array[ST_SERVICE_COMPLAIN];
    
    display_heading("$tp_name #$id");        br();

    $is_closed = view_service_complain_header($id);        br();
    
        if ($is_closed == 1) {
            display_note(("Job card cannot be created because $tp_name #$id has been closed."), 1, 1, 'style=color:red');
            display_footer_exit();
        } else {
            view_service_complain_job_header($id);        br();
        }
    
end_page(true, false, false, ST_SERVICE_COMPLAIN, $id);

?>