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

$path_to_root = "../..";
$page_security = 'SA_STOCK_COUNT';

include($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/assets/includes/ui/import_asset_verification_count_details_ui.inc");  
include_once($path_to_root . "/assets/includes/db/import_asset_verification_count_details_db.inc"); 
include_once($path_to_root . "/assets/includes/ui/enter_asset_verification_counted_data_ui.inc");  
include_once($path_to_root . "/assets/includes/db/asset_verification_count_db.inc"); 
include_once($path_to_root . "/assets/includes/db/assets_db.inc"); 

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

page(_($help_context = "Import Asset Verification Count Details"), false, false, "", $js);

simple_page_mode(true);

if (isset($_POST['Upload_File'])) {
    upload_asset_verification_count_details_import_file($Mode);
}

if (isset($_POST['Refresh_File_Data'])) {
    delete_existing_import_asset_verification_count_details();
}

if (isset($_POST['Import_File_Data'])) {
    import_asset_verification_count_details();
}
        
    start_form(true);

        br(2);

        start_table(TABLESTYLE2);

            file_row(_("Attached File:"), 'filename', 'filename');

        end_table(1);
        
        hidden('selected_id', $selected_id);
        submit_center_first("Upload_File", "Upload", false, false, ICON_SUBMIT);

        br(3);

        display_heading2("File Contents");

        if (isset($_POST['Upload_File'])) {
            read_insert_asset_verification_count_details_import_file_data(isset($_POST['Import_File_Data']));
        }

        display_import_asset_verification_count_details_file_data();

        br(2);

        submit("Import_File_Data", "Import", true, false, false, ICON_SUBMIT);
        submit_center_last("Refresh_File_Data", "Refresh", false, false, ICON_SUBMIT);

    end_form(3);

end_page();

?>