人人商城

fans.ctrl.php 1.1KB

123456789101112131415161718
  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. $pindex = $_GPC['page'];
  8. $psize = 20;
  9. $condition = '';
  10. if (!empty($_GPC['nickname'])) {
  11. $condition .= " AND nickname LIKE '%".trim($_GPC['nickname'])."%'" ;
  12. }
  13. $check_fans = json_decode($_COOKIE['fans_openids'.$_W['uniacid']]);
  14. $check_fans = empty($check_fans) ? array() : $check_fans;
  15. $fans = pdo_fetchall("SELECT * FROM ". tablename('mc_mapping_fans')." WHERE uniacid = :uniacid AND acid = :acid AND nickname <> '' ". $condition." LIMIT ". ($pindex-1)*$psize.",".$psize, array(':uniacid' => $_W['uniacid'], ':acid' => $_W['acid']));
  16. $total = pdo_fetchcolumn("SELECT COUNT(*) FROM ". tablename('mc_mapping_fans')." WHERE uniacid = :uniacid AND acid = :acid AND nickname <> '' ". $condition, array(':uniacid' => $_W['uniacid'], ':acid' => $_W['acid']));
  17. $pager = pagination($total, $pindex, $psize, '', array('before' => '3', 'after' => '2', 'ajaxcallback' => 'true'));
  18. template('utility/fans');