人人商城

sms-sign.ctrl.php 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. load()->model('cloud');
  8. load()->model('setting');
  9. $dos = array('display', 'save_sms_sign', 'change_status');
  10. $do = in_array($do, $dos) ? $do : 'display';
  11. $setting_sms_sign = setting_load('site_sms_sign');
  12. $setting_sms_sign = !empty($setting_sms_sign['site_sms_sign']) ? $setting_sms_sign['site_sms_sign'] : '';
  13. if ($do == 'display') {
  14. $cloud_sms_info = cloud_sms_info();
  15. $cloud_sms_signs = $cloud_sms_info['sms_sign'];
  16. $setting_sms_sign['sign'] = !empty($setting_sms_sign['sign']) ? $setting_sms_sign['sign'] : 0;
  17. $setting_sms_sign['day'] = !empty($setting_sms_sign['day']) ? $setting_sms_sign['day'] : 1;
  18. $setting_sms_sign['status'] = !empty($setting_sms_sign['status']) ? $setting_sms_sign['status'] : 0;
  19. }
  20. if ($do == 'save_sms_sign') {
  21. $setting_sms_sign['sign'] = trim($_GPC['sign']);
  22. $setting_sms_sign['day'] = !empty($_GPC['day']) ? intval($_GPC['day']) : 1;
  23. $result = setting_save($setting_sms_sign, 'site_sms_sign');
  24. if (is_error($result)) {
  25. iajax(-1, '设置失败', url('user/sms-sign'));
  26. }
  27. iajax(0, '设置成功', url('user/sms-sign'));
  28. }
  29. if ($do == 'change_status') {
  30. $setting_sms_sign['status'] = empty($setting_sms_sign['status']) ? 1 :0;
  31. $result = setting_save($setting_sms_sign, 'site_sms_sign');
  32. if (is_error($result)) {
  33. iajax(-1, '设置失败', url('user/sms-sign'));
  34. }
  35. iajax(0, '设置成功', url('user/sms-sign'));
  36. }
  37. template('user/sms-sign');