commit f069f7b5121c7826914df048e62beee6a239bc31
parent 2a71f7a627ec0f236268bb58a5988eb5f2642e1b
Author: MoiBaguette <[email protected]>
Date: Tue, 18 Apr 2023 16:02:36 +0200
clean-up before sending to client
Diffstat:
19 files changed, 31 insertions(+), 609 deletions(-)
diff --git a/Lollipop/SQLDatabase.php b/Lollipop/SQLDatabase.php
@@ -85,7 +85,7 @@ namespace Lollipop {
}
return $objects;
}
- public function getDateRange(string $table_name, array $query)
+ public function getDateRange(string $table_name, array $query, $order)
{
if($query == null)
return [];
@@ -106,6 +106,8 @@ namespace Lollipop {
}
}
+ $sql .= " ORDER BY date_time " . $order;
+ $sql .= " LIMIT 1000";
$stmt = $this->conn->prepare($sql);
$stmt->execute($values);
$result = $stmt->get_result();
diff --git a/Connect.php b/back-up/Connect.php
diff --git a/back-up/alteruser.php b/back-up/alteruser.php
@@ -1,152 +0,0 @@
-<!DOCTYPE html>
-<html lang="nl">
-
-<head>
- <title>Edit user</title>
- <!-- Bootstrap CSS -->
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
-</head>
-<?php
-include "navbar.php";
-if (!in_array(1, $_SESSION['permissions'])) {
- header('Location: dashboard.php');
- exit;
-}
-?>
-
-<body>
- <div class="container">
- <h1>Edit user</h1>
-
- <form action="crud_user.php" method="post">
- <div class="mb-3">
- <label for="voornaam" class="form-label"><b>First Name:</b></label>
- <input type="text" class="form-control" name="voornaam" id="voornaam" placeholder="First Name">
- </div>
- <div class="mb-3">
- <label for="achternaam" class="form-label"><b>Last Name:</b></label>
- <input type="text" class="form-control" name="achternaam" id="achternaam" placeholder="Last Name">
- </div>
- <div class="mb-3">
- <label for="email" class="form-label"><b>Email:</b></label>
- <input type="text" class="form-control" name="email" id="email" placeholder="Email">
- </div>
- <div class="mb-3">
- <label for="password" class="form-label"><b>Password:</b></label>
- <input type="password" class="form-control" name="password" id="password" placeholder="******">
- </div>
- <p>Please select the user permissions:</p>
- <div class="mb-3 form-check">
- <input type="checkbox" class="form-check-input" id="Admin" name="permissions[]" value="1">
- <label class="form-check-label" for="Admin">Admin</label>
- </div>
- <div class="mb-3 form-check">
- <input type="checkbox" class="form-check-input" id="Administratief medewerker" name="permissions[]"
- value="2">
- <label class="form-check-label" for="Administratief medewerker">Administratief medewerker</label>
- </div>
- <div class="mb-3 form-check">
- <input type="checkbox" class="form-check-input" id="Wetenschappelijk medewerker" name="permissions[]"
- value="3">
- <label class="form-check-label" for="Wetenschappelijk medewerker">Wetenschappelijk medewerker</label>
- </div>
- <button type="submit" class="btn btn-primary" name="submit">Submit</button>
- </form>
- </div>
- <?php
- $servername = "86.92.67.21";
- $username = "friedel";
- $password = "hailiwa";
- $dbname = "wap2";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
-
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
- $errors = array(); // initialize an empty array to store errors
-
- // Check if voornaam is set and not empty
- if (isset($_POST['voornaam']) && !empty($_POST['voornaam'])) {
- $fname = $_POST['voornaam'];
- } else {
- $errors[] = "Voornaam is required";
- }
-
- // Check if achternaam is set and not empty
- if (isset($_POST['achternaam']) && !empty($_POST['achternaam'])) {
- $lname = $_POST['achternaam'];
- } else {
- $errors[] = "Achternaam is required";
- }
-
- // Check if email is set and not empty
- if (isset($_POST['email']) && !empty($_POST['email'])) {
- $email = $_POST['email'];
- } else {
- $errors[] = "E-mail is required";
- }
-
- // Check if password is set and not empty
- if (isset($_POST['password']) && !empty($_POST['password'])) {
- $password = $_POST['password'];
- } else {
- $password = null;
- }
-
- // Check if permissions is set
- if (isset($_POST['permissions'])) {
- $permissions = $_POST['permissions'];
- } else {
- $errors[] = "Permissies zijn vereist";
- }
-
- // Check if there are any errors
- if (count($errors) > 0) {
- // Print out the errors
- foreach ($errors as $error) {
- echo $error . "<br>";
- }
- } else {
- // Pass the password through a hashing function
-
- // Making a sql statement to add user to the database, preparing it and excuting
- $sql = "UPDATE medewerkers
- SET voornaam = ?, achternaam = ?
- WHERE email = ?";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param("sss", $fname, $lname, $email);
- $stmt->execute();
-
- if ($password) {
- $hash = password_hash($password, PASSWORD_DEFAULT);
- $sql = "UPDATE medewerkers
- SET wachtwoord = ?
- WHERE email = ?";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param("ss", $hash, $email);
- $stmt->execute();
- }
-
- $sql = "DELETE medewerkers WHERE email = ?";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param("s", $email);
- $stmt->execute();
-
- //Excecuting a sql statement for all the user permissions
- foreach ($permissions as $perm) {
- $sql = "INSERT INTO medewerkers_permissie (email, permissie_id) VALUES (?, ?);";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param("si", $email, $perm);
- $stmt->execute();
- }
- }
- }
- // closing the connection
- mysqli_close($conn);
- ?>
-</body>
-
-</html>
-\ No newline at end of file
diff --git a/backup b/back-up/backup
diff --git a/back-up/crud_user.php b/back-up/crud_user.php
@@ -1,124 +0,0 @@
-<!DOCTYPE html>
-<html lang="nl">
- <head>
- <title>Add user</title>
- <!-- Bootstrap CSS -->
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
- </head>
- <?php
- include "navbar.php";
- include "Connect.php";
- if(!in_array(1, $_SESSION['permissions'])){
- header('Location: dashboard.php');
- exit;
- }
- ?>
- <body>
- <div class="container">
- <h1>Add user</h1>
-
- <form action="crud_user.php" method="post">
- <div class="mb-3">
- <label for="voornaam" class="form-label"><b>First Name:</b></label>
- <input type="text" class="form-control" name="voornaam" id="voornaam" placeholder="First Name">
- </div>
- <div class="mb-3">
- <label for="achternaam" class="form-label"><b>Last Name:</b></label>
- <input type="text" class="form-control" name="achternaam" id="achternaam" placeholder="Last Name">
- </div>
- <div class="mb-3">
- <label for="email" class="form-label"><b>Email:</b></label>
- <input type="text" class="form-control" name="email" id="email" placeholder="Email">
- </div>
- <div class="mb-3">
- <label for="password" class="form-label"><b>Password:</b></label>
- <input type="password" class="form-control" name="password" id="password" placeholder="******">
- </div>
- <p>Please select the user permissions:</p>
- <div class="mb-3 form-check">
- <input type="checkbox" class="form-check-input" id="Admin" name="permissions[]" value="1">
- <label class="form-check-label" for="Admin">Admin</label>
- </div>
- <div class="mb-3 form-check">
- <input type="checkbox" class="form-check-input" id="Administratief medewerker" name="permissions[]" value="2">
- <label class="form-check-label" for="Administratief medewerker">Administratief medewerker</label>
- </div>
- <div class="mb-3 form-check">
- <input type="checkbox" class="form-check-input" id="Wetenschappelijk medewerker" name="permissions[]" value="3">
- <label class="form-check-label" for="Wetenschappelijk medewerker">Wetenschappelijk medewerker</label>
- </div>
- <button type="submit" class="btn btn-primary" name="submit">Add</button>
- </form>
- </div>
- <?php
- $connect = new Connect;
- $conn = $connect->getConn();
-
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
- $errors = array(); // initialize an empty array to store errors
-
- // Check if voornaam is set and not empty
- if (isset($_POST['voornaam']) && !empty($_POST['voornaam'])) {
- $fname = $_POST['voornaam'];
- } else {
- $errors[] = "Voornaam is required";
- }
-
- // Check if achternaam is set and not empty
- if (isset($_POST['achternaam']) && !empty($_POST['achternaam'])) {
- $lname = $_POST['achternaam'];
- } else {
- $errors[] = "Achternaam is required";
- }
-
- // Check if email is set and not empty
- if (isset($_POST['email']) && !empty($_POST['email'])) {
- $email = $_POST['email'];
- } else {
- $errors[] = "E-mail is required";
- }
-
- // Check if password is set and not empty
- if (isset($_POST['password']) && !empty($_POST['password'])) {
- $password = $_POST['password'];
- } else {
- $errors[] = "Wachtwoord is required";
- }
-
- // Check if permissions is set
- if (isset($_POST['permissions'])) {
- $permissions = $_POST['permissions'];
- } else {
- $errors[] = "Permissies zijn vereist";
- }
-
- // Check if there are any errors
- if (count($errors) > 0) {
- // Print out the errors
- foreach ($errors as $error) {
- echo $error . "<br>";
- }
- } else {
- // Pass the password through a hashing function
- $hash = password_hash($password, PASSWORD_DEFAULT);
-
- // Making a sql statement to add user to the database, preparing it and excuting
- $sql = "INSERT INTO medewerkers (email, voornaam, achternaam, wachtwoord) VALUES(?, ?, ?, ?)";
- $stmt= $conn->prepare($sql);
- $stmt->bind_param("ssss", $email, $fname, $lname, $hash);
- $stmt->execute();
-
- //Excecuting a sql statement for all the user permissions
- foreach($permissions as $perm){
- $sql = "INSERT INTO medewerkers_permissie (email, permissie_id) VALUES (?, ?);";
- $stmt= $conn->prepare($sql);
- $stmt->bind_param("si", $email, $perm);
- $stmt->execute();
- }
- }
- }
- // closing the connection
- mysqli_close($conn);
- ?>
- </body>
-</html>
diff --git a/back-up/form.html b/back-up/form.html
@@ -1,32 +0,0 @@
-<html lang="nl">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>User toevoegen</title>
- </head>
- <body>
-
- <h1>User toevoegen</h1>
-
- <form action="crud_user.php" method="post">
- <p>
- <b>Voornaam:</b> <input type="text" name="voornaam" id="voornaam" placeholder="Voornaam">
- <b>Achternaam:</b> <input type="text" name="achternaam" id="achternaam" placeholder="Achternaam">
- <b>Email</b> <input type="text" name="email" id="email" placeholder="Email">
- <b>Wachtwoord</b> <input type="password" name="password" id="password" placeholder="******">
- <br>
- <p>Please select the user permissions:</p>
- <input type="radio" id="Admin" name="permissions" value="1">
- <label for="Admin">Admin</label><br>
- <input type="radio" id="Administratief medewerker" name="permissions" value="2">
- <label for="Administratief medewerker">Administratief medewerker</label><br>
- <input type="radio" id="Wetenschappelijk medewerker" name="permissions" value="3">
- <label for="Wetenschappelijk medewerker">Wetenschappelijk medewerker</label>
- </p>
-
- <p><input type="submit" name="submit" value="Voeg toe"></p>
-
- </form>
- </body>
-</html>
diff --git a/back-up/includes.html b/back-up/includes.html
diff --git a/back-up/login.html b/back-up/login.html
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Login Page</title>
- </head>
- <body>
- <h2>Login</h2>
- <form method="POST" action="login.php">
- <label>Username:</label>
- <input type="text" name="username"><br><br>
- <label>Password:</label>
- <input type="password" name="password"><br><br>
-
- <input type="submit" name="login" value="Login">
- </form>
- </body>
-</html>
-\ No newline at end of file
diff --git a/back-up/login.php b/back-up/login.php
@@ -1,94 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Login Page</title>
- <!-- Add the Bootstrap CSS stylesheet -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
-</head>
-<body>
- <div class="container mt-5">
- <div class="row justify-content-center">
- <div class="col-md-6">
- <div class="card">
- <div class="card-header">Login</div>
- <div class="card-body">
- <form method="POST" action="login.php">
- <div class="form-group">
- <label for="email">Email:</label>
- <input type="email" class="form-control" id="email" name="email" placeholder="Enter email">
- </div>
- <div class="form-group">
- <label for="password">Password:</label>
- <input type="password" class="form-control" id="password" name="password" placeholder="Enter password">
- </div>
- <button type="submit" class="btn btn-primary">Login</button>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- Add the Bootstrap JavaScript library (optional) -->
- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
- <?php
- $servername = "86.92.67.21";
- $username = "friedel";
- $password = "hailiwa";
- $dbname = "wap2";
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // perform validation and authentication
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
-
- // check if a post request was sent
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
- // fetch data from the form
- if(isset($_POST['email']) && isset($_POST['password'])){
- $email = $_POST['email'];
- $pwd = $_POST['password'];
- } else {
- echo "One of the forms was empty";
- }
-
- // create, prepare sql statement and execute sql statement
- $sql = "select u.email, u.password, p.permission_id, p.permission_name
- from user u
- join user_permission up on up.user_id = u.user_id
- join permission p on p.permission_id = up.permission_id
- where u.email = ? ";
- $stmt= $conn->prepare($sql);
- $stmt->bind_param("s", $email);
- $stmt->execute();
- $result = $stmt->get_result();
-
- // verification logic and $_SESSION start
- if(count($row = $result->fetch_assoc()) > 0){
- if($email == $row['email'] && password_verify($pwd, $row['password'])) {
- session_start();
- $_SESSION['email'] = $row['email'];
- mysqli_data_seek($result, 0);
- $permissions = array();
- $permissions_names = array();
- while($row = mysqli_fetch_assoc($result)){
- array_push($permissions, $row['permission_id']);
- array_push($permissions_names, $row['permission_name']);
- }
- $_SESSION['permissions'] = $permissions;
- $_SESSION['permissions_names'] = $permissions_names;
- foreach($_SESSION['permissions'] as $bullshit){
- echo $bullshit . "<br>";
- }
- header('Location: dashboard.php');
- } else {
- echo '<p style="color:red">Invalid username or password.</p>';
- }
- } else {
- echo '<p style="color:red">Invalid username or password.</p>';
- }
- }
- ?>
- </body>
-</html>
-\ No newline at end of file
diff --git a/back-up/loginhandler.php b/back-up/loginhandler.php
@@ -1,58 +0,0 @@
-<?php
-$servername = "86.92.67.21";
-$username = "friedel";
-$password = "hailiwa";
-$dbname = "wap2";
-$conn = mysqli_connect($servername, $username, $password, $dbname);
-// perform validation and authentication
-if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
-}
-
-// check if a post request was sent
-if ($_SERVER["REQUEST_METHOD"] == "POST") {
- // fetch data from the form
- if(isset($_POST['email']) && isset($_POST['password'])){
- $email = $_POST['email'];
- $pwd = $_POST['password'];
- } else {
- echo "One of the forms was empty";
- }
-
- // create, prepare sql statement and execute sql statement
- $sql = "select u.email, u.password, p.permission_id, p.permission_name
- from user u
- join user_permission up on up.user_id = u.user_id
- join permission p on p.permission_id = up.permission_id
- where u.email = ? ";
- $stmt= $conn->prepare($sql);
- $stmt->bind_param("s", $email);
- $stmt->execute();
- $result = $stmt->get_result();
-
- // verification logic and $_SESSION start
- if(count($row = $result->fetch_assoc()) > 0){
- if($email == $row['email'] && password_verify($pwd, $row['password'])) {
- session_start();
- $_SESSION['email'] = $row['email'];
- mysqli_data_seek($result, 0);
- $permissions = array();
- $permissions_names = array();
- while($row = mysqli_fetch_assoc($result)){
- array_push($permissions, $row['permission_id']);
- array_push($permissions_names, $row['permission_name']);
- }
- $_SESSION['permissions'] = $permissions;
- $_SESSION['permissions_names'] = $permissions_names;
- foreach($_SESSION['permissions'] as $bullshit){
- echo $bullshit . "<br>";
- }
- header('Location: dashboard.php');
- } else {
- echo '<p style="color:red">Invalid username or password.</p>';
- }
- } else {
- echo '<p style="color:red">Invalid username or password.</p>';
- }
-}
-?>
-\ No newline at end of file
diff --git a/router.php b/back-up/router.php
diff --git a/back-up/searchuser.php b/back-up/searchuser.php
@@ -1,91 +0,0 @@
-<?php
- include "navbar.php";
- include "Connect.php";
-?>
-<html>
- <head>
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
- </head>
-<body>
- <form class="d-flex" action="searchuser.php" method="post">
- <input class="form-control me-2" type="search" name="search" placeholder="Search" aria-label="Search">
- <button class="btn btn-outline-success" type="submit">Search</button>
-</form>
- <?php
- $connect = new Connect;
- $conn = $connect->getConn();
-
- if (!isset($_POST['search'])){
- $sql = "SELECT email, first_name, last_name
- FROM user";
- $stmt= $conn->prepare($sql);
- $stmt->execute();
-
- $result = $stmt->get_result();
- echo "<table class=\"table table-striped\">
- <thead>
- <tr>
- <th>E-mail</th>
- <th>First name</th>
- <th>Last name</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>";
- while ($row = mysqli_fetch_assoc($result)) {
- $link = "/alteruser.php?email=" . $row['email'];
- echo "<tr>";
- echo "<td>" . $row['email'] . "</td>";
- echo "<td>" . $row['first_name'] . "</td>";
- echo "<td>" . $row['last_name'] . "</td>";
- echo "<td><a href='" . $link . "'>Edit</a></td>";
- echo "</tr>";
- }
- echo"
- </tbody>
- </table>";
- }
- if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['search'])) {
- $search = $_POST['search'];
- $search = "%" . $search . "%";
- $sql = "SELECT u.email, u.first_name, u.last_name
- FROM user u
- where u.email LIKE ?";
- $stmt= $conn->prepare($sql);
- $stmt->bind_param("s", $search);
- $stmt->execute();
-
- $result = $stmt->get_result();
-
- // verification logic and $_SESSION start
- if($result->num_rows > 0){
- echo "<table class=\"table table-striped\">
- <thead>
- <tr>
- <th>E-mail</th>
- <th>First name</th>
- <th>Last name</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>";
- while ($row = mysqli_fetch_assoc($result)) {
- $link = "/alteruser.php?email=" . $row['email'];
- echo "<tr>";
- echo "<td>" . $row['email'] . "</td>";
- echo "<td>" . $row['first_name'] . "</td>";
- echo "<td>" . $row['last_name'] . "</td>";
- echo "<td><a href='" . $link . "'>Edit</a></td>";
- echo "</tr>";
- }
- echo"
- </tbody>
- </table>";
- }else{
- echo "No users with this email address were found.";
- }
- }
- ?>
- </body>
-</html>
-
diff --git a/test.php b/back-up/test.php
diff --git a/testfileValidator.php b/back-up/testfileValidator.php
diff --git a/weather_data.txt b/back-up/weather_data.txt
diff --git a/weerdata.css b/back-up/weerdata.css
diff --git a/weerdata.php b/back-up/weerdata.php
diff --git a/css/general.css b/css/general.css
@@ -1,6 +1,6 @@
-@import url('https://fonts.googleapis.com/css?family=Montserrat:400,700&display=swap');
+/* @import url('https://fonts.googleapis.com/css?family=Montserrat:400,700&display=swap');
body {
margin: 0;
font-family: 'Montserrat', sans-serif;
-}
-\ No newline at end of file
+} */
+\ No newline at end of file
diff --git a/search_data.php b/search_data.php
@@ -6,41 +6,33 @@
$weather = $db->get(Weather_data::class);
- $date_begin = '2023-04-04';
- $date_end = '2023-04-05';
+ //$date_begin = '2023-04-04';
+ //$date_end = '2023-04-05';
+
+ $date_begin = "";
+ $date_end = "";
+ $station = "";
- $query = array(
- 'date_time' => array(
- '>=' => $date_begin,
- '<=' => $date_end
- )
- );
-
- $params = [];
+ $query = array();
if($_SERVER['REQUEST_METHOD'] == 'GET'){
- if(isset($_GET['date_end']))
+ if(isset($_GET['date_begin']) && !empty($_GET['date_begin'])){
$date_begin = ($_GET['date_begin'] . "%");
- else
- $date_begin = "%";
- if(isset($_GET['date_end']))
+ $query["date_time"][">="] = $date_begin;
+ }
+ if(isset($_GET['date_end'])&& !empty($_GET['date_end'])){
$date_end = ($_GET['date_end'] . "%");
- else
- $date_end = "%";
- if(isset($_GET['station']))
+ $query["date_time"]["<="] = $date_end;
+ }
+ if(isset($_GET['station']) && !empty($_GET['station'])){
$station = ($_GET['station'] . "%");
- else
- $station = "%";
+ $query["station_name"]["="] = $station;
+ }
- $query = array(
- 'date_time' => array(
- '>=' => $date_begin,
- '<=' => $date_end
- ),
- 'station' => array(
- '=' => $station
- )
- );
- $weather_data = $db->getDateRange(Weather_data::class, $query);
+ if($query == null){
+ $query["station_name"]["LIKE"] = "%";
+ }
+ $weather_data = $db->getDateRange(Weather_data::class, $query, "DESC");
+ //var_dump($weather_data);
}
?>
<html>
@@ -49,16 +41,16 @@
</head>
<body>
<form class="d-flex" action="search_data.php" method="get">
- <input class="form-control me-2" type="text" name="date_begin" placeholder="Date begin (YYYY-MM-DD)" pattern="\d{4}-\d{2}-\d{2}" value=<?php echo$startDate?>>
- <input class="form-control me-2" type="text" name="date_end" placeholder="Date end (YYYY-MM-DD)" pattern="\d{4}-\d{2}-\d{2}" value=<?php echo$endDate?>>
- <input class="form-control me-2" type="text" name="station" placeholder="Search" aria-label="Search" value=<?php echo$station?>>
+ <input class="form-control me-2" type="text" name="date_begin" placeholder="Date begin (YYYY-MM-DD)" pattern="\d{4}-\d{2}-\d{2}" value=<?php ?>>
+ <input class="form-control me-2" type="text" name="date_end" placeholder="Date end (YYYY-MM-DD)" pattern="\d{4}-\d{2}-\d{2}" value=<?php ?>>
+ <input class="form-control me-2" type="text" name="station" placeholder="Search" aria-label="Search" value=<?php ?>>
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
<?php
// verification logic and $_SESSION start
if ($weather_data != null) {?>
- <table class=\"table table-striped\">
+ <table class="table table-striped">
<thead>
<tr>
<th> Station name </th>