人人商城

fields.ctrl.php 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. uni_user_permission_check('profile_setting');
  8. $dos = array('display', 'post');
  9. $do = in_array($do, $dos) ? $do : 'display';
  10. if($do == 'display') {
  11. $_W['page']['title'] = '字段管理 - 公众号 - 参数设置';
  12. if (checksubmit('submit')) {
  13. if (!empty($_GPC['displayorder'])) {
  14. $field = array('uniacid' => $_W['uniacid']);
  15. foreach ($_GPC['displayorder'] as $id => $displayorder) {
  16. $field['id'] = intval($_GPC['id'][$id]);
  17. $field['fieldid'] = intval($_GPC['fieldid'][$id]);
  18. $field['displayorder'] = intval($displayorder);
  19. $field['available'] = intval($_GPC['available'][$id]);
  20. if (empty($field['id'])) {
  21. $field['title'] = $_GPC['title'][$id];
  22. pdo_insert('mc_member_fields', $field);
  23. } else {
  24. pdo_update('mc_member_fields', $field, array('id' => $field['id']));
  25. }
  26. }
  27. }
  28. message('会员字段更新成功!', referer(), 'success');
  29. }
  30. $account_member_fields = uni_account_member_fields($_W['uniacid']);
  31. }
  32. if ($do == 'post') {
  33. $_W['page']['title'] = '字段编辑 - 公众号 - 参数设置';
  34. $id = intval($_GPC['id']);
  35. if (checksubmit('submit')) {
  36. if (empty($_GPC['title'])) {
  37. message('抱歉,请填写资料名称!');
  38. }
  39. $field = array(
  40. 'title' => $_GPC['title'],
  41. 'displayorder' => intval($_GPC['displayorder']),
  42. 'available' => intval($_GPC['available'])
  43. );
  44. pdo_update('mc_member_fields', $field, array('id' => $id));
  45. message('会员字段更新成功!', url('profile/fields'), 'success');
  46. }
  47. $field = pdo_get('mc_member_fields', array('id' => $id));
  48. }
  49. template('profile/fields');