人人商城

user.ctrl.php 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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('user');
  8. $dos = array('browser');
  9. $do = in_array($do, $dos) ? $do: 'browser';
  10. if ($do == 'browser') {
  11. $mode = empty($_GPC['mode']) ? 'visible' : $_GPC['mode'];
  12. $mode = in_array($mode, array('invisible','visible')) ? $mode : 'visible';
  13. $callback = $_GPC['callback'];
  14. $uids = $_GPC['uids'];
  15. $uidArr = array();
  16. if(empty($uids)){
  17. $uids='';
  18. }else{
  19. foreach (explode(',', $uids) as $uid) {
  20. $uidArr[] = intval($uid);
  21. }
  22. $uids = implode(',', $uidArr);
  23. }
  24. $where = " WHERE status = '2' and type != '".ACCOUNT_OPERATE_CLERK."' AND founder_groupid != " . ACCOUNT_MANAGE_GROUP_VICE_FOUNDER;
  25. if($mode == 'invisible' && !empty($uids)){
  26. $where .= " AND uid not in ( {$uids} )";
  27. }
  28. $params = array();
  29. if(!empty($_GPC['keyword'])) {
  30. $where .= ' AND `username` LIKE :username';
  31. $params[':username'] = "%{$_GPC['keyword']}%";
  32. }
  33. if (user_is_vice_founder()) {
  34. $where .= ' AND `owner_uid` = :owner_uid';
  35. $params[':owner_uid'] = $_W['uid'];
  36. }
  37. $pindex = max(1, intval($_GPC['page']));
  38. $psize = 10;
  39. $total = 0;
  40. $list = pdo_fetchall("SELECT uid, groupid, username, remark FROM ".tablename('users')." {$where} ORDER BY `uid` LIMIT ".(($pindex - 1) * $psize).",{$psize}", $params);
  41. $total = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename('users'). $where , $params);
  42. $pager = pagination($total, $pindex, $psize, '', array('ajaxcallback'=>'null','mode'=>$mode,'uids'=>$uids));
  43. $usergroups = user_group();
  44. template('utility/user-browser');
  45. exit;
  46. }