$content .= '<td class="msg"></td>';
$content .= '</tr></table>';
$content .= '</div></div>';
//form container
$content .= '<div id="barcode-form-cont" style="text-align:center;margin-bottom:10px;">';
$content .= '<input type="hidden" id="barcode-form-oldstatus" value="" />';
$content .= '<input type="text" id="barcode-form-entry" class="input2" />';
$content .= '</div>';
$content .= '<div style="text-align:center;"><input type="button" id="barcode-form-clear" value="Clear" /><input type="button" class="simplemodal-close" value="Close" /></div>';
$content .= '</div>';
//form closed bali manual order
$content .= '<div id="closed-bali-manual-order-form" style="display:none;text-align:center;">';
$content .= '<div class="msg" style="margin-bottom:20px;"></div>';
$content .= '<div>Order Barcode<input type="text" id="cbmo-bcid" title="scan or input order barcode here" style="margin-left:10px;text-align:center;" /></div>';
$content .= '</div>';
$javascript = templateJSProductionSubTab() . '
            var txtNoMoreOrders = "<h3>No more Orders to show</h3>";
            function printPI(oi_id_cols) {
                window.open("print/production_instruction_pdf.php?type=dp&oiid="+oi_id_cols);
            }
            function parseContent() {
                Manobo.attachBehaviors($("#sp-orders"));
                $("input[readonly=readonly]").addClass("disabled");
                $("div.draw-table").find("th,td").addClass("ui-corner-all");
                applyFancyBox($("#sp-orders"), "view_image");
                applyFancyBox($("#sp-orders"), "view_webpage");
                $("span.lt").each(function(){
                    var depot_orders_id = $(this).parents("tr:eq(0)").find("input:hidden[name=oi_id]").val();
                    $(this).qtip({
                        content: {
                            text: img_ajax_load_3,
    $tablink = $status == 4 ? '#subtab-prod' : $main_link . $status;
    if ($status == $status_unpaid_prepayment) {
        $status_name = 'Unpaid Prepayment';
    }
    $content .= '<li><a href="' . $tablink . '"><span>' . $status_name . ' (<span id="sc-' . $status . '" class="sc">' . $sc . '</span>)</span></a></li>';
}
$content .= '</ul>';
//SUB TABS
if ($is_display_subtab) {
    $content .= templateProductionSubTab($main_link);
}
$content .= '</div>';
//== END TEMPLATE =======================
if ($is_display_subtab) {
    $prod_sub_tab_vars['parseContent'] = array('"#tab-prod"', 'ui', 'true');
    $javascript .= templateJSProductionSubTab($prod_sub_tab_vars);
}
$javascript .= '
            var stop_loading = false;
            var max_orders_per_load = 100;
            var item_ids;
            var item_ids_to_be_loaded;
            var item_ids_last_loaded_index = 0;
            var n_orders_rendered = 0;
            var n_items = 0;
            var n_columns_table_main = 0;
            var n_columns_table_add = 0;
            var orders_base_template_loaded = 0;
            var last_row_class_used = "o";
            var selected_ui;
            var is_load_all = false;