$history_options[0] = '2 Weeks';
$history_options[1] = '4 Weeks';
$history_options[2] = '1 Month';
$history_options[3] = '2 Months';
$history_options[4] = '3 Months';
$history_options[5] = '6 Months';
$history_options[6] = '1 Year';
$history_options[7] = 'Hide History';
$history_options_2 = array();
$history_options_2[0] = 'in Details';
$history_options_2[1] = 'Daily Summary';
//POST ACTION
if (isset($_POST['me_action']) && $_POST['me_action'] != '') {
    if ($_POST['me_action'] == 'CLEARBIN') {
        $bins_id = tep_db_prepare_input($_POST['bins_id']);
        $bin = $class_bin->retrieveBinDetail($bins_id);
        $segment = $class_bin->retrieveSegmentDetail($bin['bin_segments_id']);
        $jng_warehouses_id = $segment['warehouses_id'];
        $products_id = $bin['products_id'];
        $articles_id = $bin['articles_id'];
        $booked = $class_pm->productsBookedCount($jng_warehouses_id, $products_id, $articles_id);
        if ($booked > 0) {
            $messagebox->add("<strong>Clear Bin Failed</strong><br />Clear Bin is not allowed if On Stock and Booked by Real Order &gt; 0");
        } else {
            $class_bin->removeProductFromBox($bins_id);
            if ($bin['p_stock'] > 0) {
                $class_pm->stockReduce($jng_warehouses_id, $products_id, $articles_id, $bin['p_stock'], "REDUCE by {$session_userinfo['username']}");
            }
            header("Location: ?open=products-stock-detail&binid={$bin['bins_id']}" . ($hidemenuscript != '' ? '&hidemenu=true' : ''));
            exit;
        }