From abcecf5b5a0f19c840e8b676070e4a887c125ec3 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Wed, 15 Oct 2025 14:43:05 +0000 Subject: [PATCH] mak1 --- assets/css/custom.css | 72 ++++++++ assets/js/main.js | 1 + contact_form.php | 99 +++++++++++ contacts.php | 111 +++++++++++++ db/migrations/001_initial_schema.sql | 16 ++ deals.php | 47 ++++++ delete_contact.php | 11 ++ index.php | 238 +++++++++++---------------- 8 files changed, 451 insertions(+), 144 deletions(-) create mode 100644 assets/css/custom.css create mode 100644 assets/js/main.js create mode 100644 contact_form.php create mode 100644 contacts.php create mode 100644 db/migrations/001_initial_schema.sql create mode 100644 deals.php create mode 100644 delete_contact.php diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..d691591 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,72 @@ +body { + background-color: #F4F7F6; + font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + color: #333; +} + +.sidebar { + position: fixed; + top: 0; + left: 0; + height: 100%; + width: 250px; + background-color: #fff; + padding: 1.5rem; + box-shadow: 0 0 2rem rgba(0, 0, 0, 0.05); +} + +.sidebar h3 { + font-weight: 700; + margin-bottom: 2rem; + background: linear-gradient(45deg, #4A90E2, #50E3C2); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +} + +.sidebar .nav-link { + color: #555; + font-weight: 500; + padding: 0.75rem 0; + transition: all 0.2s ease; +} + +.sidebar .nav-link:hover, +.sidebar .nav-link.active { + color: #4A90E2; + transform: translateX(5px); +} + +.main-content { + margin-left: 250px; + padding: 2rem; +} + +.stat-card { + background-color: #fff; + border-radius: 0.5rem; + padding: 1.5rem; + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05); + transition: all 0.3s ease; +} + +.stat-card:hover { + transform: translateY(-5px); + box-shadow: 0 1rem 1.5rem rgba(0, 0, 0, 0.08); +} + +.stat-card .stat-title { + font-size: 1rem; + color: #777; + font-weight: 500; +} + +.stat-card .stat-value { + font-size: 2.5rem; + font-weight: 700; + color: #333; +} + +.stat-card .stat-icon { + font-size: 2rem; + color: #4A90E2; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..40d83c4 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1 @@ +// Future JavaScript will go here diff --git a/contact_form.php b/contact_form.php new file mode 100644 index 0000000..5dcb6f8 --- /dev/null +++ b/contact_form.php @@ -0,0 +1,99 @@ +prepare('SELECT * FROM contacts WHERE id = ?'); + $stmt->execute([$id]); + $contact = $stmt->fetch(); + if ($contact) { + $name = $contact['name']; + $email = $contact['email']; + } else { + die('Contact not found.'); + } +} + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $name = $_POST['name'] ?? ''; + $email = $_POST['email'] ?? ''; + + if (empty($name) || empty($email)) { + $error = 'Name and email are required.'; + } else { + if ($is_edit) { + $stmt = db()->prepare('UPDATE contacts SET name = ?, email = ? WHERE id = ?'); + $stmt->execute([$name, $email, $id]); + } else { + $stmt = db()->prepare('INSERT INTO contacts (name, email) VALUES (?, ?)'); + $stmt->execute([$name, $email]); + } + header('Location: contacts.php'); + exit; + } +} +?> + + + + + + <?= $is_edit ? 'Edit' : 'Add' ?> Contact - Makizto + + + + + + + + + + +
+
+

Contact

+ + +
+ + +
+
+
+
+ + +
+
+ + +
+ + Cancel +
+
+
+
+
+ + + + + + + diff --git a/contacts.php b/contacts.php new file mode 100644 index 0000000..7024fbb --- /dev/null +++ b/contacts.php @@ -0,0 +1,111 @@ +query('SELECT COUNT(*) FROM contacts'); +$count = $stmt->fetchColumn(); + +// If no contacts, add some sample data +if ($count == 0) { + db()->exec(""" + INSERT INTO contacts (name, email) VALUES + ('John Doe', 'john.doe@example.com'), + ('Jane Smith', 'jane.smith@example.com'), + ('Peter Jones', 'peter.jones@example.com'); + """); +} + +// Fetch all contacts +$stmt = db()->query('SELECT * FROM contacts ORDER BY created_at DESC'); +$contacts = $stmt->fetchAll(); +?> + + + + + + Contacts - Makizto + + + + + + + + + + + + + + + + + + + +
+
+
+

Contacts

+ + Add Contact + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameEmailCreated AtActions
No contacts found.
+ + Edit + + + Delete + +
+
+
+
+
+ + + + + + + diff --git a/db/migrations/001_initial_schema.sql b/db/migrations/001_initial_schema.sql new file mode 100644 index 0000000..e560e6f --- /dev/null +++ b/db/migrations/001_initial_schema.sql @@ -0,0 +1,16 @@ +CREATE TABLE IF NOT EXISTS `contacts` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `name` VARCHAR(255) NOT NULL, + `email` VARCHAR(255) NOT NULL, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `deals` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `title` VARCHAR(255) NOT NULL, + `value` DECIMAL(10, 2) NOT NULL, + `status` VARCHAR(50) NOT NULL DEFAULT 'open', + `contact_id` INT, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (`contact_id`) REFERENCES `contacts`(`id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/deals.php b/deals.php new file mode 100644 index 0000000..98e046e --- /dev/null +++ b/deals.php @@ -0,0 +1,47 @@ + + + + + + Deals - Makizto + + + + + + + + + + + + + + + + + + + +
+
+

Deals

+

This is the deals page. Content will be added soon.

+
+
+ + + + + + + \ No newline at end of file diff --git a/delete_contact.php b/delete_contact.php new file mode 100644 index 0000000..b2544e8 --- /dev/null +++ b/delete_contact.php @@ -0,0 +1,11 @@ +prepare('DELETE FROM contacts WHERE id = ?'); + $stmt->execute([$id]); +} + +header('Location: contacts.php'); +exit; diff --git a/index.php b/index.php index 7205f3d..dd91f59 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,100 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + write a script Design a tracking system for Makizto + + + + + + + + + + + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + -
- + +
+
+

Dashboard

+
+
+
+
+
+

Total Contacts

+

1,254

+
+
+ +
+
+
+
+
+
+
+
+

Open Deals

+

82

+
+
+ +
+
+
+
+
+
+
+
+

Won Deals

+

35

+
+
+ +
+
+
+
+
+
+
+
+

Total Revenue

+

$75,930

+
+
+ +
+
+
+
+
+
+
+ + + + + - + \ No newline at end of file