public function update_competitor()
 {
     $id = $this->input->post('id');
     $type = $this->input->post('type');
     $value = trim($this->input->post('value'), ',');
     $value = no_space($value);
     $currency_code = $this->ebay_model->fetch_competitor_by_id($id);
     if ($type == 'seller_id' && $value !== $currency_code->seller_id && $this->ebay_model->check_exists('myebay_list_competitor', array('seller_id' => $value, 'item_id' => $currency_code->item_id, 'url' => $currency_code->url))) {
         echo $this->create_json(0, lang('competitor_exists'));
         return;
     }
     if ($type == 'allowed_difference' && !is_numeric($value)) {
         echo $this->create_json(0, lang('your_input_is_not_range_numeric'));
         return;
     }
     if ($type == 'url' && $value !== $currency_code->url && $this->ebay_model->check_exists('myebay_list_competitor', array('url' => $value, 'item_id' => $currency_code->item_id, 'seller_id' => $currency_code->seller_id))) {
         echo $this->create_json(0, lang('competitor_exists'));
         return;
     }
     try {
         $this->ebay_model->update_competitor($id, $type, $value);
         echo $this->create_json(1, lang('ok'), $value);
     } catch (Exception $e) {
         $this->ajax_failed();
         echo lang('error_msg');
     }
 }
