diff options
author | Mateja <mail@matejamaric.com> | 2020-10-02 19:36:16 +0200 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2020-10-02 19:36:16 +0200 |
commit | 86613978c06546af098e96ed9b9496a3dd67ad62 (patch) | |
tree | a4f1fce8b99146bf9d1f2b267ed28c89a2beadd0 /reservation.php | |
parent | 0d8992a2762d6a2b983d9aa1c2944d6cebef7371 (diff) | |
download | old-php-yota-86613978c06546af098e96ed9b9496a3dd67ad62.tar.gz old-php-yota-86613978c06546af098e96ed9b9496a3dd67ad62.zip |
Work on reservation...
Diffstat (limited to 'reservation.php')
-rw-r--r-- | reservation.php | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/reservation.php b/reservation.php index 7b34f71..ec46440 100644 --- a/reservation.php +++ b/reservation.php @@ -25,24 +25,7 @@ session_start(); </nav> <main> <?php -if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['fname']) && isset($_POST['lname']) && isset($_POST['age'])) { - $user = "yota_user"; - $password = "leex3EThieK0ieLaiVaicaifef5eecei"; - $database = "yota_call_db"; - $table = "activities"; - try { - $conn = new PDO("mysql:host=localhost;dbname=$database", $user, $password); - $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $stmt = $conn->prepare("INSERT INTO activities (name, surname, age) VALUES (:name, :surname, :age)"); - $stmt->bindParam(':name', $_POST['fname']); - $stmt->bindParam(':surname', $_POST['lname']); - $stmt->bindParam(':age', $_POST['age']); - $stmt->execute(); - echo "<p>Data inserted.</p>"; - } catch (PDOException $e) { - echo "<p>Error!: " . $e->getMessage() . "</p>"; - } -} + require "handle-reservation.php"; ?> <form method="post"> @@ -52,11 +35,15 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['fname']) && isset($_PO <option value="YT50SCWC">YT50SCWC</option> </select> <!-- START TIME --> +<label for="start-date">Start date:</label> +<input type="date" id="start-date" name="sdate"> <label for="start-time">Start time:</label> -<input type="datetime-local" id="start-time" name="stime"> +<input type="time" id="start-time" name="stime"> <!-- END TIME --> +<label for="end-date">End date:</label> +<input type="date" id="end-date" name="edate"> <label for="end-time">End time:</label> -<input type="datetime-local" id="end-time" name="etime"> +<input type="time" id="end-time" name="etime"> <!-- BANDS --> <fieldset> <legend>I will be active on bands:</legend> |