inzxpinglun.inc.php 2.1 KB

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