diff --git a/app/Controllers/Races.php b/app/Controllers/Races.php index 18df86a..41f4ee5 100644 --- a/app/Controllers/Races.php +++ b/app/Controllers/Races.php @@ -29,15 +29,19 @@ class Races extends BaseController $builder = $this->db->table('laps'); $builder->where('race_id', $tplData['race']->id); $query = $builder->get(); - + + $tplData['race']->n_laps = 0; if ($query && $query->getNumRows() > 0) { $tplData['laps'] = json_encode($query->getResult()); - $tplData['user'] = new UsersModel($tplData['race']->user_id); - $tplData['car'] = new CarsModel(getCar($tplData['race']->car_id)); - $tplData['track'] = new TracksModel(getTrack($tplData['race']->track_id)); + $tplData['race']->n_laps = $query->getNumRows(); } + + $tplData['user'] = new UsersModel($tplData['race']->user_id); + $tplData['car'] = new CarsModel(getCar($tplData['race']->car_id)); + $tplData['track'] = new TracksModel(getTrack($tplData['race']->track_id)); } + echo get_header('Races'); echo view('race', $tplData); echo get_footer(['chart.min.js']); diff --git a/app/Views/race.php b/app/Views/race.php index 7a76fbd..e154937 100644 --- a/app/Views/race.php +++ b/app/Views/race.php @@ -30,11 +30,18 @@ getLink() ?> + + Laps completed: + + n_laps ?> + +
+ \ No newline at end of file + + diff --git a/public/css/style.css b/public/css/style.css index 7ef1b8f..135183d 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -582,11 +582,11 @@ sd-carcategoryselection { } #open-menu { - background-image: url(/img/menu.svg); + background-image: url('/img/menu.svg'); } #close-menu { - background-image: url(/img/backburger.svg); + background-image: url('/img/backburger.svg'); } #menu {