人人商城

expire.ctrl.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  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('setting');
  8. $dos = array('display', 'save_expire', 'change_status');
  9. $do = in_array($do, $dos) ? $do : 'display';
  10. $user_expire = setting_load('user_expire');
  11. $user_expire = !empty($user_expire['user_expire']) ? $user_expire['user_expire'] : array();
  12. if ($do == 'display') {
  13. $user_expire['day'] = !empty($user_expire['day']) ? $user_expire['day'] : 1;
  14. $user_expire['status'] = !empty($user_expire['status']) ? $user_expire['status'] : 0;
  15. }
  16. if ($do == 'save_expire') {
  17. $user_expire['day'] = !empty($_GPC['day']) ? intval($_GPC['day']) : 1;
  18. $result = setting_save($user_expire, 'user_expire');
  19. if (is_error($result)) {
  20. iajax(-1, '设置失败', url('user/expire'));
  21. }
  22. iajax(0, '设置成功', url('user/expire'));
  23. }
  24. if ($do == 'change_status') {
  25. $user_expire['status'] = empty($user_expire['status']) ? 1 :0;
  26. $result = setting_save($user_expire, 'user_expire');
  27. if (is_error($result)) {
  28. iajax(-1, '设置失败', url('user/expire'));
  29. }
  30. iajax(0, '设置成功', url('user/expire'));
  31. }
  32. template('user/expire');