zxcheckmanager.inc.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $where="WHERE a.uniacid=:uniacid and a.user_id !=''";
  5. if($_GPC['keywords']){
  6. $op=$_GPC['keywords'];
  7. $where.=" and a.content LIKE concat('%', :name,'%') ";
  8. $data[':name']=$op;
  9. }
  10. $state=$_GPC['state'];
  11. $pageindex = max(1, intval($_GPC['page']));
  12. $pagesize=10;
  13. $type=isset($_GPC['type'])?$_GPC['type']:'all';
  14. $data[':uniacid']=$_W['uniacid'];
  15. if($type=='all'){
  16. $sql="select a.*,b.type_name,c.name as wname from " . tablename("zhtc_zx") . " a" . " left join " . tablename("zhtc_zx_type") . " b on a.type_id=b.id" . " left join " . tablename("zhtc_user") . " c on a.user_id=c.id ".$where." order by a.time desc ";
  17. $total=pdo_fetchcolumn("select count(*) as wname from " . tablename("zhtc_zx") . " a" . " left join " . tablename("zhtc_zx_type") . " b on a.type_id=b.id" . " left join " . tablename("zhtc_user") . " c on a.user_id=c.id ".$where." order by a.time desc ",$data);
  18. }else{
  19. $where.= " and a.state=$state";
  20. $sql="select a.*,b.type_name,c.name as wname from " . tablename("zhtc_zx") . " a" . " left join " . tablename("zhtc_zx_type") . " b on a.type_id=b.id" . " left join " . tablename("zhtc_user") . " c on a.user_id=c.id ".$where." order by a.time desc ";
  21. $total=pdo_fetchcolumn("select count(*) as wname from " . tablename("zhtc_zx") . " a" . " left join " . tablename("zhtc_zx_type") . " b on a.type_id=b.id" . " left join " . tablename("zhtc_user") . " c on a.user_id=c.id ".$where." order by a.time desc",$data);
  22. }
  23. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  24. $list=pdo_fetchall($select_sql,$data);
  25. $pager = pagination($total, $pageindex, $pagesize);
  26. if($_GPC['op']=='delete'){
  27. $res=pdo_delete('zhtc_zx',array('id'=>$_GPC['id']));
  28. if($res){
  29. message('删除成功!', $this->createWebUrl('zxcheckmanager'), 'success');
  30. }else{
  31. message('删除失败!','','error');
  32. }
  33. }
  34. if($_GPC['op']=='tg'){
  35. $res=pdo_update('zhtc_zx',array('state'=>2,'sh_time'=>date('Y-m-d H:i:s')),array('id'=>$_GPC['id']));
  36. if($res){
  37. message('通过成功!', $this->createWebUrl('zxcheckmanager'), 'success');
  38. }else{
  39. message('通过失败!','','error');
  40. }
  41. }
  42. if($_GPC['op']=='jj'){
  43. $res=pdo_update('zhtc_zx',array('state'=>3,'sh_time'=>date('Y-m-d H:i:s')),array('id'=>$_GPC['id']));
  44. if($res){
  45. message('拒绝成功!', $this->createWebUrl('zxcheckmanager'), 'success');
  46. }else{
  47. message('拒绝失败!','','error');
  48. }
  49. }
  50. include $this->template('web/zxcheckmanager');