aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-10-02 12:46:32 +0200
committerMateja <mail@matejamaric.com>2020-10-02 12:46:32 +0200
commit0d8992a2762d6a2b983d9aa1c2944d6cebef7371 (patch)
treedae38e899cad27a3605b16a3ffabb56983da16c7
parent6a290235781cbca58dd1d102d030110b4eb0c6c9 (diff)
downloadold-php-yota-0d8992a2762d6a2b983d9aa1c2944d6cebef7371.tar.gz
old-php-yota-0d8992a2762d6a2b983d9aa1c2944d6cebef7371.zip
Starting direct work...
Made SQL notes.
-rw-r--r--index.php6
-rw-r--r--notes.sql25
-rw-r--r--reservation.php13
3 files changed, 28 insertions, 16 deletions
diff --git a/index.php b/index.php
index 47b4069..938534c 100644
--- a/index.php
+++ b/index.php
@@ -36,11 +36,11 @@ session_start();
echo '<div style="overflow-x:auto;">';
echo "<table>\n";
- echo "<tr>";
+ echo "<thead><tr>";
echo "<th>Ime</th>";
echo "<th>Prezime</th>";
echo "<th>Godine</th>";
- echo "</tr>\n";
+ echo "</tr></thead><tbody>\n";
foreach($db->query("SELECT * FROM $table where approved=true") as $row) {
echo "<tr>";
@@ -50,7 +50,7 @@ session_start();
echo "</tr>\n";
}
- echo "</table>\n</div>\n";
+ echo "</tbody></table>\n</div>\n";
} catch (PDOException $e) {
echo "<p>Error!: " . $e->getMessage() . "</p>";
die();
diff --git a/notes.sql b/notes.sql
new file mode 100644
index 0000000..1794c53
--- /dev/null
+++ b/notes.sql
@@ -0,0 +1,25 @@
+CREATE DATABASE yota_db;
+USE yota_db;
+
+CREATE TABLE activities(
+ `id` int(11) not null auto_increment primary key,
+ `fromTime` datetime not null,
+ `toTime` datetime not null,
+ `specialCall` varchar(50) not null,
+ `frequencies` varchar(255) not null,
+ `modes` varchar(255) not null,
+ `operatorCall` varchar(50) not null,
+ `operatorName` varchar(50) not null,
+ `operatorEmail` varchar(100) not null,
+ `operatorPhone` varchar(50) not null
+ ) charset=utf8;
+
+CREATE TABLE admins(
+ `id` int(11) not null auto_increment primary key,
+ `email` varchar(100) not null,
+ `password` varchar(255) not null
+ ) charset=utf8;
+
+GRANT ALL PRIVILEGES ON `yota_db`.* TO `yota_admin`@`localhost` IDENTIFIED BY 'quaequaquagh6ahwoh6Chahx1EiFooGh';
+GRANT SELECT ON `yota_db`.* TO `yota_user`@`localhost` IDENTIFIED BY 'gahdeer6shai9hogai2sai4quuaj1eVu';
+GRANT INSERT ON `yota_db`.`activities` TO `yota_requester`@`localhost` IDENTIFIED BY 'oon5iraeghaidoShi5sheefie2uuz3gu';
diff --git a/reservation.php b/reservation.php
index f070d1c..7b34f71 100644
--- a/reservation.php
+++ b/reservation.php
@@ -44,19 +44,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['fname']) && isset($_PO
}
}
?>
-<form method="post">
-<label for="fname">First name:</label>
-<input type="text" id="fname" name="fname">
-<label for="lname">Last name:</label>
-<input type="text" id="lname" name="lname">
-<label for="age">Age:</label>
-<input type="number" id="age" name="age">
-<input type="submit" value="Submit">
-</form>
-
-<hr>
-<hr>
-<hr>
<form method="post">
<!-- SPECIAL CALL -->