Automatically exported from code.google.com/p/planningalerts
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

lambeth.php 1.6 KiB

před 17 roky
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. //Includes
  3. require_once('config.php');
  4. require_once('application.php');
  5. require_once('scraper_support.php');
  6. //build date url
  7. $current_date = getdate();
  8. $day = $current_date['mday'] -5;
  9. $month = $current_date['mon'];
  10. $year = $current_date['year'];
  11. //if any get params were passed, overwrite the default date
  12. if (isset($_GET['day'])){
  13. $day = $_GET['day'];
  14. }
  15. if (isset($_GET['month'])){
  16. $month = $_GET['month'];
  17. }
  18. if (isset($_GET['year'])){
  19. $year = $_GET['year'];
  20. }
  21. //search url
  22. $search_url = "http://planning.lambeth.gov.uk/publicaccess/dc/DcApplication/application_searchresults.aspx?searchtype=WEEKLY&selWeeklyListRange=#daterange&weektype=VAL";
  23. $date_range = "{$day}%2F{$month}%2F{$year}%7C{$day}%2F{$month}%2F{$year}";
  24. $search_url = str_replace("#daterange", $date_range, $search_url);
  25. //comment and info urls
  26. $info_url_base = "http://planning.lambeth.gov.uk/publicaccess/dc/DcApplication/application_detailview.aspx?caseno=";
  27. $comment_url_base = "http://planning.lambeth.gov.uk/publicaccess/dc/DcApplication/application_comments_entryform.aspx?caseno=";
  28. //grab urls
  29. $applications = scrape_applications_publicaccess($search_url, $info_url_base, $comment_url_base);
  30. //smarty
  31. $smarty = new Smarty;
  32. $smarty->force_compile = true;
  33. $smarty->compile_dir = SMARTY_COMPILE_DIRECTORY;
  34. $smarty->template_dir = "../templates";
  35. $smarty->assign("authority_name", "London Borough of Lambeth");
  36. $smarty->assign("authority_short_name", "Lambeth");
  37. if (sizeof($applications) > 0){
  38. $smarty->assign("applications", $applications);
  39. }
  40. $smarty->display("xml.tpl");
  41. ?>