diff --git a/admin.php b/admin.php index 1a6c2ca..1801d1f 100644 --- a/admin.php +++ b/admin.php @@ -1,5 +1,6 @@ prepare('DELETE FROM nokia_facts WHERE id = ?'); + $stmt->execute([$_POST['delete_id']]); + header("Location: admin.php"); + exit; + } + + // Handle Add/Update + if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['fact_text'])) { + $fact_text = trim($_POST['fact_text']); + $fact_id = $_POST['fact_id'] ?? null; + + if (!empty($fact_text)) { + if ($fact_id) { // Update + $stmt = $pdo->prepare('UPDATE nokia_facts SET fact = ? WHERE id = ?'); + $stmt->execute([$fact_text, $fact_id]); + } else { // Add + $stmt = $pdo->prepare('INSERT INTO nokia_facts (fact) VALUES (?)'); + $stmt->execute([$fact_text]); + } + } + header("Location: admin.php"); + exit; + } + + // Handle Edit - Fetch fact for form + if (isset($_GET['edit_id'])) { + $stmt = $pdo->prepare('SELECT id, fact FROM nokia_facts WHERE id = ?'); + $stmt->execute([$_GET['edit_id']]); + $editing_fact = $stmt->fetch(); + } +} + ?> @@ -56,6 +98,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { + @@ -73,14 +116,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- +
- +
- +
@@ -90,49 +133,63 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {

Nokia Facts Management

-
+
+ +
+

+
+ +
+ + + + Cancel + +
+
+
+
- - - + query('SELECT id, fact, created_at FROM nokia_facts ORDER BY id DESC'); $facts = $stmt->fetchAll(); foreach ($facts as $fact): ?> - - - "; + } } else { - echo ""; + echo ""; } ?>
# FactCreated AtActionsActions
- - + + Edit +
+ + +
No facts found. Add one above!
Database connection not available.
Database connection not available.
-
@@ -147,4 +204,4 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { - \ No newline at end of file + diff --git a/assets/css/vibe.css b/assets/css/vibe.css index 46096c8..fb4aa84 100644 --- a/assets/css/vibe.css +++ b/assets/css/vibe.css @@ -1,7 +1,8 @@ - body { font-family: "Courier New", monospace; background-color: #000; color: #0FF; } - .navbar, .card, footer { background-color: #002B36 !important; border: 1px solid #0FF; } - .navbar-brand, .nav-link, h1, h2, h5, p { color: #0FF !important; } - .btn-primary { background-color: #0FF; color: #000; border: none; } - .vibe-preview { padding: 2rem; border: 1px dashed #0FF; margin-top: 2rem; } + @import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap"); + body { font-family: "Orbitron", sans-serif; background: linear-gradient(to bottom, #2c003e, #ff00c1); color: #fff; } + .navbar, .card, footer { background-color: rgba(0,0,0,0.5) !important; backdrop-filter: blur(10px); border: 1px solid #ff00c1; } + .navbar-brand, .nav-link, h1, h2, h5, p { color: #fff !important; text-shadow: 0 0 10px #ff00c1; } + .btn-primary { background: #ff00c1; border: none; box-shadow: 0 0 15px #ff00c1; } + .vibe-preview { padding: 2rem; border: 1px solid #ff00c1; margin-top: 2rem; } \ No newline at end of file diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..846e126 --- /dev/null +++ b/contact.php @@ -0,0 +1,115 @@ + + + + + + + Contact Us - LAMP Demo + + + + + + + + +
+
+
+
+
+

Contact Us

+ +
+

Thank You!

+

Your message has been sent successfully. We will get back to you shortly.

+ Return Home +
+ + +
-
+ +

Have a question or feedback? Fill out the form below to get in touch with us.

+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
This is for testing purposes only — Flatlogic does not guarantee usage of the mail server. Please set up your own SMTP in .env (MAIL_/SMTP_ vars).
+
+
+
+ + + + + + diff --git a/index.php b/index.php index c06fc00..358cd23 100644 --- a/index.php +++ b/index.php @@ -13,20 +13,21 @@