Automatically exported from code.google.com/p/planningalerts
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

manchester.php 1.7 KiB

18 년 전
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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'] -6;
  9. $month = $current_date['mon'];
  10. $year = $current_date['year'];
  11. $council = "lambeth";
  12. //if any get params were passed, overwrite the default date
  13. if (isset($_GET['day'])){
  14. $day = $_GET['day'];
  15. }
  16. if (isset($_GET['month'])){
  17. $month = $_GET['month'];
  18. }
  19. if (isset($_GET['year'])){
  20. $year = $_GET['year'];
  21. }
  22. //search url
  23. $search_url = "http://www.publicaccess.manchester.gov.uk/publicaccess/tdc/DcApplication/application_searchresults.aspx?searchtype=WEEKLY&selWeeklyListRange=#daterange&weektype=VAL";
  24. $date_range = "{$day}%2F{$month}%2F{$year}%7C{$day}%2F{$month}%2F{$year}";
  25. $search_url = str_replace("#daterange", $date_range, $search_url);
  26. //comment and info urls
  27. $info_url_base = "http://www.publicaccess.manchester.gov.uk/publicaccess/tdc/DcApplication/application_detailview.aspx?caseno=";
  28. $comment_url_base = "http://www.publicaccess.manchester.gov.uk/publicaccess/tdc/DcApplication/application_comments_entryform.aspx?caseno=";
  29. //grab urls
  30. $applications = scrape_applications_publicaccess($search_url, $info_url_base, $comment_url_base);
  31. //smarty
  32. $smarty = new Smarty;
  33. $smarty->force_compile = true;
  34. $smarty->compile_dir = SMARTY_COMPILE_DIRECTORY;
  35. $smarty->template_dir = "../templates";
  36. $smarty->assign("authority_name", "City of Manchester");
  37. $smarty->assign("authority_short_name", "Manchester");
  38. if (sizeof($applications) > 0){
  39. $smarty->assign("applications", $applications);
  40. }
  41. $smarty->display("xml.tpl");
  42. ?>