zxpinglun.inc.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. $data[':uniacid'] = $_W['uniacid'];
  9. if (!empty($_GPC['keywords'])) {
  10. $where .= " and a.content LIKE concat('%', :name,'%') ";
  11. $data[':name'] = $_GPC['keywords'];
  12. }
  13. $sql = "select a.* ,b.title from " . tablename("zhtc_zx_assess") . " a" . " inner join " . tablename("zhtc_zx") . " b on a.zx_id=b.id " . $where . " order by a.id DESC";
  14. $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);
  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 == 'info') {
  19. $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";
  20. $list = pdo_fetch($sql, array(':uniacid' => $_W['uniacid'], ':id' => $_GPC['id']));
  21. include $this->template('web/pingluninfo');
  22. }
  23. if (checksubmit('submit2')) {
  24. //保存回复
  25. $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']));
  26. if ($result) {
  27. message('回复成功', $this->createWebUrl('zxpinglun', array()), 'success');
  28. } else {
  29. message('回复失败', '', 'error');
  30. }
  31. }
  32. if ($operation == 'delete') {
  33. $res = pdo_delete('zhtc_zx_assess', array('id' => $_GPC['id']));
  34. if ($res) {
  35. message('删除成功', $this->createWebUrl('zxpinglun', array()), 'success');
  36. } else {
  37. message('删除失败', '', 'error');
  38. }
  39. }
  40. if ($operation == 'examine') {
  41. $res = pdo_update('zhtc_zx_assess', array('state' => $_GPC['state']), array('id' => $_GPC['id']));
  42. if ($res) {
  43. message('审核成功', $this->createWebUrl('zxpinglun', array()), 'success');
  44. } else {
  45. message('审核失败', '', 'error');
  46. }
  47. }
  48. include $this->template('web/zxpinglun');