From f1bd63c7ea88bb950eb53e2e6ff748928470fd69 Mon Sep 17 00:00:00 2001 From: "Alfonso Saavedra \"Son Link" Date: Tue, 31 Dec 2024 11:51:25 +0100 Subject: [PATCH] Added new tables with the lists of the most used tracks and cars in the category --- app/Controllers/Home.php | 7 ++--- app/Views/main.php | 58 +++++++++------------------------------- public/js/home_tables.js | 46 +++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 49 deletions(-) diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index be4b729..4a2d726 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -130,7 +130,7 @@ class Home extends BaseController ################################ */ //list($tplData['mylaps'], $_) = $bestLapsModel->getBests($period, $carCatId, 0, 0); - + /* $tplData['tracks'] = []; $builder = $this->db->table('races'); $builder->select('track_id, COUNT(*) AS count'); @@ -160,8 +160,9 @@ class Home extends BaseController $tplData['tracks'] = $tracks; $tplData['tracksNames'] = $tracksNames; - } + }*/ + /* $tplData['cars'] = []; $builder = $this->db->table('races r'); @@ -174,7 +175,7 @@ class Home extends BaseController $query = $builder->get(); if ($query && $query->getNumRows() > 0) $tplData['cars'] = $query->getResult(); - + */ echo get_header('Home', ['minidt.css']); echo view('main', $tplData); echo get_footer(['minidt.js', 'home_tables.js']); diff --git a/app/Views/main.php b/app/Views/main.php index ded3ed6..b66fc62 100644 --- a/app/Views/main.php +++ b/app/Views/main.php @@ -1,10 +1,8 @@ '; $menuSelect = ''; ?> @@ -73,50 +71,18 @@ Most used Tracks
- - - - - - - - - - - - - - - -
TrackRaces
- track_id, 'track', $tracksNames[$race->track_id]) ?> - - count ?> -
+
+
+
+

Top cars

- - - - - - - - - - - - - - - -
CarRaces
- car_id, 'car', $car->name) ?> - - count ?> -
+
+
+
+