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

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui.inc"); 
include_once($path_to_root . "/services/includes/ui/job_order_cost_view_ui.inc");  
include_once($path_to_root . "/services/includes/db/job_orders_db.inc"); 
include_once($path_to_root . "/services/includes/ui/job_order_entry_ui.inc");  
include_once($path_to_root . "/inventory/includes/db/job_material_issues_db.inc");
include_once($path_to_root . "/services/includes/db/job_order_labours_db.inc"); 
include_once($path_to_root . "/payroll/includes/db/employees_db.inc");
include_once($path_to_root . "/assets/includes/db/assets_db.inc"); 
include_once($path_to_root . "/inventory/includes/db/outside_material_receipts_db.inc");

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

page(_($help_context = "Job Card Cost View"), false, false, "", $js);

simple_page_mode(true);

if (isset($_GET['job_order_id']) && $_GET['job_order_id'] > 0) {
    $_POST['job_order_id'] = $_GET['job_order_id'];
}

start_form();
    global $Ajax;
    
    start_table();
        amount_cells('Job Card #:', 'job_order_id', null, null, null, 0);
        submit_cells("Search", 'Search', '', false, false, ICON_SUBMIT);
    end_table(2);
    
    $Ajax->activate('job_order_view');
    div_start('job_order_view');
        if (input_num('job_order_id') > 0) {
            $jo_row = get_job_order_record(input_num('job_order_id'));
                if (is_array($jo_row)) {
                    display_job_order_cost_view(input_num('job_order_id'));
                } else {
                    display_note('Unknown job card number.', 1, 1);
                }
        } else {
            display_note('Please enter job card id and click on Refresh button.', 1, 1);
        }
    div_end();
    
end_form(1);
end_page(true);

?>