Footer.php 943 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. require_once($path["entity"] . "Lang.php");
  3. /**
  4. * Page footer.
  5. *
  6. * Used to display the footer in every page.
  7. */
  8. class Footer{
  9. /**
  10. * Array of {@see Lang} the page can be served on.
  11. */
  12. public $lang = [];
  13. /**
  14. * Constructor.
  15. *
  16. * Searches the database and populates the social and lang arrays.
  17. *
  18. * @param MySQL_connection $db Connection to the database.
  19. * @param string $lang Lowercase, two-letter language code.
  20. */
  21. public function __construct($db, $lang){
  22. $s_lang =
  23. "SELECT code AS id " .
  24. "FROM lang " .
  25. "WHERE active = 1; ";
  26. $q_lang = mysqli_query($db, $s_lang);
  27. while($r_lang = mysqli_fetch_array($q_lang)){
  28. array_push($this->lang, new Lang($db, $r_lang["id"]));
  29. }
  30. }
  31. }
  32. ?>