From a3094caeb564821870870d57efb4a4fc3fd659e7 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 4 Oct 2020 00:16:49 +0200 Subject: A whole lot of shaking going on... --- admin.php | 105 ++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 44 deletions(-) (limited to 'admin.php') diff --git a/admin.php b/admin.php index 39f268c..32f6b03 100644 --- a/admin.php +++ b/admin.php @@ -1,33 +1,5 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - - $stmt = $conn->prepare("SELECT * FROM admins WHERE email=:email"); - $stmt->bindParam(':email', $_POST['email']); - $stmt->execute(); - $row = $stmt->fetch(); - - if (password_verify($_POST['password'], $row['password'])){ - $_SESSION['admin'] = true; - } else { - $_SESSION['admin'] = false; - } - } catch (PDOException $e) { - echo "

Error!: " . $e->getMessage() . "

"; - } - $stmt=null; - $conn=null; -} ?> @@ -52,35 +24,79 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['email']) && isset($_PO ?>
+

setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + echo '
'; - echo "\n"; + echo "
\n"; echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; - echo "\n"; - foreach($conn->query("SELECT * FROM activities WHERE approved = false") as $row) { + echo "\n"; + + foreach($conn->query("SELECT * FROM activities ORDER BY `id` DESC") as $row) { echo ""; - echo ""; - echo ""; - echo ""; - echo ''; - echo "\n"; + echo ""; + + if ($row['approved']) + echo ""; + else + echo ""; + + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "\n"; } - echo "
ImePrezimeGodineIDApprovedOperator SignQSOFromToFrequenciesModesSpecial signOperator NameOperator EmailOperator PhoneActions
" . $row['name'] . "" . $row['surname'] . "" . $row['age'] . "
'; - echo ''; - echo ''; - echo '
" . $row['id'] . "" . $row['operatorCall'] . "" . $row['fromTime'] . "" . $row['toTime'] . "" . $row['frequencies'] . "" . $row['modes'] . "" . $row['specialCall'] . "" . $row['operatorName'] . "" . $row['operatorEmail'] . "" . $row['operatorPhone'] . "" . $row['qso'] . "
" . $row['operatorCall'] . "
" . $row['qso'] . "
" . $row['fromTime'] . "
" . $row['toTime'] . "
" . $row['frequencies'] . "
" . $row['modes'] . "
" . $row['specialCall'] . "
" . $row['operatorName'] . "
" . $row['operatorEmail'] . "
" . $row['operatorPhone'] . "
"; + echo ""; + echo ""; + echo ""; + echo "
\n
\n"; + echo "\n\n"; } catch (PDOException $e) { echo "

Error!: " . $e->getMessage() . "

"; } } else { # Bad pass check... - if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_SESSION['admin']) && $_SESSION['admin'] == false) echo "Bad credentials!"; + if (isset($_SESSION['admin']) && $_SESSION['admin'] == false) + echo "Bad credentials!"; # Login form echo '
'; echo ''; @@ -92,5 +108,6 @@ if (isset($_SESSION['admin']) && $_SESSION['admin'] == true) { } ?>
+ -- cgit v1.2.3