Exemple #2
0
 public function update_ebay_info()
 {
     $value = trim($this->input->post('value'), ',');
     $value = no_space($value);
     $type = $this->input->post('type');
     $user_id = $this->input->post('user_id');
     if (!$value || !$user_id) {
         return;
     }
     try {
         switch ($type) {
             case 'paypal_email':
                 $this->load->helper('email');
                 $emails = explode(',', $value);
                 foreach ($emails as $email) {
                     if (!valid_email($email) && $value != '[edit]') {
                         //echo $this->create_json(0, sprintf(lang('not_valid_email'), $email), $value);
                         //return ;
                     }
                 }
                 $data = array('paypal_email_str' => $value);
                 $this->user_model->save_user_ebay_info($user_id, $data);
                 break;
             case 'ebay_id':
                 $data = array('ebay_id_str' => $value);
                 $this->user_model->save_user_ebay_info($user_id, $data);
                 break;
         }
     } catch (Exception $exc) {
         echo lang('error_msg');
         $this->ajax_failed();
     }
     echo $this->create_json(1, lang('ok'), $value);
 }
 public function verigy_exchange_profit_rate_view()
 {
     $id = $this->input->post('id');
     $type = $this->input->post('type');
     $value = trim($this->input->post('value'), ',');
     $value = no_space($value);
     try {
         $this->order_model->update_exchange_profit_rate_view($id, $type, $value);
         echo $this->create_json(1, lang('ok'), $value);
     } catch (Exception $e) {
         $this->ajax_failed();
         echo lang('error_msg');
     }
 }
 public function proccess_update_account()
 {
     $rules = array(array('field' => 'myname', 'label' => lang('myname'), 'rules' => 'trim|required|min_length[2]|max_length[20]'));
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run() == FALSE) {
         $error = validation_errors();
         echo $this->create_json(0, $error);
         return;
     }
     $name = trim($this->input->post('myname'));
     $name_en = trim($this->input->post('name_en'));
     $phone = trim($this->input->post('phone'));
     $msn = trim($this->input->post('msn'));
     $skype = trim($this->input->post('skype'));
     $skype_pwd = trim($this->input->post('skype_pwd'));
     $msn_pwd = trim($this->input->post('msn_pwd'));
     $QQ = trim($this->input->post('QQ'));
     $QQ_pwd = trim($this->input->post('QQ_pwd'));
     $birthday = trim($this->input->post('birthday'));
     $contrct_time = trim($this->input->post('contrct_time'));
     $taobao_username = trim($this->input->post('taobao_username'));
     $taobao_pwd = trim($this->input->post('taobao_pwd'));
     $fileserv_username = trim($this->input->post('fileserv_username'));
     $fileserv_pwd = trim($this->input->post('fileserv_pwd'));
     $RTX = trim($this->input->post('RTX'));
     $RTX_pwd = trim($this->input->post('RTX_pwd'));
     $platform1 = trim($this->input->post('platform1'));
     $platform2 = trim($this->input->post('platform2'));
     $email = $this->input->post('email');
     $email_pwd = $this->input->post('email_pwd');
     $trial_end_time = $this->input->post('trial_end_time');
     $data = array('name' => $name, 'name_en' => $name_en, 'phone' => $phone, 'msn' => $msn, 'skype' => $skype, 'platform1' => $platform1, 'platform2' => $platform2, 'email' => no_space($email), 'email_pwd' => $email_pwd, 'skype_pwd' => $skype_pwd, 'msn_pwd' => $msn_pwd, 'QQ' => $QQ, 'QQ_pwd' => $QQ_pwd, 'birthday' => $birthday, 'contrct_time' => $contrct_time, 'taobao_username' => $taobao_username, 'taobao_pwd' => $taobao_pwd, 'fileserv_username' => $fileserv_username, 'fileserv_pwd' => $fileserv_pwd, 'RTX' => $RTX, 'RTX_pwd' => $RTX_pwd, 'trial_end_time' => $trial_end_time);
     $user_id = get_current_user_id();
     try {
         $this->user_model->update_user($user_id, $data);
     } catch (Exception $exc) {
         echo lang('error_msg');
         $this->ajax_failed();
     }
     echo $this->create_json(1, lang('ok'));
 }
 public function verigy_exchange_power_management()
 {
     $id = $this->input->post('id');
     $type = $this->input->post('type');
     $value = trim($this->input->post('value'), ',');
     $value = no_space($value);
     $currency_code = $this->order_model->fetch_power_management_by_id($id);
     if ($type == 'superintendent_id' && $this->order_model->check_exists('order_power_management_map', array('superintendent_id' => $value)) && $value != $currency_code->superintendent_id) {
         echo $this->create_json(0, lang('superintendent_id_exists'));
         return;
     }
     try {
         $this->order_model->update_exchange_power_management($id, $type, $value);
         if ($type == 'superintendent_id') {
             $value = fetch_user_name_by_id($value);
         }
         echo $this->create_json(1, lang('ok'), $value);
     } catch (Exception $e) {
         $this->ajax_failed();
         echo lang('error_msg');
     }
 }
 function css($pr = null, $v = null)
 {
     $b = func_get_args();
     if (!$this->more()) {
         if (!func_num_args()) {
             return $this->attr('style');
         } else {
             foreach ($b as $k) {
                 if (isDrw($k)) {
                     foreach ($k as $i => $v1) {
                         if (isNum($i)) {
                             $this->css($v1);
                         } else {
                             $this->css($i, $v1);
                         }
                     }
                 }
             }
         }
         if (isStr($pr) && (isStr($v) || isNum($v))) {
             $pr = strtolower($pr);
             no_space($pr);
             $this->attr('style', preg_replace('/([^;]+)?' . $pr . '.*?[^;]+[;|\\w,-]/', '', $this->css()));
             preg_match('/.{1,};?[\\s|;]+/', $cs = $this->css(), $n);
             if ($v != REMOVE_CSS_ANCHOR) {
                 $this->attr('style', $cs . (!count($n) || $n[0] != $cs ? ';' : '') . $pr . ':' . strtolower($v) . ';');
             }
         }
         if (func_num_args() == 1 && isStr($pr)) {
             preg_match('/([^;]+)?' . $pr . '.*?[^;]+[;|\\w,-]/', $this->css(), $m);
             if (count(explode(':', $pr)) >= 2 || count(explode(';', $pr)) >= 2) {
                 foreach (explode(';', $pr) as $v1) {
                     if (count($a = explode(':', $v1)) == 2) {
                         $this->css($a[0], $a[1]);
                     } else {
                         $this->css($a[0]);
                     }
                 }
             } else {
                 if (substr($pr, 0, 1) == '~') {
                     $this->css(str_replace('~', '', $pr), REMOVE_CSS_ANCHOR);
                 } else {
                     if (count($m)) {
                         return count($s = explode(':', $m[0])) >= 2 ? str_replace(';', '', $s[1]) : null;
                     }
                 }
             }
         }
     } else {
         foreach ($this->O as $o) {
             $s = _($o)->css($b);
             $h = array();
             if (!func_num_args() || !preg_match('/[(:|;)]/', $pr)) {
                 array_push($h, $s);
             }
             if (count($h)) {
                 return $h;
             }
         }
     }
     return $this;
 }