tzpinglun.inc.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.details as tzinfo from " . tablename("zhtc_comments") . " a" . " left join " . tablename("zhtc_information") . " b on a.information_id=b.id ".$where." order by time DESC";
  14. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_comments") . " a" . " left join " . tablename("zhtc_information") . " b on a.information_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('tzpinglun',array()),'success');
  22. }else{
  23. message('删除失败','','error');
  24. }
  25. }
  26. if ($_GPC['op'] == 'tg') {
  27. $tz=pdo_get('zhtc_comments',array('id'=>$_GPC['id']));
  28. $res = pdo_update('zhtc_comments',array('state'=>2), array('id' => $_GPC['id']));
  29. if ($res) {
  30. if($tz['bid'] || $tz['hf_id']){
  31. file_get_contents("" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&c=entry&a=wxapp&do=hpMessage2&m=zh_tcwq&id=" . $tz['id']);//模板消息
  32. }
  33. file_get_contents("" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&c=entry&a=wxapp&do=TzhfMessage&m=zh_tcwq&pl_id=" . $tz['id']);//模板消息
  34. $this->increaseScore($tz['user_id']);
  35. message('通过成功!', $this->createWebUrl('tzpinglun', array('page' => $_GPC['page'])), 'success');
  36. } else {
  37. message('通过失败!', '', 'error');
  38. }
  39. }
  40. if ($_GPC['op'] == 'jj') {
  41. $res = pdo_update('zhtc_comments',array('state'=>3), array('id' => $_GPC['id']));
  42. if ($res) {
  43. message('拒绝成功!', $this->createWebUrl('tzpinglun', array('page' => $_GPC['page'])), 'success');
  44. } else {
  45. message('拒绝失败!', '', 'error');
  46. }
  47. }
  48. include $this->template('web/tzpinglun');