dlincarinfo.inc.php 2.4 KB

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