intzpinglun.inc.php 1.3 KB

123456789101112131415161718192021222324252627282930
  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 b.uniacid=:uniacid ";
  8. if(!empty($_GPC['keywords'])){
  9. $where.=" and a.details LIKE concat('%', :name,'%') ";
  10. $data[':name']=$_GPC['keywords'];
  11. }
  12. $data[':uniacid']=$_W['uniacid'];
  13. //$data[':cityname']=$_COOKIE["cityname"];
  14. $sql="select a.* ,b.details as tzinfo,c.name from " . tablename("zhtc_comments") . " a" . " left join " . tablename("zhtc_information") . " b on a.information_id=b.id left join " . tablename("zhtc_user") . " c on a.user_id=c.id ".$where." order by time DESC";
  15. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_comments") . " a" . " left join " . tablename("zhtc_information") . " b on a.information_id=b.id".$where,$data);
  16. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  17. $list=pdo_fetchall($select_sql,$data);
  18. $pager = pagination($total, $pageindex, $pagesize);
  19. if($operation=='delete'){
  20. $res=pdo_delete('zhtc_comments',array('id'=>$_GPC['id']));
  21. if($res){
  22. message('删除成功',$this->createWebUrl('intzpinglun',array()),'success');
  23. }else{
  24. message('删除失败','','error');
  25. }
  26. }
  27. include $this->template('web/intzpinglun');