Automatically exported from code.google.com/p/planningalerts
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

58 rader
1.2 KiB

  1. <?php
  2. require_once ("config.php");
  3. require_once ("DB.php");
  4. require_once ("stats.php");
  5. $about_page = new about_page;
  6. class about_page {
  7. //Properties
  8. var $authorities = array();
  9. //Constructor
  10. function about_page() {
  11. $this->setup();
  12. $this->bind();
  13. }
  14. //Setup
  15. function setup (){
  16. $db = DB::connect(DB_CONNECTION_STRING);
  17. //Grab a list of local authorities
  18. $sql = "Select full_name, disabled from authority where disabled = 0 or disabled is null order by full_name";
  19. $results = $db->getAll($sql);
  20. for ($i=0; $i < sizeof($results); $i++){
  21. array_push($this->authorities, $results[$i][0]);
  22. }
  23. }
  24. //Bind
  25. function bind() {
  26. //page vars
  27. $form_action = $_SERVER['PHP_SELF'];
  28. //smarty
  29. $smarty = new Smarty;
  30. $smarty->force_compile = true;
  31. $smarty->compile_dir = SMARTY_COMPILE_DIRECTORY;
  32. $smarty->assign("stats", stats::get_stats());
  33. $smarty->assign("page_title","About");
  34. $smarty->assign("menu_item", "about");
  35. $smarty->assign("authorities",$this->authorities);
  36. //Render
  37. $smarty->display('about.tpl');
  38. }
  39. }
  40. ?>