iwa-panda2

Manage Weather Data by International Weather Agency (Version 2)
Log | Files | Refs | README

commit 1d075f55986f112b62464ff3b8b47f2103c0aa8b
parent 0162ec370a9db1382c742e5a03394ff9c5613b75
Author: LennartSchroot <[email protected]>
Date:   Mon, 12 Jun 2023 23:47:44 +0200

historical data

joe

Diffstat:
AController/hdata/hdata.php | 10++++++++++
Mcss/dashboard.css | 34++++++++++++++++++++++++++++++++++
Mindex.php | 6+++++-
Mviews/hdata.html | 8+++-----
4 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/Controller/hdata/hdata.php b/Controller/hdata/hdata.php @@ -0,0 +1,10 @@ +<?php +function make_table(){ + $key = new Key(); + if (isset($_GET['downloadXml'])) { + return $key->retrieveHData(['data' => ':3jvl7yb5sRr80s6lTdeOyxV9VTQZkCPRp7bKOWKFWxfL2vhsU4Hhpgcmz9qe0zEk'], true); + } else { + return $key->retrieveHData(['data' => ':3jvl7yb5sRr80s6lTdeOyxV9VTQZkCPRp7bKOWKFWxfL2vhsU4Hhpgcmz9qe0zEk']); + } +} +?> diff --git a/css/dashboard.css b/css/dashboard.css @@ -57,6 +57,15 @@ nav ul li:first-child { vertical-align: middle; } +.download-button { + display: flex; + padding: 10px 20px; + background-color: #BC9999; + color: white; + text-decoration: none; + cursor: pointer; +} + /* HEADER */ h1 { text-align: center; @@ -114,6 +123,31 @@ h1 { font-weight: bold; } +table { + width: 100%; + border-collapse: collapse; +} + +th, td { + padding: 8px; + text-align: left; + border-bottom: 1px solid #ddd; +} + +th { + background-color: gray; + font-weight: bold; +} + +tr:hover { + background-color: #444444; +} + +#tabledate{ + background-color: black; + color: #BCCFB0; +} + #myChart { display: inline !important; width: 90% !important; diff --git a/index.php b/index.php @@ -44,7 +44,11 @@ $router->addRoute(["GET"], "/dashboard", function(&$vars){ return "views/dashboard.html"; }); -$router->addRoute(["GET"], "/hdata", "views/hdata.html"); +$router->addRoute(["GET"], "/hdata", function(&$vars){ + include"Controller/hdata/hdata.php"; + $vars["table"] = make_table(); + return "views/hdata.html"; +}); $router->addRoute(["GET"], "/api/:data", function($vars) { $key = new Key; $key->retrieveData($vars); diff --git a/views/hdata.html b/views/hdata.html @@ -27,13 +27,11 @@ <div class="content-title"> <h2>Data past 4 weeks</h2> </div> - <ol class="fancy-list" id="weather-list"></ol> + <div> + {{$table}} + </div> </div> </div> - - <div class="block2"> - <button>Download</button> - </div> </div> </body> <script src="../js/panda.js"></script>