Automatically exported from code.google.com/p/planningalerts
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

51 linhas
1.6 KiB

  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. ?>