Report_Page.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Main reports page file.
  4. *
  5. * Provides a class with all the properties and methods to display the page.
  6. *
  7. * @category Page
  8. */
  9. /**
  10. * Require dependent files if not present.
  11. */
  12. require_once(PATH::PAGE . "Page.php");
  13. require_once(PATH::ENTITY . "Custom_Filter.php");
  14. /**
  15. * Main reports page model.
  16. *
  17. * @category Page
  18. */
  19. class Report_Page extends Page{
  20. /**
  21. * @var \Filter[] Custom filters for thie rune upgrade form.
  22. */
  23. public $custom_filters_runeupgrade = [];
  24. /**
  25. * Constructor.
  26. *
  27. * Retrieves the data and initializes the variables.
  28. *
  29. * @global int Player ID.
  30. * @global resource Database connection.
  31. */
  32. public function __construct(){
  33. global $UID;
  34. global $db;
  35. $this->view = PATH::VIEW . "report.php";
  36. // Get custom filters
  37. $s = "
  38. SELECT id
  39. FROM filter
  40. WHERE
  41. uid = '$UID' AND
  42. page = 'REPORT_RUNEUPGRADE';
  43. ";
  44. $q = $db->query($s);
  45. while ($r = $q->fetchArray(SQLITE3_ASSOC)){
  46. array_push($this->custom_filters_runeupgrade, new Custom_Filter($r["id"]));
  47. }
  48. $this->title = "Reports - SWDB";
  49. $this->description = "Usefull reports for summoners";
  50. $this->canonical = URL::BASE . "report";
  51. $this->title = "Reports - SWDB";
  52. }
  53. }
  54. ?>