dlinzxcheckmanager.inc.php 2.8 KB

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