<?php

$head = array(lang('sort_num'), array('text' => lang('sku'), 'sort_key' => 'sku', 'id' => 'purchase_list'), lang('image_url'), array('text' => lang('market_model'), 'sort_key' => 'market_model'), array('text' => lang('chinese_name'), 'sort_key' => 'name_cn'), array('text' => lang('7-days_sales_amounts'), 'sort_key' => 'sale_in_7_days'), array('text' => lang('30-days_sales_amounts'), 'sort_key' => 'sale_in_30_days'), array('text' => lang('60-days_sales_amounts'), 'sort_key' => 'sale_in_60_days'), array('text' => lang('dueout'), 'sort_key' => 'dueout_count'), array('text' => lang('stock_count'), 'sort_key' => 'stock_count'), array('text' => lang('storage_warning'), 'sort_key' => 'min_stock_number'), array('text' => lang('in_transit'), 'sort_key' => 'on_way_count'));
$data = array();
$index = 0;
foreach ($purchase_list as $purchase) {
    $data[] = array($index + 1, block_center(get_status_image($purchase['sku']) . $purchase['sku']), block_center(block_image($purchase['image_url'], array(40, 40))), block_center($purchase['market_model']), block_center($purchase['name_cn']), block_center($purchase['sale_in_7_days'] ? $purchase['sale_in_7_days'] : 0), block_center($purchase['sale_in_30_days'] ? $purchase['sale_in_30_days'] : 0), block_center($purchase['sale_in_60_days'] ? $purchase['sale_in_60_days'] : 0), block_center('<strong>' . $purchase['dueout_count'] . '</strong>'), block_center('<strong>' . $purchase['stock_count'] . '</strong>'), block_center($purchase['min_stock_number']), block_center($purchase['on_way_count']));
    $index++;
}
$filters = array(NULL, array('type' => 'input', 'field' => 'sku'), NULL, array('type' => 'input', 'field' => 'market_model'), array('type' => 'input', 'field' => 'name_cn'), array('type' => 'input', 'field' => 'sale_in_7_days'), array('type' => 'input', 'field' => 'sale_in_30_days'), array('type' => 'input', 'field' => 'sale_in_60_days'), array('type' => 'input', 'field' => 'dueout_count'), array('type' => 'input', 'field' => 'stock_count'));
$config = array('filters' => $filters);
$title = lang('wait_for_qt_check_product');
echo block_header($title);
echo $this->block->generate_pagination('purchase_list');
echo form_open();
echo $this->block->generate_reset_search($config);
echo $this->block->generate_table($head, $data, $filters, 'shipping_subarea_group');
echo form_close();
echo $this->block->generate_pagination('purchase_list');
Example #2
0
}
$data = array();
$forbidden_options = fetch_readable_statuses('ban_levels', TRUE);
foreach ($products as $product) {
    if ($action == 'edit') {
        if ($can_delete) {
            $drop_button = $this->block->generate_drop_icon('pi/product/drop_product', "{id: {$product->pid}}", TRUE);
        } else {
            $drop_button = '';
        }
        $edit_button = $this->block->generate_edit_link(site_url('pi/product/add_edit', array($product->pid)), TRUE);
        $url = $drop_button . $edit_button;
    } else {
        $url = $this->block->generate_view_link(site_url('pi/product/view', array($product->pid)), array(), TRUE, 'main-content-detail', 'main-content');
    }
    $item = array(block_image($product->image_url), $product->sku, $product->name_cn . br() . $product->name_en, $product->market_model, $product->shelf_code);
    if (product_can_write('price') or product_can_read('price')) {
        $item[] = $product->price;
    }
    if (product_can_write('stock_count') or product_can_read('stock_count')) {
        if (in_array($product->sku, $abroad_skus)) {
            $stock_count_html = "SZ : {$product->stock_count}" . "<br/>" . "UK : {$product->uk_stock_count}" . "<br/>" . "DE : {$product->de_stock_count}" . "<br/>" . "AU : {$product->au_stock_count}" . "<br/>" . "YB : {$product->yb_stock_count}" . "<br/>";
            $item[] = $stock_count_html;
        } else {
            $item[] = "SZ : {$product->stock_count}" . "<br/>";
        }
        $item[] = fetch_makeup_sku_count($product->sku);
    }
    if (product_can_write('min_stock_number') or product_can_read('min_stock_number')) {
        $item[] = $product->min_stock_number;
    }
function fetch_product_to_be_edit()
{
    $CI =& get_instance();
    $CI->load->model('product_model');
    $CI->load->model('product_permission_model');
    $CI->load->helper('product_permission_helper');
    $products = $CI->product_model->fetch_to_be_edit_products();
    $url = site_url('pi/product/manage');
    $head = array(lang('sku'), lang('image_url'), lang('chinese_name') . '/' . lang('english_name'), lang('market_model'), lang('sale_status'));
    if (product_can_write('sale_amount_level') or product_can_read('sale_amount_level')) {
        $head[] = lang('sale_amount_level');
    }
    if (product_can_write('sale_quota_level') or product_can_read('sale_quota_level')) {
        $head[] = lang('sale_quota_level');
    }
    if (product_can_write('forbidden_level') or product_can_read('forbidden_level')) {
        $head[] = lang('forbidden_level');
    }
    if (product_can_write('price') or product_can_read('price')) {
        $head[] = lang('price');
    }
    if (product_can_write('stock_count') or product_can_read('stock_count')) {
        $head[] = lang('stock_count');
    }
    if (product_can_write('min_stock_number') or product_can_read('min_stock_number')) {
        $head[] = lang('min_stock_number');
    }
    if (product_can_write('sale_in_7_days') or product_can_read('sale_in_7_days')) {
        $head[] = lang('7-days_sales_amounts');
    }
    if (product_can_write('sale_in_30_days') or product_can_read('sale_in_30_days')) {
        $head[] = lang('30-days_sales_amounts');
    }
    if (product_can_write('sale_in_60_days') or product_can_read('sale_in_90_days')) {
        $head[] = lang('60-days_sales_amounts');
    }
    $head[] = lang('add_dated') . anchor($url, lang('add_more'), array('style' => 'float:right;'));
    $data = array();
    $forbidden_options = fetch_readable_statuses('ban_levels', TRUE);
    foreach ($products as $product) {
        $item = array($product->sku, block_image($product->image_url), $product->name_cn . br() . $product->name_en, $product->market_model, get_status_image($product->sku));
        if (product_can_write('sale_amount_level') or product_can_read('sale_amount_level')) {
            $item[] = $product->sale_amount_level;
        }
        if (product_can_write('sale_quota_level') or product_can_read('sale_quota_level')) {
            $item[] = $product->sale_quota_level;
        }
        if (product_can_write('forbidden_level') or product_can_read('forbidden_level')) {
            $item[] = element($product->forbidden_level, $forbidden_options);
        }
        if (product_can_write('price') or product_can_read('price')) {
            $item[] = $product->price;
        }
        if (product_can_write('stock_count') or product_can_read('stock_count')) {
            $item[] = $product->stock_count;
        }
        if (product_can_write('min_stock_number') or product_can_read('min_stock_number')) {
            $item[] = $product->min_stock_number;
        }
        if (product_can_write('sale_in_7_days') or product_can_read('sale_in_7_days')) {
            $item[] = $product->sale_in_7_days;
        }
        if (product_can_write('sale_in_30_days') or product_can_read('sale_in_30_days')) {
            $item[] = $product->sale_in_30_days;
        }
        if (product_can_write('sale_in_60_days') or product_can_read('sale_in_90_days')) {
            $item[] = $product->sale_in_60_days;
        }
        $item[] = $product->updated_date;
        $data[] = $item;
    }
    return array($head, $data);
}
<?php

$head = array(lang('image_url'), array('text' => lang('sku'), 'sort_key' => 'sku', 'id' => 'product_basic'), array('text' => lang('chinese_name'), 'sort_key' => 'name_cn '), array('text' => lang('market_model'), 'sort_key' => 'market_model'), array('text' => lang('sale_status'), 'sort_key' => 'sale_status'), lang('options'));
$sale_statuse = array();
$sale_statuse[''] = lang('all');
$sale_statuse['0'] = lang('not_complete');
$sale_statuse['1'] = lang('out_of_stock');
$sale_statuse['2'] = lang('clear_stock');
$sale_statuse['3'] = lang('in_stock');
$data = array();
foreach ($waiting_products as $waiting_product) {
    $status_id = $waiting_product->sale_status;
    $edit_button = $this->block->generate_edit_link(site_url('pi/product/add_edit', array($waiting_product->id)), TRUE);
    $data[] = array(block_image($waiting_product->image_url), $waiting_product->sku, $waiting_product->name_cn . br() . $waiting_product->name_en, $waiting_product->market_model, $sale_statuse[$status_id], $edit_button);
}
$filters = array(NULL, array('type' => 'input', 'field' => 'sku'), array('type' => 'input', 'field' => 'product_basic.name_cn|product_basic.name_en'), array('type' => 'input', 'field' => 'market_model'));
$filters[] = array('type' => 'dropdown', 'field' => 'sale_status', 'options' => $sale_statuse, 'method' => '=');
$filters[] = '';
$title = lang('waiting_for_perfect_goods');
echo block_header($title);
echo $this->block->generate_pagination('product_basic');
$config = array('filters' => $filters);
echo form_open();
echo $this->block->generate_reset_search($config);
echo $this->block->generate_table($head, $data, $filters, 'product_basic');
echo form_close();
echo $this->block->generate_pagination('product_basic');
<?php

$head = array(lang('chinese_name'), lang('english_name'), lang('image_url'), lang('created_date'), lang('options'));
$data = array();
foreach ($product_packings as $packing) {
    if ($action == 'edit') {
        $drop_button = $this->block->generate_drop_icon('pi/packing/drop_product_packing', "{id: {$packing->id}}", TRUE);
        $edit_button = $this->block->generate_edit_link(site_url('pi/packing/edit', array($packing->id)));
        $url = $drop_button . $edit_button;
    } else {
        $url = $this->block->generate_view_link(site_url('pi/packing/view', array($packing->id)));
    }
    $data[] = array($packing->name_cn, $packing->name_en, block_image($packing->image_url), $packing->created_date, $url);
}
echo block_header(lang('packing_management'));
echo $this->block->generate_table($head, $data);
                $min_stock_number_html .= $purchase['au_min_stock_number'] == '' ? '' : '<font color=blue>' . $purchase['au_min_stock_number'] . '</font>' . ' (AU) <br/>';
                $purchase_suggestion_html .= $purchase['au_purchase_suggestion'] <= 0 ? '' : '<font color=blue>' . $purchase['au_purchase_suggestion'] . '</font>' . ' (AU) <br/>';
            }
            if ($code->stock_code == 'YB') {
                $dueout_count_html .= $purchase['yb_dueout_count'] == '' ? '' : '<font color=blue>' . $purchase['yb_dueout_count'] . '</font>' . ' (YB) <br/>';
                $stock_count_html .= $purchase['yb_stock_count'] == '' ? '' : '<font color=blue>' . $purchase['yb_stock_count'] . '</font>' . ' (YB) <br/>';
                $on_way_count_html .= $purchase['yb_on_way_count'] == '' ? '' : '<font color=blue>' . $purchase['yb_on_way_count'] . '</font>' . ' (YB) <br/>';
                $min_stock_number_html .= $purchase['yb_min_stock_number'] == '' ? '' : '<font color=blue>' . $purchase['yb_min_stock_number'] . '</font>' . ' (YB) <br/>';
                $purchase_suggestion_html .= $purchase['yb_purchase_suggestion'] <= 0 ? '' : '<font color=blue>' . $purchase['yb_purchase_suggestion'] . '</font>' . ' (AU) <br/>';
            }
        }
    } else {
        $dueout_count_html .= $purchase['dueout_count'] == '' ? '' : '<font color=blue>' . $purchase['dueout_count'] . '</font>' . '<br/>';
        $stock_count_html .= $purchase['stock_count'] == '' ? '' : '<font color=blue>' . $purchase['stock_count'] . '</font>' . '<br/>';
        $on_way_count_html .= $purchase['on_way_count'] == '' ? '' : '<font color=blue>' . $purchase['on_way_count'] . '</font>' . '<br/>';
        $min_stock_number_html .= $purchase['min_stock_number'] == '' ? '' : '<font color=blue>' . $purchase['min_stock_number'] . '</font>' . '<br/>';
        $purchase_suggestion_html .= $purchase['purchase_suggestion'] <= 0 ? '' : '<font color=blue>' . $purchase['purchase_suggestion'] . '</font>' . '<br/>';
        //        $purchase_suggestion = $purchase['purchase_suggestion'] <= 0 ? 0 : $purchase['purchase_suggestion'];
    }
    $data[] = array(form_checkbox($select_data), block_center(block_image($purchase['image_url'], array(40, 40))), get_status_image($purchase['sku']) . anchor(site_url('pi/product/add_edit', array($purchase['id'])), block_center($purchase['sku']), array('target' => '_blank')), block_center($purchase['market_model']), block_center($purchase['name_cn']), block_center($purchase['7_days_sale_amount'] ? $purchase['7_days_sale_amount'] : 0), block_center($purchase['30_days_sale_amount'] ? $purchase['30_days_sale_amount'] : 0), block_center($purchase['60_days_sale_amount'] ? $purchase['60_days_sale_amount'] : 0), block_center('<strong>' . "{$dueout_count_html}" . '</strong>'), block_center('<strong>' . $stock_count_html . '</strong>'), block_center($min_stock_number_html), block_center($on_way_count_html), block_center($purchase_suggestion_html), '', block_center($purchase['purchaser']), $purchase['providers']);
    $index++;
}
$batch_purchase = site_url('purchase/order/batch_purchase_sku');
echo form_open($batch_purchase);
echo block_js_sortable_table($head, $data, array(NULL, 'default', NULL, 'default', 'default', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', NULL, 'default'), "width: 100%;border-collapse: collapse;");
echo form_hidden('item_count', $index);
$print_label = '<span style="float:right;">';
$print_label .= form_submit('batch_purchase', lang('batch_purchase'));
$print_label .= '</span>';
echo block_check_all() . $print_label;
echo form_close();
$head = array(lang('name'), lang('value'));
$ebay_url = 'http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=';
$item_title_str = str_replace(',', '<br/>', $order->item_title_str);
$item_ids = explode(',', $order->item_id_str);
$skus = explode(',', $order->sku_str);
$qties = explode(',', $order->qty_str);
$count = count($skus);
$item_sku_html = '';
$item_sku_html .= "<div id='item_div_{$order->id}'>";
for ($i = 0; $i < $count; $i++) {
    $config = array('name' => 'submit', 'value' => lang('delete'), 'type' => 'button', 'onclick' => "delete_sku('sku_{$skus[$i]}');");
    $item_sku_html .= "<div id='sku_{$skus[$i]}' style='margin-top: 5px;'>";
    $qty = element($i, $qties);
    $item_sku_html .= '<input name="sku[]" type="hidden" value="' . $skus[$i] . '" />' . ' SKU: ' . (isset($skus[$i]) ? $skus[$i] . ' * ' . '<input type="text" name="qty[]" value="' . $qty . '" />' . ' (' . get_product_name($skus[$i]) . ')' : '');
    $item_sku_html .= block_button($config) . '<br/>' . block_image(get_product_image($skus[$i]));
    $item_sku_html .= '</div>';
}
$item_sku_html .= '</div>';
$product_info = <<<PRODUCT
    <div style='padding: 10px;'>
    {$item_sku_html}
    </div>
PRODUCT;
$data = array(array(lang('item_number'), $order->item_no), array(lang('item_id_str'), $order->item_id_str), array(lang('name'), $order->name), array(lang('buyer_id'), $order->buyer_id), array(lang('address_line_1'), $order->address_line_1), array(lang('address_line_2'), $order->address_line_2), array(lang('town_city'), $order->town_city), array(lang('state_province'), $order->state_province), array(lang('country'), $order->country), array(lang('zip_code'), $order->zip_code), array(lang('contact_phone_number'), $order->contact_phone_number), array(lang('is_register'), $order->is_register), array(lang('product_list'), $product_info), array(lang('net'), $order->net . '(' . $order->currency . ')'), array(lang('transaction_id'), $order->transaction_id), array(lang('description'), $order->descript), array(lang('ship_remark'), $order->ship_remark), array(lang('item_no'), $order->item_no));
$config = array('name' => 'sys_remark', 'value' => $order->sys_remark, 'cols' => 90, 'rows' => 3, 'readonly' => 'ture');
$data[] = array(lang('sys_remark'), form_textarea($config));
$options_status = array('waiting_for_testing' => lang('waiting_for_testing'), 'perfect' => lang('perfect'), 'repairing' => lang('repairing'), 'fixed' => lang('fixed'), 'beyond_repair' => lang('beyond_repair'));
$options_cause = array('quality_problems' => lang('quality_problems'), 'address_unknown' => lang('address_unknown'), 'request_for_replacement' => lang('request_for_replacement'), 'customer_reject' => lang('customer_reject'), 'prohibit_importing' => lang('prohibit_importing'), 'address_not_arrived' => lang('address_not_arrived'), 'customer_removal' => lang('customer_removal'), 'unclaimed' => lang('unclaimed'), 'undeliverable' => lang('undeliverable'), 'customer_returned' => lang('customer_returned'), 'no_send' => lang('no_send'), 'other' => lang('other'));
$data[] = array($this->block->generate_required_mark(lang('recommend_status')), form_dropdown('recommend_status', $options_status, 'waiting_for_testing'));
$config = array('name' => 'recommend_no', 'id' => 'recommend_no', 'maxlength' => '90', 'size' => '35');
    $select_purchaser = form_dropdown('select_purchaser', $options, $purchaser_id, $js);
}
?>
<table width="100%" border="0" align="center">
    <tr>
        <td><?php 
echo lang('deadline_of_order_confirmation');
?>
 : <?php 
echo $fetch_dueout_update_time;
?>
</td>
        <td style="float: right;"><?php 
echo $select_purchaser;
?>
</td>
    </tr>
</table>

<?php 
$head = array(lang('sort_num'), lang('sku'), lang('image_url'), lang('market_model'), lang('chinese_name'), lang('7-days_sales_amounts'), lang('30-days_sales_amounts'), lang('60-days_sales_amounts'), lang('dueout'), lang('stock_count'), lang('storage_warning'), lang('in_transit'), lang('purchasing_suggested'), lang('purchasing_actually'), lang('purchaser'), lang('price') . ' / ' . lang('provider'));
$data = array();
$index = 0;
foreach ($purchase_list as $purchase) {
    $data[] = array($index + 1, get_status_image($purchase['sku']) . anchor(site_url('pi/product/add_edit', array($purchase['id'])), block_center($purchase['sku']), array('target' => '_blank')), block_center(block_image($purchase['image_url'], array(40, 40))), block_center($purchase['market_model']), block_center($purchase['name_cn']), block_center($purchase['7_days_sale_amount'] ? $purchase['7_days_sale_amount'] : 0), block_center($purchase['30_days_sale_amount'] ? $purchase['30_days_sale_amount'] : 0), block_center($purchase['60_days_sale_amount'] ? $purchase['60_days_sale_amount'] : 0), block_center('<strong>' . $purchase['dueout_count'] . '</strong>'), block_center('<strong>' . $purchase['stock_count'] . '</strong>'), block_center($purchase['min_stock_number']), block_center($purchase['on_way_count']), block_center($purchase['purchase_suggestion']), '', block_center($purchase['purchaser']), $purchase['providers']);
    $index++;
}
$batch_purchase = site_url('purchase/order/batch_purchase_sku');
echo form_open($batch_purchase);
echo block_js_sortable_table($head, $data, array(NULL, 'default', NULL, 'default', 'default', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', NULL, 'default'), "width: 100%;border-collapse: collapse;");
echo form_close();