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

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui/ui_input.inc"); 
include_once($path_to_root . "/includes/ui/ui_lists_custom.inc"); 
include_once($path_to_root . "/assets/includes/db/assets_db.inc");  
include_once($path_to_root . "/assets/includes/ui/asset_verification_count_ui.inc"); 
include_once($path_to_root . "/assets/includes/db/complete_asset_verification_count_db.inc");
include_once($path_to_root . "/assets/includes/db/asset_verification_count_db.inc");
include_once($path_to_root . "/assets/includes/ui/process_asset_verification_count_ui.inc"); 
        
$js = "";
$js .= get_js_open_window(800, 500);
$js .= get_js_date_picker();

$asset_verification_count_no = -1;

if (isset($_GET['AssetVerificationCountNo']) && is_numeric($_GET['AssetVerificationCountNo'])) {
    $asset_verification_count_no = $_GET['AssetVerificationCountNo'];
} elseif (isset($_POST['AssetVerificationCountNo']) && is_numeric($_POST['AssetVerificationCountNo'])) {
    $asset_verification_count_no = $_POST['AssetVerificationCountNo'];
}

page("Complete Asset Count", false, false, "", $js);

if (isset($_GET['ProcessedID'])) {
	$trans_no = $_GET['ProcessedID'];
	$trans_type = ST_ASSET_VERIFICATION;

	display_notification_centered(_("Asset Verification ".$trans_no." has been processed"));
        
	display_note(get_trans_view_str($trans_type, $trans_no, _("&View this Asset Verification")), 0, 1);

	display_footer_exit();
}

if (isset($_POST['ProcessAssetVerification']) && check_process_asset_verification_count_data($asset_verification_count_no)){
    process_asset_verification_count($asset_verification_count_no);
}

    start_form();
    
        hidden('AssetVerificationCountNo', $asset_verification_count_no);
        
        global $systypes_array;
        display_heading($systypes_array[ST_ASSET_VERIFICATION]." #$asset_verification_count_no");    br();

        display_asset_verification_count_header($asset_verification_count_no);

        $Ajax->activate('sc_details');
        div_start('sc_details');

            start_table(TABLESTYLE_NOBORDER); 
                asset_verification_count_sheets_list_row("Sheet No :", 'sheet_no', $asset_verification_count_no, null, false, true);
            end_table(1);

            display_asset_verification_count_counted_details($asset_verification_count_no);
        div_end();

        submit_center('ProcessAssetVerification', _("Process Asset Verification"), true, false, false, ICON_SUBMIT);

    end_form(3);
    
end_page();

?>