Пример #1
0
 public static function get_order_address()
 {
     global $db;
     if (MES_User::server_check_login()) {
         $sql = "select * from ecs_user_address where user_id={$_SESSION['user_id']}";
         $address = $db->getAll($sql);
         for ($i = 0; $i < count($address); $i++) {
             $region_id = $address[$i]['city'];
             $district_id = $address[$i]['district'];
             $city_name = $db->getOne("select region_name from ship_region where region_id={$address[$i]['city']}");
             $address[$i]['cityName'] = $city_name;
             $address[$i]['districtName'] = MES_Order::_get_distruct_name($region_id, $district_id);
         }
     } else {
         $address = array();
     }
     return json_encode($address);
 }
Пример #2
0
                                         $mobile = ANTI_SPAM($_POST['mobile']);
                                         echo MES_User::get_forget_password_code($mobile);
                                     } else {
                                         if ($action == 'get_users_info') {
                                             //get name,tel and sex
                                             echo MES_User::get_users_info();
                                         } else {
                                             if ($action == 'change_sex') {
                                                 //change your sex
                                                 $sex = ANTI_SPAM($_POST['sex']);
                                                 echo MES_User::change_sex($sex);
                                             } else {
                                                 if ($action == 'change_real_name') {
                                                     //change your real name
                                                     $name = ANTI_SPAM($_POST['name']);
                                                     echo MES_User::change_real_name($name);
                                                 } else {
                                                     header("Location: 404.html");
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Пример #3
0
 public static function get_forget_password_code($mobile)
 {
     global $db;
     $mobile_phone = $db->getOne("select mobile_phone from" . $GLOBALS['ecs']->table("users") . "where mobile_phone='{$mobile}'");
     if ($mobile_phone) {
         $rand_password = MES_User::rand_num();
         $c = "尊敬的用户,您在每实官网手机校验码为" . $rand_password . "。如有问题请与每实客服中心联系,电话4000 600 700。";
         $content = urlencode($c);
         $url = 'http://sdk.kuai-xin.com:8888/sms.aspx?action=send&userid=4333&account=s120018&password=wangjianming123&mobile=' . $mobile . '&content=' . $content . '&sendTime=';
         file_get_contents($url);
         $_SESSION['forget_mobile'] = $mobile;
         $_SESSION['forget_mobile_code'] = $rand_password;
         return json_encode(array('code' => RES_SUCCSEE));
     } else {
         return json_encode(array('code' => RES_FAIL));
     }
 }