瀏覽代碼

Custom filter for the rune upgrade report in the main report view.

Iñigo Valentin 6 年之前
父節點
當前提交
a4d34db4d3
共有 3 個文件被更改,包括 24 次插入1 次删除
  1. 22 1
      application/page/Report_Page.php
  2. 1 0
      application/page/Report_Runeupgrade_Page.php
  3. 1 0
      application/view/report.php

+ 22 - 1
application/page/Report_Page.php

@@ -1,6 +1,7 @@
  <?php
  <?php
 
 
     require_once($path["page"] . "Page.php");
     require_once($path["page"] . "Page.php");
+    require_once($path["entity"] . "Custom_Filter.php");
 
 
 
 
     /**
     /**
@@ -8,6 +9,11 @@
      */
      */
     class Report_Page extends Page{
     class Report_Page extends Page{
 
 
+        /**
+         * Custom filters for this page.
+         */
+        public $custom_filters_runeupgrade = [];
+
         /**
         /**
          * Constructor.
          * Constructor.
          *
          *
@@ -18,11 +24,26 @@
         public function __construct($db){
         public function __construct($db){
             global $path;
             global $path;
             global $root;
             global $root;
+            global $UID;
             parent::__construct($db);
             parent::__construct($db);
             $this->view = $path["view"] . "report.php";
             $this->view = $path["view"] . "report.php";
+
+            // Get custom filters
+            $s = "
+              SELECT id
+              FROM filter
+              WHERE
+                uid = '$UID' AND
+                page = 'REPORT_RUNEUPGRADE';
+            ";
+            $q = $this->db->query($s);
+            while ($r = $q->fetchArray(SQLITE3_ASSOC)){
+                array_push($this->custom_filters_runeupgrade, new Custom_Filter($this->db, $r["id"]));
+            }
+
             $this->title = "Reports - SWDB";
             $this->title = "Reports - SWDB";
             $this->description = "Usefull reports for summoners";
             $this->description = "Usefull reports for summoners";
-            $this->canonical = $root . "report";
+            $this->canonical = $root . "report";$this->title = "Reports - SWDB";
         }
         }
     }
     }
 ?>
 ?>

+ 1 - 0
application/page/Report_Runeupgrade_Page.php

@@ -123,6 +123,7 @@
             // Last entries
             // Last entries
             array_push($upgrade["upgrade"], $rupgrade);
             array_push($upgrade["upgrade"], $rupgrade);
             array_push($this->upgrades, $upgrade);
             array_push($this->upgrades, $upgrade);
+
             // Get custom filters for the form
             // Get custom filters for the form
             $s = "
             $s = "
               SELECT id
               SELECT id

+ 1 - 0
application/view/report.php

@@ -67,6 +67,7 @@
                 </p>
                 </p>
 <?php
 <?php
                 $filters = $FILTER_RUNEUPGRADE;
                 $filters = $FILTER_RUNEUPGRADE;
+                $custom_filters = $page->custom_filters_runeupgrade;
                 include __DIR__ . "/inc/filter_report_runeupgrade.php";
                 include __DIR__ . "/inc/filter_report_runeupgrade.php";
 ?>
 ?>
             </article>
             </article>