function object_to_js_array($object, $column_key, $column_value) { $array = array(); foreach ($object as $item) { $array[$item->{$column_key}] = $item->{$column_value}; } return to_js_array($array); }
<?php $data = array('100' => '100%', '10' => '10%', '20' => '20%', '30' => '30%', '40' => '40%', '50' => '50%', '60' => '60%', '70' => '70%', '80' => '80%', '90' => '90%'); $collection = to_js_array($data); $head = array(array('text' => lang('item_no'), 'sort_key' => 'o_item_no', 'id' => 'purchase_how'), array('text' => lang('provider'), 'sort_key' => 'pp_name'), '', array('text' => lang('purchaser'), 'sort_key' => 'u_name')); $data = array(); foreach ($review_orders as $review_order) { $skus_head = array(lang('picture'), lang('sku'), lang('chinese_name'), lang('purchase_cost'), lang('purchase_quantity'), lang('fcommitqty'), lang('how_way'), lang('qualified_number'), lang('options')); $review_skus = $this->purchase_order_model->fetch_how_skus($review_order->o_id); $skus_data = array(); $sku_url = site_url('purchase/order/update_how_number'); foreach ($review_skus as $review_sku) { $reset_url = site_url('purchase/order/cancel_how', array('sku_id' => $review_sku->s_id)); $reset_button = anchor($reset_url, form_button('name', lang('reject'))); $hows = $this->purchase_order_model->fetch_purchase_how($review_sku->s_id); if (isset($hows->qualified_number) && $hows->qualified_number > 0) { $qualified_number = $hows->qualified_number; $how_number = $qualified_number . '+'; } else { $how_number = ''; } $how_way = $this->purchase_order_model->fetch_how_way($review_sku->s_id); $skus_data[] = array("<img src='{$review_sku->m_image_url}' width=40 height=30 />", get_status_image($review_sku->s_sku) . $review_sku->s_sku, $review_sku->b_name_cn, price($review_sku->s_sku_price * $review_sku->s_quantity), $review_sku->s_quantity, $review_sku->s_arrival_quantity, $this->block->generate_div("how_way_{$review_sku->s_id}", isset($how_way->how_way) ? $how_way->how_way . '%' : '100%'), $how_number . $this->block->generate_div("qualified_number_{$review_sku->s_id}", '[0]'), '<div style="float:right;margin:5px;" >' . $reset_button . '</div>'); echo $this->block->generate_editor("how_way_{$review_sku->s_id}", 'product_how_form', $sku_url, "{id: {$review_sku->s_id}, type: 'how_way'}", "{$collection}"); echo $this->block->generate_editor("qualified_number_{$review_sku->s_id}", 'product_how_form', $sku_url, "{id: {$review_sku->s_id}, type: 'qualified_number'}"); } $skus_table = $this->block->generate_table($skus_head, $skus_data); $drop_button = $this->block->generate_drop_icon('purchase/order/drop_order', "{id: {$review_order->o_id}}", TRUE); $data[] = array($review_order->o_item_no, $review_order->pp_name, $skus_table, $review_order->u_name); } $title = lang('how_table_of_orders');
<?php $sale_users = $this->user_model->fetch_users_by_system_code('sale'); $salers_options = array(); foreach ($sale_users as $sale_user) { $salers_options[$sale_user->u_id] = $sale_user->u_name; } $collection = to_js_array($salers_options); $input_user_options = $paypal_emails; $input_user_options['remove_input_user'] = lang('remove_paypal_email'); $input_user_collection = to_js_array($input_user_options); $yes = lang('yes'); $no = lang('no'); $in_operation_collection = to_js_array(array('1' => $yes, '0' => $no)); $url = site_url('sale/sale_order/add_saler_input_user'); $add_button = $this->block->generate_add_icon($url); $head = array(lang('saler'), lang('paypal_email'), lang('in_operation'), lang('options') . $add_button); $data = array(); $saler_url = site_url('sale/sale_order/verify_saler_input_user'); foreach ($salers as $saler) { $drop_button = $this->block->generate_drop_icon('sale/sale_order/drop_saler_input_user', "{id: {$saler->saler_id}}", TRUE); $more_button = block_more_icon('sale/sale_order/saler_add_input_user', "{saler_id: {$saler->saler_id}}"); $input_user_url = site_url('sale/sale_order/verify_input_user'); $input_users = $this->sale_order_model->saler_fetch_input_users($saler->saler_id); $input_users_str = ''; foreach ($input_users as $inputuser) { if ('void' == $inputuser->paypal_email) { $input_user = '******'; } else { $input_user = $inputuser->paypal_email; }
<?php $add_button = $this->block->generate_add_icon('order/setting/add_stmp_host'); $head = array(lang('host'), lang('port'), lang('is_ssl'), lang('options') . $add_button); $host_update_url = site_url('order/setting/update_stmp_host'); $yes = lang('yes'); $no = lang('no'); $ssl_collection = to_js_array(array('1' => $yes, '0' => $no)); $data = array(); foreach ($hosts as $host) { $host_id = $host->id; $drop_button = block_drop_icon('order/setting/drop_stmp_host', "{id: {$host_id}}", TRUE); $data[] = array($this->block->generate_div("stmp_host_{$host_id}", $host->host), $this->block->generate_div("stmp_port_{$host_id}", $host->port), $this->block->generate_div("stmp_is_ssl_{$host_id}", $host->is_ssl == 1 ? $yes : $no), $drop_button); echo $this->block->generate_editor("stmp_host_{$host_id}", 'host_form', $host_update_url, "{id: {$host_id}, type: 'host'}"); echo $this->block->generate_editor("stmp_port_{$host_id}", 'host_form', $host_update_url, "{id: {$host_id}, type: 'port'}"); echo $this->block->generate_editor("stmp_is_ssl_{$host_id}", 'host_form', $host_update_url, "{id: {$host_id}, type: 'is_ssl'}", $ssl_collection); } echo block_header(lang('stmp_host_setting')); echo block_table($head, $data);
<?php $url = site_url('order/country_list/add_country_code'); $add_button = $this->block->generate_add_icon($url); $head = array(array('text' => lang('code'), 'sort_key' => 'code', 'id' => 'country_code'), array('text' => lang('country_name_en'), 'sort_key' => 'name_en'), lang('country_name_cn'), array('text' => lang('continent'), 'sort_key' => 'continent'), lang('post_p') . lang('order_check_address'), lang('post_p') . lang('taobao_deliver_code'), lang('options') . $add_button); $data = array(); $code_url = site_url('order/country_list/verigy_country_code'); foreach ($applys as $apply) { $drop_button = $this->block->generate_drop_icon('order/country_list/drop_country_code', "{id: {$apply->id}}", TRUE); $data[] = array($this->block->generate_div("code_{$apply->id}", empty($apply->code) ? '[edit]' : $apply->code), $this->block->generate_div("name_en_{$apply->id}", empty($apply->name_en) ? '[edit]' : $apply->name_en), $this->block->generate_div("name_cn_{$apply->id}", empty($apply->name_cn) ? '[edit]' : $apply->name_cn), $this->block->generate_div("continent_id_{$apply->id}", empty($apply->continent_id) ? '[edit]' : $apply->continent_name), $this->block->generate_div("regular_check_url_{$apply->id}", empty($apply->regular_check_url) ? '[edit]' : $apply->regular_check_url), $this->block->generate_div("regular_carrier_{$apply->id}", empty($apply->regular_carrier) ? '[edit]' : $apply->regular_carrier), $drop_button); $option_continent = array(); foreach ($continents as $continent) { $option_continent["{$continent->id}"] = $continent->name_cn; } $option_continent = to_js_array($option_continent); echo $this->block->generate_editor("regular_check_url_{$apply->id}", 'country_code_form', $code_url, "{id: {$apply->id}, type: 'regular_check_url'}"); echo $this->block->generate_editor("regular_carrier_{$apply->id}", 'country_code_form', $code_url, "{id: {$apply->id}, type: 'regular_carrier'}"); echo $this->block->generate_editor("continent_id_{$apply->id}", 'country_code_form', $code_url, "{id: {$apply->id}, type: 'continent_id'}", $option_continent); echo $this->block->generate_editor("code_{$apply->id}", 'country_code_form', $code_url, "{id: {$apply->id}, type: 'code'}"); echo $this->block->generate_editor("name_en_{$apply->id}", 'country_code_form', $code_url, "{id: {$apply->id}, type: 'name_en'}"); echo $this->block->generate_editor("name_cn_{$apply->id}", 'country_code_form', $code_url, "{id: {$apply->id}, type: 'name_cn'}"); } $title = lang('country_setting_list'); echo block_header($title); $filters = array(array('type' => 'input', 'field' => 'code'), array('type' => 'input', 'field' => 'cc.name_en'), array('type' => 'input', 'field' => 'cc.name_cn')); echo $this->block->generate_pagination('country_code'); $config = array('filters' => $filters); echo form_open(); echo $this->block->generate_reset_search($config); echo $this->block->generate_table($head, $data, $filters, 'country_code'); echo form_close();
$url = site_url('pi/home_setting/add_setting'); $add_button = $this->block->generate_add_icon($url); $head = array(lang('group'), lang('key'), lang('options') . $add_button); $data = array(); foreach ($statistics_groups as $group_obj) { $drop_button = $this->block->generate_drop_icon('pi/home_setting/delete_setting_by_group_id', "{group_id: {$group_obj->group_id}}", TRUE); $more_button = block_more_icon('pi/home_setting/add_setting_for_group_id', "{group_id: {$group_obj->group_id}}"); $key_url = site_url('pi/home_setting/update_setting'); $key_str = ''; foreach ($group_keys["{$group_obj->group_id}"] as $key) { if ('' == $key->key) { $key_val = '[edit]'; } else { $key_val = lang($key->key); } $key_str .= $this->block->generate_div("key_{$key->id}", $key_val) . '<br>'; echo $this->block->generate_editor("key_{$key->id}", 'statistics_form', $key_url, "{id: {$key->id}, type: 'key'}", to_js_array($key_arr)); } $key_str .= $more_button; $data[] = array($this->block->generate_div("group_id_{$group_obj->group_id}", isset($group_obj) && $group_obj->group_id != '0' ? $groups["{$group_obj->group_id}"] : '[edit]'), $key_str, $drop_button); echo $this->block->generate_editor("group_id_{$group_obj->group_id}", 'statistics_form', site_url('pi/home_setting/update_setting'), "{id: {$group_obj->group_id}, type: 'group_id'}", to_js_array($groups)); } $title = lang('home_setting'); echo block_header($title); echo form_open(); echo $this->block->generate_table($head, $data); echo form_close(); ?>
<?php $options_status = array('waiting_for_testing' => lang('waiting_for_testing'), 'perfect' => lang('perfect'), 'repairing' => lang('repairing'), 'fixed' => lang('fixed'), 'beyond_repair' => lang('beyond_repair'), 'warehousing' => lang('warehousing')); $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')); $options_finish = array('wait_for_proccess' => lang('wait_for_proccess'), 'resend_new_ones_and_close' => lang('resend_new_ones_and_close'), 'send_fixed_item_back_and_close' => lang('send_fixed_item_back_and_close'), 'refund_and_close' => lang('refund_and_close'), 'other_situations_close' => lang('other_situations_close')); $collection_cause = to_js_array($options_cause); $collection_status = to_js_array($options_status); $collection_finish = to_js_array($options_finish); $head = array(array('text' => lang('recommend_number_and_time'), 'sort_key' => 'recommend_no', 'id' => 'recommend'), array('text' => lang('old_order_address_info'), 'sort_key' => 'order_id'), array('text' => lang('old_order_list_and_money'), 'sort_key' => 'order_id'), array('text' => lang('receive_product_list'), 'sort_key' => 'sku_str'), array('text' => lang('recommend_cause'), 'sort_key' => 'cause'), array('text' => lang('sys_remark')), array('text' => lang('ship_remark')), array('text' => lang('recommend_remark'), 'sort_key' => 'remark'), array('text' => lang('recommend_status'), 'sort_key' => 'status'), lang('options')); $data = array(); foreach ($recommends as $recommend) { // $order = get_order_info($recommend->order_id); $ebay_url = 'http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item='; $skus = explode(',', $recommend->sku_str); $qties = explode(',', $recommend->qty_str); $count = count($skus); $item_sku_html = ''; $item_sku_html .= "<div>"; for ($i = 0; $i < $count; $i++) { $item_sku_html .= '<div style="margin-top: 5px;">'; $item_sku_html .= ' SKU: ' . (isset($skus[$i]) ? $skus[$i] . ' * ' . element($i, $qties) . ' (' . get_product_name($skus[$i]) . ')' : '') . '<br/>'; $item_sku_html .= '</div>'; } $item_sku_html .= '</div>'; $product_info = <<<PRODUCT <div style='padding: 10px;'> {$item_sku_html} </div> PRODUCT; $old_order_info = ''; $old_product_info = '';
$url = site_url('order/setting/add_bad_comment_type'); $add_button = $this->block->generate_add_icon($url); $head = array(lang('order_bad_comment_type'), lang('order_status'), lang('person_responsible'), lang('department_responsible'), lang('is_show_sku'), lang('confirm_required'), lang('creator'), lang('created_date'), lang('options') . $add_button); $data = array(); $code_url = site_url('order/setting/verify_bad_comment_type'); $system_names = to_js_array($system_names); foreach ($comment_types as $comment_type) { $drop_button = $this->block->generate_drop_icon('order/setting/drop_bad_comment_type', "{id: {$comment_type->id}}", TRUE); $creator_name = $this->user_model->fetch_user_name_by_id($comment_type->creator); $confirm_required = $comment_type->confirm_required ? lang('yes') : lang('no'); $default_refund_show_sku = $comment_type->default_refund_show_sku ? lang('yes') : lang('no'); $department = lang($this->order_model->get_one('system', 'name', array('code' => $comment_type->department))); $data[] = array($this->block->generate_div("comment_type_{$comment_type->id}", empty($comment_type->type) ? '[edit]' : $comment_type->type), $this->block->generate_div("default_refund_type_{$comment_type->id}", empty($comment_type->default_refund_type) ? '[edit]' : lang(fetch_status_name('order_status', $comment_type->default_refund_type))), $this->block->generate_div("default_refund_duty_{$comment_type->id}", empty($comment_type->default_refund_duty) ? '[edit]' : $comment_type->default_refund_duty), $this->block->generate_div("default_refund_department_duty_{$comment_type->id}", empty($department) ? '[edit]' : $department), $this->block->generate_div("default_refund_show_sku_{$comment_type->id}", $default_refund_show_sku), $this->block->generate_div("confirm_required_{$comment_type->id}", empty($confirm_required) ? '[edit]' : $confirm_required), $creator_name, $comment_type->created_date, $drop_button); $order_status_collection = array('' => lang('please_select')); foreach ($order_status as $key => $value) { $order_status_collection[$key] = lang($value); } $collection = to_js_array($order_status_collection); echo $this->block->generate_editor("default_refund_type_{$comment_type->id}", 'comment_type_form', $code_url, "{id: {$comment_type->id}, type: 'default_refund_type'}", $collection); echo $this->block->generate_editor("default_refund_duty_{$comment_type->id}", 'comment_type_form', $code_url, "{id: {$comment_type->id}, type: 'default_refund_duty'}"); echo $this->block->generate_editor("default_refund_department_duty_{$comment_type->id}", 'comment_type_form', $code_url, "{id: {$comment_type->id}, type: 'department'}", $system_names); echo $this->block->generate_editor("comment_type_{$comment_type->id}", 'comment_type_form', $code_url, "{id: {$comment_type->id}, type: 'type'}"); $confirm_required = to_js_array(array('1' => lang('yes'), '0' => lang('no'))); echo $this->block->generate_editor("confirm_required_{$comment_type->id}", 'comment_type_form', $code_url, "{id: {$comment_type->id}, type: 'confirm_required'}", $confirm_required); echo $this->block->generate_editor("default_refund_show_sku_{$comment_type->id}", 'comment_type_form', $code_url, "{id: {$comment_type->id}, type: 'default_refund_show_sku'}", $confirm_required); } $title = lang('order_bad_comment_type_setting'); echo block_header($title); echo form_open(); echo $this->block->generate_table($head, $data); echo form_close();
<?php $url = site_url('order/power_manage/add_power_management'); $add_button = $this->block->generate_add_icon($url); $head = array(lang('superintendent'), lang('login_name'), lang('options') . $add_button); $data = array(); $code_url = site_url('order/power_manage/verigy_exchange_power_management'); foreach ($power_managements as $power_management) { $drop_button = $this->block->generate_drop_icon('order/power_manage/drop_power_management_by_id', "{id: {$power_management->id}}", TRUE); $data[] = array($this->block->generate_div("superintendent_id_{$power_management->id}", isset($power_management) && $power_management->u_name ? $power_management->u_name : '[edit]'), $this->block->generate_div("login_name_str_{$power_management->id}", isset($power_management) ? $power_management->login_name_str : '[edit]'), $drop_button); $order_options = array(); foreach ($all_order_users as $all_order_user) { $order_options[$all_order_user->u_id] = $all_order_user->u_name; } $collection = to_js_array($order_options); echo $this->block->generate_editor("superintendent_id_{$power_management->id}", 'order_form', $code_url, "{id: {$power_management->id}, type: 'superintendent_id'}", $collection); echo $this->block->generate_editor("login_name_str_{$power_management->id}", 'order_form', $code_url, "{id: {$power_management->id}, type: 'login_name_str'}"); } $title = lang('manage_power_set'); echo block_header($title); echo form_open(); echo $this->block->generate_table($head, $data); echo form_close();
function to_js_array($val) { if (is_numeric($val)) { return $val; } if (is_string($val)) { return '"' . $val . '"'; } if (is_bool($val)) { return $var ? 'true' : 'false'; } if (is_null($val)) { return 'NULL'; } if (is_object($val)) { return 'N/A'; } $jsArray = '['; $count = count($val); for ($i = 0; $i < $count; $i++) { $jsArray .= to_js_array($val[$i]); $jsArray .= $i < $count - 1 ? ', ' : ''; } return $jsArray . ']'; }
$url = site_url('shipping/shipping_code/add_shipping_code'); $add_button = $this->block->generate_add_icon($url); $head = array(lang('shipping_code'), lang('english_name'), lang('chinese_name'), lang('order_check_address'), lang('contact_phone_requred'), lang('stock_code'), lang('taobao_deliver_code'), lang('wish_deliver_code'), lang('ydf_code'), lang('is_tracking'), lang('created_date'), lang('options') . $add_button); $data = array(); $code_url = site_url('shipping/shipping_code/verigy_shipping_code'); foreach ($shipping_codes as $shipping_code) { $drop_button = $this->block->generate_drop_icon('shipping/shipping_code/drop_shipping_code', "{id: {$shipping_code->id}}", TRUE); $data[] = array($this->block->generate_div("code_{$shipping_code->id}", empty($shipping_code->code) ? '[edit]' : $shipping_code->code), $this->block->generate_div("name_en_{$shipping_code->id}", empty($shipping_code->name_en) ? '[edit]' : $shipping_code->name_en), $this->block->generate_div("name_cn_{$shipping_code->id}", empty($shipping_code->name_cn) ? '[edit]' : $shipping_code->name_cn), $this->block->generate_div("check_url_{$shipping_code->id}", empty($shipping_code->check_url) ? '[edit]' : $shipping_code->check_url), $this->block->generate_div("contact_phone_requred_{$shipping_code->id}", empty($shipping_code->contact_phone_requred) ? lang('no') : lang('yes')), $this->block->generate_div("stock_code_{$shipping_code->id}", empty($shipping_code->stock_code) ? '[edit]' : $shipping_code->stock_code), $this->block->generate_div("taobao_company_code_{$shipping_code->id}", empty($shipping_code->taobao_company_code) ? '[edit]' : $shipping_code->taobao_company_code), $this->block->generate_div("wish_company_code_{$shipping_code->id}", empty($shipping_code->wish_company_code) ? '[edit]' : $shipping_code->wish_company_code), $this->block->generate_div("ydf_code_{$shipping_code->id}", empty($shipping_code->ydf_code) ? '[edit]' : $shipping_code->ydf_code), $this->block->generate_div("is_tracking_{$shipping_code->id}", empty($shipping_code->is_tracking) ? lang('no') : lang('yes')), $shipping_code->created_date, $drop_button); echo $this->block->generate_editor("code_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'code'}"); echo $this->block->generate_editor("name_en_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'name_en'}"); echo $this->block->generate_editor("name_cn_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'name_cn'}"); echo $this->block->generate_editor("check_url_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'check_url'}"); echo $this->block->generate_editor("taobao_company_code_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'taobao_company_code'}"); echo $this->block->generate_editor("wish_company_code_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'wish_company_code'}"); echo $this->block->generate_editor("ydf_code_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'ydf_code'}"); $stock_code_arr = array(); foreach ($stock_codes as $code) { $stock_code_arr["{$code->stock_code}"] = $code->stock_code; } $collection = to_js_array($stock_code_arr); echo $this->block->generate_editor("stock_code_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'stock_code'}", $collection); $collection_phone = to_js_array(array('1' => lang('yes'), '0' => lang('no'))); echo $this->block->generate_editor("contact_phone_requred_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'contact_phone_requred'}", $collection_phone); echo $this->block->generate_editor("is_tracking_{$shipping_code->id}", 'shipping_code_form', $code_url, "{id: {$shipping_code->id}, type: 'is_tracking'}", $collection_phone); } $title = lang('shipping_code_setting'); echo block_header($title); echo form_open(); echo $this->block->generate_table($head, $data); echo form_close();
function greate_provider_block($object, $product_id, $providers = array()) { $data = array('1' => '1', '2' => '2', '3' => '3'); $collection = to_js_array($data); $provider_id = 1; $url = site_url('purchase/provider/add_provider_sku', array('provider_id' => -1)); $add_button = $object->block->generate_add_icon($url, "{product_id: {$product_id}}"); $head = array(lang('provider_name'), lang('1_to_9_price'), lang('10_to_99_price'), lang('100_to_999_price'), lang('1000_price'), lang('provider_sequence'), lang('separating_shipping_cost'), lang('options') . $add_button); $sku_url = site_url('purchase/provider/update_provider_sku', array('provider_id' => -1)); $data = array(); foreach ($providers as $provider) { $drop_button = $object->block->generate_drop_icon('purchase/provider/drop_provider_sku', "{id: {$provider->m_id}}", TRUE); $provider_name = $object->purchase_model->fetch_provider_name_by_id($provider->m_provider_id); $id = 'provider_name_' . $provider->m_id; $config = array('name' => $id, 'id' => $id, 'value' => !empty($provider_name) ? $provider_name : '', 'maxlength' => '100', 'size' => '30'); $provider_name_html = form_input($config); $config_save = array('name' => 'save_provider_name', 'value' => lang('save'), 'type' => 'button', 'onclick' => "hide_label('{$id}');helper.ajax('{$sku_url}', {id: {$provider->m_id}, product_id: {$product_id}, provider_name: \$('{$id}').value});"); $url = site_url('purchase/provider/add', array('popup', "provider_name_{$provider->m_id}")); $anchor = anchor($url, lang('create_provider'), array('title' => 'click to set up!', 'onclick' => 'helper.modal(this); return false;')); $attributes = array('id' => 'label_content'); if (!empty($provider_name)) { $provider_name_html .= form_input($config_save); } else { $provider_name_html .= form_input($config_save) . ' ' . form_label($anchor, null, $attributes); } echo $object->block->generate_ac($id, array('purchase_provider', 'name')); $data[] = array($object->block->generate_div("provider_{$provider->m_id}", $provider_name_html), $object->block->generate_div("price1to9_{$provider->m_id}", $provider->m_price1to9), $object->block->generate_div("price10to99_{$provider->m_id}", $provider->m_price10to99), $object->block->generate_div("price100to999_{$provider->m_id}", $provider->m_price100to999), $object->block->generate_div("price1000_{$provider->m_id}", $provider->m_price1000), $object->block->generate_div("provide_level_{$provider->m_id}", $provider->m_provide_level), $object->block->generate_div("separating_shipping_cost_{$provider->m_id}", $provider->m_separating_shipping_cost), $drop_button); echo $object->block->generate_editor("price1to9_{$provider->m_id}", 'price1to9_form', $sku_url, "{id: {$provider->m_id}, type: 'price1to9'}"); echo $object->block->generate_editor("price10to99_{$provider->m_id}", 'price10to99_form', $sku_url, "{id: {$provider->m_id}, type: 'price10to99'}"); echo $object->block->generate_editor("price100to999_{$provider->m_id}", 'price100to999_form', $sku_url, "{id: {$provider->m_id}, type: 'price100to999'}"); echo $object->block->generate_editor("price1000_{$provider->m_id}", 'price1000_form', $sku_url, "{id: {$provider->m_id}, type: 'price1000'}"); echo $object->block->generate_editor("provide_level_{$provider->m_id}", 'provide_level_form', $sku_url, "{id: {$provider->m_id}, type: 'provide_level'}", "{$collection}"); echo $object->block->generate_editor("separating_shipping_cost_{$provider->m_id}", 'separating_shipping_cost_form', $sku_url, "{id: {$provider->m_id}, type: 'separating_shipping_cost'}"); } return $object->block->generate_table($head, $data); }
<?php $url = site_url('stock/stock_code/add_currency_stock_code'); $add_button = $this->block->generate_add_icon($url); $head = array(array('text' => lang('stock_code'), 'sort_key' => 'stock_code', 'id' => 'stock_code'), array('text' => lang('state'), 'sort_key' => 'status'), array('text' => lang('created_date'), 'sort_key' => 'created_date'), lang('oversea'), lang('options') . $add_button); $data = array(); $code_url = site_url('stock/stock_code/verigy_exchange_stock_code'); foreach ($all_codes as $code) { $drop_button = $this->block->generate_drop_icon('stock/stock_code/drop_stock_code', "{id: {$code->id}}", TRUE); $data[] = array($this->block->generate_div("stock_code_{$code->id}", isset($code) && $code->stock_code != '[edit]' ? $code->stock_code : '[edit]'), $this->block->generate_div("status_{$code->id}", empty($code->status) ? lang('disable') : lang('enable')), $code->created_date, $this->block->generate_div("abroad_{$code->id}", empty($code->abroad) ? lang('no') : lang('yes')), $drop_button); echo $this->block->generate_editor("stock_code_{$code->id}", 'stock_code_form', $code_url, "{id: {$code->id}, type: 'stock_code'}"); $collection = array('1' => lang('enable'), '0' => lang('disable')); echo $this->block->generate_editor("status_{$code->id}", 'stock_code_form', $code_url, "{id: {$code->id}, type: 'status'}", to_js_array($collection)); $collection = array('1' => lang('yes'), '0' => lang('no')); echo $this->block->generate_editor("abroad_{$code->id}", 'stock_code_form', $code_url, "{id: {$code->id}, type: 'abroad'}", to_js_array($collection)); } $filters = array(array('type' => 'input', 'field' => 'stock_code'), null, array('type' => 'input', 'field' => 'created_date')); $title = lang('stock_code_setting'); echo block_header($title); echo $this->block->generate_pagination('stock_code'); $config = array('filters' => $filters); echo form_open(); echo $this->block->generate_reset_search($config); echo $this->block->generate_table($head, $data, $filters, 'stock_code'); echo form_close(); echo $this->block->generate_pagination('stock_code');
<?php $url = site_url('sale/ebay_manage/add_saler_ebay_id'); $add_button = $this->block->generate_add_icon($url); $head = array(lang('saler'), lang('ebay_id'), lang('options') . $add_button); $data = array(); $code_url = site_url('sale/ebay_manage/verigy_exchange_saler_ebay_id'); foreach ($ebays as $ebay) { $drop_button = $this->block->generate_drop_icon('sale/ebay_manage/drop_saler_ebay_id_by_id', "{id: {$ebay->id}}", TRUE); $data[] = array($this->block->generate_div("saler_id_{$ebay->id}", isset($ebay) && $ebay->u_name ? $ebay->u_name : '[edit]'), $this->block->generate_div("ebay_id_str_{$ebay->id}", isset($ebay) ? $ebay->ebay_id_str : '[edit]'), $drop_button); $sale_users = $this->user_model->fetch_users_by_system_code('sale'); $salers_options = array(); foreach ($sale_users as $sale_user) { $salers_options[$sale_user->u_id] = $sale_user->u_name; } $collection = to_js_array($salers_options); echo $this->block->generate_editor("saler_id_{$ebay->id}", 'ebay_form', $code_url, "{id: {$ebay->id}, type: 'saler_id'}", $collection); echo $this->block->generate_editor("ebay_id_str_{$ebay->id}", 'ebay_form', $code_url, "{id: {$ebay->id}, type: 'ebay_id_str'}"); } $title = lang('saler_ebay_id_setting'); echo block_header($title); echo form_open(); echo $this->block->generate_table($head, $data); echo form_close();
<?php $url = site_url('stock/inout/add_oustock_type'); $add_button = $this->block->generate_add_icon($url); $head = array(lang('outstock_type'), lang('is_saled_order'), lang('created_date'), lang('creator'), lang('options') . $add_button); $data = array(); $update_outstock_url = site_url('stock/inout/verify_outstock_type'); foreach ($outstock_types as $outstock_type) { $drop_button = $this->block->generate_drop_icon('stock/inout/drop_outstock_type', "{id: {$outstock_type->id}}", TRUE); $data[] = array($this->block->generate_div("type_{$outstock_type->id}", isset($outstock_type) ? $outstock_type->type : '[edit]'), $this->block->generate_div("saled_{$outstock_type->id}", empty($outstock_type->is_saled) ? lang('no') : lang('yes')), $outstock_type->created_date, $outstock_type->creator, $drop_button); echo $this->block->generate_editor("type_{$outstock_type->id}", 'type_form', $update_outstock_url, "{id: {$outstock_type->id}, type: 'type'}"); $collection = array('1' => lang('yes'), '0' => lang('no')); echo $this->block->generate_editor("saled_{$outstock_type->id}", 'type_form', $update_outstock_url, "{id: {$outstock_type->id}, type: 'is_saled'}", to_js_array($collection)); } $title = lang('outstock_type_setting'); echo block_header($title); echo form_open(); echo $this->block->generate_table($head, $data); echo form_close();
<?php $options_status = array('waiting_for_testing' => lang('waiting_for_testing'), 'perfect' => lang('perfect'), 'repairing' => lang('repairing'), 'fixed' => lang('fixed'), 'beyond_repair' => lang('beyond_repair'), 'warehousing' => lang('warehousing')); $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')); $collection_cause = to_js_array($options_cause); $collection_status = to_js_array($options_status); $head = array(array('text' => lang('recommend_number_and_time'), 'sort_key' => 'recommend_no', 'id' => 'recommend'), lang('old_order_address_info'), lang('old_order_list_and_money'), array('text' => lang('receive_product_list'), 'sort_key' => 'sku_str'), array('text' => lang('recommend_cause'), 'sort_key' => 'cause'), array('text' => lang('recommend_remark'), 'sort_key' => 'remark'), array('text' => lang('recommend_status'), 'sort_key' => 'status'), array('text' => lang('creator'), 'sort_key' => 'creator'), array('text' => lang('created_date'), 'sort_key' => 'created_date'), lang('options')); $data = array(); foreach ($recommends as $recommend) { // $order = get_order_info($recommend->order_id); $drop_button = $this->block->generate_drop_icon('qt/recommend/drop_recommend', "{id: {$recommend->rid}}", TRUE); $ebay_url = 'http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item='; $skus = explode(',', $recommend->r_sku_str); $qties = explode(',', $recommend->r_qty_str); $count = count($skus); $item_sku_html = ''; $item_sku_html .= "<div>"; for ($i = 0; $i < $count; $i++) { $item_sku_html .= '<div style="margin-top: 5px;">'; $item_sku_html .= ' SKU: ' . (isset($skus[$i]) ? $skus[$i] . ' * ' . element($i, $qties) . ' (' . get_product_name($skus[$i]) . ')' : '') . '<br/>'; $item_sku_html .= '</div>'; } $item_sku_html .= '</div>'; $product_info = <<<PRODUCT <div style='padding: 10px;'> {$item_sku_html} </div> PRODUCT; $old_order_info = ''; $old_product_info = ''; //if($order)