incarinfo.inc.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu2();
  4. $type=isset($_GPC['type'])?$_GPC['type']:'wait';
  5. $where="WHERE uniacid=:uniacid and cityname=:cityname";
  6. if(isset($_GPC['keywords'])){
  7. $op=$_GPC['keywords'];
  8. $where.=" and (start_place LIKE concat('%', :name,'%') or end_place LIKE concat('%', :name,'%'))";
  9. $data[':name']=$op;
  10. $type='all';
  11. }
  12. if(!empty($_GPC['time'])){
  13. $start=strtotime($_GPC['time']['start']);
  14. $end=strtotime($_GPC['time']['end']);
  15. $where.=" and time >={$start} and time<={$end}";
  16. }
  17. $state=isset($_GPC['state'])?$_GPC['state']:1;
  18. $pageindex = max(1, intval($_GPC['page']));
  19. $pagesize=10;
  20. $data[':uniacid']=$_W['uniacid'];
  21. $data[':cityname']=$_COOKIE["cityname"];
  22. if($type=='all'){
  23. $sql="select * from" . tablename("zhtc_car") .$where." order by top,time desc ";
  24. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_car") .$where,$data);
  25. }else{
  26. $where.= " and state=$state";
  27. $sql="select * from" . tablename("zhtc_car") .$where." order by top,time desc ";
  28. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_car") .$where,$data);
  29. }
  30. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  31. $list=pdo_fetchall($select_sql,$data);
  32. $pager = pagination($total, $pageindex, $pagesize);
  33. if($_GPC['op']=='delete'){
  34. $res=pdo_delete('zhtc_car',array('id'=>$_GPC['id']));
  35. if($res){
  36. message('删除成功!', $this->createWebUrl('incarinfo'), 'success');
  37. }else{
  38. message('删除失败!','','error');
  39. }
  40. }
  41. if($_GPC['op']=='tg'){
  42. $res=pdo_update('zhtc_car',array('state'=>2,'sh_time'=>time()),array('id'=>$_GPC['id']));
  43. if($res){
  44. message('通过成功!', $this->createWebUrl('incarinfo'), 'success');
  45. }else{
  46. message('通过失败!','','error');
  47. }
  48. }
  49. if($_GPC['op']=='jj'){
  50. $res=pdo_update('zhtc_car',array('state'=>3,'sh_time'=>time()),array('id'=>$_GPC['id']));
  51. if($res){
  52. message('拒绝成功!', $this->createWebUrl('incarinfo'), 'success');
  53. }else{
  54. message('拒绝失败!','','error');
  55. }
  56. }
  57. include $this->template('web/incarinfo');