error.inc.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. //门店列表
  3. global $_GPC, $_W;
  4. $action = 'field';
  5. $title = $this->actions_titles[$action];
  6. $GLOBALS['frames'] = $this->getMainMenu();
  7. $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'fieldset_display';
  8. $type=isset($_GPC['type'])?$_GPC['type']:'all';
  9. $pageindex = max(1, intval($_GPC['page']));
  10. $pagesize=10;
  11. $where=" where uniacid=:uniacid";
  12. if(!empty($_GPC['keywords'])){
  13. $where.=" and details LIKE concat('%', :name,'%') ";
  14. $data[':name']=$_GPC['keywords'];
  15. }
  16. if($type!="all"){
  17. $where.=" and state={$_GPC['status']}";
  18. }
  19. $sql="SELECT * FROM ".tablename('zhtc_yellowerror') .$where." ORDER BY time DESC";
  20. $data[':uniacid']=$_W['uniacid'];
  21. $total=pdo_fetchcolumn("SELECT count(*) FROM ".tablename('zhtc_yellowerror') .$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=='delete'){
  26. $id=$_GPC['id'];
  27. $result = pdo_delete('zhtc_yellowerror', array('id'=>$id));
  28. if($result){
  29. message('删除成功',$this->createWebUrl('error',array()),'success');
  30. }else{
  31. message('删除失败','','error');
  32. }
  33. }
  34. if($operation=='reply'){
  35. $id=$_GPC['id'];
  36. $result = pdo_update('zhtc_yellowerror',array('state'=>2), array('id'=>$id));
  37. if($result){
  38. message('回复成功',$this->createWebUrl('error',array()),'success');
  39. }else{
  40. message('回复失败','','error');
  41. }
  42. }
  43. include $this->template('web/error');