inzxcheckmanager.inc.php 2.7 KB

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