Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. $list = array();
  2. $result = CarsGps::GetPositionReport();
  3.  
  4. while (($line = mysql_fetch_array($result, MYSQL_ASSOC)) !== false)
  5. {
  6. if ($line['def_city'] == 'Москва')
  7. {
  8. if (strpos($line['city'],'Московская') === false and strpos($line['city'],'Москва') === false)
  9. {
  10. if (in_array('NOT_HOME', $_POST['filter']))
  11. {
  12. $list[] = $line;
  13. }
  14. }
  15. else
  16. {
  17. if (in_array('HOME', $_POST['filter']))
  18. {
  19. $list[] = $line;
  20. }
  21. }
  22. }
  23. else
  24. {
  25. if ($line['def_city'] == 'Санкт-Петербург')
  26. {
  27. if (strpos($line['city'],'Ленинградская') === false and strpos($line['city'],'Санкт-Петербург') === false)
  28. {
  29. if (in_array('NOT_HOME', $_POST['filter']))
  30. {
  31. $list[] = $line;
  32. }
  33. }
  34. else
  35. {
  36. if (in_array('HOME', $_POST['filter']))
  37. {
  38. $list[] = $line;
  39. }
  40. }
  41. }
  42. else
  43. {
  44. if (in_array('NOT', $_POST['filter']))
  45. {
  46. $list[] = $line;
  47. }
  48. }
  49. }
  50. }
  51.  
  52.  
  53. /**
  54. * Генерация страницы
  55. */
  56. $tpl = new Template('GPS: Позиции');
  57. $tpl->assign('list',$list);
  58. $tpl->display('view/report/gps/position/index.tpl');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement