Esempio n. 1
0
 public function fetch_wait_for_confirmation_orders_count($user = NULL, $type = 'wait_for_confirmation')
 {
     $statuses = fetch_statuses_r('order_status');
     if (!$this->CI->is_super_user()) {
         $user_id = get_current_user_id();
         $ebay_info = $this->CI->user_model->fetch_user_ebay_info($user_id);
         if (empty($ebay_info->paypal_email_str)) {
             $paypal_emails = array();
         } else {
             $paypal_emails = explode(',', $ebay_info->paypal_email_str);
         }
     }
     $this->db->from('order_list');
     if ($user) {
         $this->db->where(array('check_user' => $user));
     }
     if (!$this->CI->is_super_user() && $type === 'wait_for_confirmation') {
         if (count($paypal_emails)) {
             $this->db->where_in('(order_list.to_email', $paypal_emails);
             $this->db->or_where('order_list.input_user = "******")');
         } else {
             $this->db->where(array('order_list.input_user' => get_current_login_name()));
         }
     }
     $this->set_where('order');
     if (!$this->has_set_where) {
         $this->db->where_in('order_status', array($statuses[$type]));
     }
     $this->db->distinct();
     return $this->db->count_all_results();
 }
Esempio n. 2
0
else if ($order_status == 2)
{
    $sort_key = 'wait_confirmation_delay_times';
}*/
$base_url = base_url();
$head = array(array('text' => lang('created_date'), 'sort_key' => $sort_key, 'id' => 'order'), array('text' => lang('item_information'), 'sort_key' => 'item_no'), array('text' => lang('product_information'), 'sort_key' => 'item_title_str'), array('text' => lang('gathering_transaction_remark'), 'sort_key' => 'transaction_id'), array('text' => lang('shipping_info'), 'sort_key' => 'ship_confirm_date'), array('text' => lang('shipping_way'), 'sort_key' => 'is_register'), array('text' => lang('platform'), 'sort_key' => 'auction_site_type'), array('text' => lang('gross'), 'sort_key' => 'gross'), array('text' => lang('ebay_shippingamt') . '/' . lang('customer_remark'), 'sort_key' => 'shippingamt'));
if ($see_profit_rate) {
    $head[] = array('text' => lang('total_profit_rate'), 'sort_key' => 'profit_rate');
}
$head[] = array('text' => lang('order_status'), 'sort_key' => 'order_status');
$head[] = array('text' => lang('import_date'), 'sort_key' => 'input_date');
$head[] = lang('options');
$data = array();
$ebay_url = 'http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=';
$statuses = fetch_statuses('order_status');
$statuses_r = fetch_statuses_r('order_status');
$products_save = array();
$purchasers = array();
$total_return_cost = 0;
foreach ($orders as $order) {
    $row = array();
    $gross = empty($order->gross) ? $order->net : $order->gross;
    $rmb = price($this->order_model->calc_currency($order->currency, $gross));
    $lang_name = lang('name_en');
    $lang_address = lang('address_en');
    $lang_town_city = lang('town_city_en');
    $lang_state_province = lang('state_province_en');
    $lang_countries = lang('country_en');
    $lang_zip_code = lang('postal_code_en');
    $name = $order->name . (empty($order->buyer_id) ? '' : "({$order->buyer_id})");
    $phone = '';