sjpinglun.inc.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  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. $sql="select a.* ,b.store_name from " . tablename("zhtc_comments") . " a" . " left join " . tablename("zhtc_store") . " b on a.store_id=b.id ".$where." order by time DESC";
  14. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_comments") . " a" . " left join " . tablename("zhtc_store") . " b on a.store_id=b.id".$where,$data);
  15. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  16. $list=pdo_fetchall($select_sql,$data);
  17. $pager = pagination($total, $pageindex, $pagesize);
  18. if($operation=='delete'){
  19. $res=pdo_delete('zhtc_comments',array('id'=>$_GPC['id']));
  20. if($res){
  21. message('删除成功',$this->createWebUrl('sjpinglun',array()),'success');
  22. }else{
  23. message('删除失败','','error');
  24. }
  25. }
  26. if ($_GPC['op'] == 'tg') {
  27. $res = pdo_update('zhtc_comments',array('state'=>2), array('id' => $_GPC['id']));
  28. if ($res) {
  29. message('通过成功!', $this->createWebUrl('sjpinglun', array('page' => $_GPC['page'])), 'success');
  30. } else {
  31. message('通过失败!', '', 'error');
  32. }
  33. }
  34. if ($_GPC['op'] == 'jj') {
  35. $res = pdo_update('zhtc_comments',array('state'=>3), array('id' => $_GPC['id']));
  36. if ($res) {
  37. message('拒绝成功!', $this->createWebUrl('sjpinglun', array('page' => $_GPC['page'])), 'success');
  38. } else {
  39. message('拒绝失败!', '', 'error');
  40. }
  41. }
  42. include $this->template('web/sjpinglun');