<?php
/**********************************************************************
***********************************************************************/
$page_security = 'SA_RUN_CUSTOM_SCRIPT';
$path_to_root = "..";
include_once($path_to_root . "/includes/ui/items_cart.inc");
include($path_to_root . "/includes/session.inc");

page(_($help_context = "Run Custom Script"));

include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/admin/includes/ui/run_custom_sript_ui.inc");



simple_page_mode(false);






//--------------------------------------------------------------------------------



if(isset($_POST['RUN_CUSTOM_SCRIPT']))
{
    $custom_script_log_folder_path = $path_to_root.'/tmp/custom_script_logs/';

    if (!file_exists($custom_script_log_folder_path))
    {
        create_folder_index_file($custom_script_log_folder_path);
    }
    
    run_manual_sript($_POST['custom_script'], $path_to_root);
    
}





//----------------------------------------------------------------------------------

//$result = get_all_item_units(check_value('show_inactive'));

$_POST['custom_script'] = null;

start_form();

br(2);


cs_display_run_custom_script_edit_controls();



br(2);

submit_center("RUN_CUSTOM_SCRIPT", "Run Custom Script");

br(2);




end_form();

end_page();

?>
