}
        if (!$result) {
            $result = "No lead time per tab measured yet for this";
        } else {
            $row['c1'] = '<span style="font-size:13px;">Total</span>';
            $row['c2 right'] = '<span style="font-size:13px;">' . displayDuration($total_process, 'day', 2) . '</span>';
            $tooltip_leadtime[] = $row;
            $result = tep_draw_table('summary2', $tooltip_leadtime, false, true);
        }
        echo utf8_encode($result);
        exit;
    } elseif ($_GET['me_action'] == 'LOADINGTHUMBTOOLTIP') {
        $thumbid = tep_db_prepare_input($_GET['thumbid']);
        list($pid, $article_id) = split('-', $thumbid);
        $tooltip_data = getTooltipThumbData($pid, $article_id);
        $tooltip = displayTooltipThumb($tooltip_data);
        $result = $tooltip;
        echo utf8_encode($result);
        exit;
    }
}
//AJAX LOAD
if (isset($_GET['status']) && $_GET['status'] != '') {
    $status = tep_db_prepare_input($_GET['status']);
    $sp_orders = $class_do->manageOrderList($status, $dpo_option, $dpo_group, $ean_list, $date_range_start, $date_range_end, $brand_id, $cat_id);
    echo utf8_encode($sp_orders);
    exit;
}
//START TEMPLATE
//$class_jo->checkAndSetCompleteOrders();
$statusName = $class_do->statusNameShort();
        } else {
            $row['c1'] = '<span style="font-size:13px;">Total</span>';
            $row['c2 right'] = '<span style="font-size:13px;">' . displayDuration($total_process, 'day', 2) . '</span>';
            $tooltip_leadtime[] = $row;
            $result = tep_draw_table('summary2', $tooltip_leadtime, false, true);
        }
        echo $result;
        exit;
    } elseif ($_GET['me_action'] == 'LOADINGTHUMBTOOLTIP') {
        $thumbid = tep_db_prepare_input($_GET['thumbid']);
        list($pid, $article_id) = split('-', $thumbid);
        if ($pid == '') {
            $result = "Sorry, failed to retrieve Product ID, please reload.";
        } else {
            $tooltip_data = getTooltipThumbData($pid, $article_id);
            $result = displayTooltipThumb($tooltip_data);
        }
        echo utf8_encode($result);
        exit;
    }
}
if (isset($_POST['me_action']) && $_POST['me_action'] != '') {
    function oiErrorStatus($items_id, $item_status, $status_tab)
    {
        $result = null;
        $status_depos = array('8', '9', '11');
        if ($status_tab == '3') {
            if (in_array($item_status, $status_depos)) {
                $result = "<strong>JG-{$items_id}</strong> is moved to HH<br /><strong class='red'>REMOVE PI and CANCEL PRODUCTION!</strong>";
            }
        } elseif ($status_tab == '4') {