dlinzxpinglun.inc.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. global $_GPC, $_W;
  3. $action = 'start';
  4. $GLOBALS['frames'] = $this->getNaveMenu($_COOKIE['cityname'], $action);
  5. $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'fieldset_display';
  6. $pageindex = max(1, intval($_GPC['page']));
  7. $pagesize=10;
  8. $where=" WHERE a.uniacid=:uniacid and b.cityname=:cityname";
  9. if(!empty($_GPC['keywords'])){
  10. $where.=" and a.content LIKE concat('%', :name,'%') ";
  11. $data[':name']=$_GPC['keywords'];
  12. }
  13. $type=isset($_GPC['type'])?$_GPC['type']:'wait';
  14. $status=isset($_GPC['status'])?$_GPC['status']:'1';
  15. if($type=='wait'||$type=='ok'){
  16. $where.=" and a.status=:state";
  17. $data[':state']=$status;
  18. }
  19. $data[':uniacid']=$_W['uniacid'];
  20. $data[':cityname']=$_COOKIE["cityname"];
  21. $sql="select a.* ,b.title from " . tablename("zhtc_zx_assess") . " a" . " inner join " . tablename("zhtc_zx") . " b on a.zx_id=b.id ".$where;
  22. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_zx_assess") . " a" . " inner join " . tablename("zhtc_zx") . " b on a.zx_id=b.id".$where,$data);
  23. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  24. $list=pdo_fetchall($select_sql,$data);
  25. $pager = pagination($total, $pageindex, $pagesize);
  26. if($operation=='info'){
  27. $sql="select a.* ,b.name from " . tablename("zhtc_zx_assess") ." a" . " left join " . tablename("zhjd_user") . " b on b.id=a.user_id where a.uniacid=:uniacid and a.id=:id";
  28. $list=pdo_fetch($sql, array(':uniacid'=>$_W['uniacid'],':id'=>$_GPC['id']));
  29. include $this->template('web/pingluninfo');
  30. }
  31. if(checksubmit('submit2')){
  32. //保存回复
  33. $result = pdo_update('zhtc_zx_assess', array('reply' => $_GPC['reply'],'status'=>2,'reply_time'=>date("Y-m-d H:i:s")), array('id' => $_GPC['id']));
  34. if($result){
  35. message('回复成功',$this->createWebUrl2('dlinzxpinglun',array()),'success');
  36. }else{
  37. message('回复失败','','error');
  38. }
  39. }
  40. if($operation=='delete'){
  41. $res=pdo_delete('zhtc_zx_assess',array('id'=>$_GPC['id']));
  42. if($res){
  43. message('删除成功',$this->createWebUrl2('dlinzxpinglun',array()),'success');
  44. }else{
  45. message('删除失败','','error');
  46. }
  47. }
  48. include $this->template('web/dlinzxpinglun');