From 110967fe02d337872508b2bba9cd48db138987ab Mon Sep 17 00:00:00 2001 From: Mateja Date: Thu, 1 Oct 2020 22:39:38 +0200 Subject: Work on button and styling... --- test/index.php | 66 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'test/index.php') diff --git a/test/index.php b/test/index.php index 3b1d7c0..fb6e942 100644 --- a/test/index.php +++ b/test/index.php @@ -1,15 +1,24 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } + catch (PDOException $e) { + echo $e->getMessage(); + } if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["name"]) && isset($_POST["date"]) && isset($_POST["time"])) { # values will always be set, check if they are empty... echo "Information submitted!
"; echo "Date: " . date('Y-m-d H:i:s') . "
"; + echo "User date: " . $_POST["date"] . "
"; + echo "User time: " . $_POST["time"] . "
"; + //$toDT='2020-10-10 12:00:00'; + $toDT=$_POST["date"] . " " . $_POST["time"] . ":00"; + echo "$toDT
"; try { - $conn = new PDO("mysql:host=localhost;dbname=testdb", "testuser", "testpass"); - $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $conn->prepare("INSERT INTO tbl1 (`name`, `from`, `to`) VALUES (:name, :from, :to)"); $stmt->bindParam(':name', $_POST['name']); $stmt->bindParam(':from', date('Y-m-d H:i:s')); - $toDT='2020-10-10 12:00:00'; $stmt->bindParam(':to', $toDT); $stmt->execute(); } @@ -24,6 +33,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["name"]) && isset($_POS Test table - + .edit { + padding: 2px; + border-top: 1px solid #333; + border-left: 1px solid #333; + border-bottom: 1px solid #666; + border-right: 1px solid #666; + border-radius: 3px; + } + +

@@ -69,15 +78,15 @@ function subAction(action) { try { echo "\n"; echo "\n"; - foreach ($conn->query("SELECT * FROM tbl1") as $row) { + foreach ($conn->query("SELECT * FROM tbl1 ORDER BY `id` DESC") as $row) { echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo "\n"; } echo "
IDFromToNameActions
" . $row['id'] . "" . $row['from'] . "" . $row['to'] . "" . $row['name'] . "
" . $row['from'] . "
" . $row['to'] . "
" . $row['name'] . "
"; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo "
\n"; @@ -86,5 +95,6 @@ catch (PDOException $e) { echo $e->getMessage(); } ?> + -- cgit v1.2.3