From a2f349d8a857112b86d33705c82e4508bf56beac Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 11 Dec 2025 07:44:58 +0000 Subject: [PATCH] v5 12/11/2025 --- admin.php | 62 +++++++++++ index.php | 72 ++++++++----- login.php | 116 --------------------- logout.php | 6 -- mail/MailService.php | 11 +- order.php | 242 +++++++++++++++++++++++++++++++++++++++++++ partnership.php | 81 +++++++++++++++ 7 files changed, 442 insertions(+), 148 deletions(-) create mode 100644 admin.php delete mode 100644 login.php delete mode 100644 logout.php create mode 100644 order.php create mode 100644 partnership.php diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..5b5d9af --- /dev/null +++ b/admin.php @@ -0,0 +1,62 @@ +query('SELECT id, username, role, created_at FROM users'); +$users = $stmt->fetchAll(); + +?> + + + + + Admin + + + + + +
+

User Management

+
+ + + + + + + + + + + + + + + + + + + +
IDUsernameRoleCreated At
+
+
+ + + + diff --git a/index.php b/index.php index 38a0d02..8e35f89 100644 --- a/index.php +++ b/index.php @@ -1,12 +1,6 @@ + @@ -75,19 +89,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { @@ -98,7 +106,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {

Innovative Packaging, Perfectly Crafted

From concept to creation, we deliver custom packaging solutions that protect your products and elevate your brand.

- Request a Free Quote + Place an order
@@ -185,10 +193,26 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {

A glimpse into the customizable packaging solutions we offer. The full interactive catalog is coming soon.

-
Carton
-
Plastique
-
Print sur Carton
-
Étiquette
+ + + +
diff --git a/login.php b/login.php deleted file mode 100644 index 235eb80..0000000 --- a/login.php +++ /dev/null @@ -1,116 +0,0 @@ -prepare("SELECT * FROM users WHERE username = ?"); - $stmt->execute([$username]); - $user = $stmt->fetch(); - - if ($user && password_verify($password, $user['password_hash'])) { - $_SESSION['user_id'] = $user['id']; - $_SESSION['username'] = $user['username']; - $_SESSION['role'] = $user['role']; - header("Location: index.php"); - exit; - } else { - $error = 'Invalid username or password.'; - } - } catch (PDOException $e) { - $error = "Database error: " . $e->getMessage(); - } - } -} -?> - - - - - - Login - - - - - -
-

Login

-
-
- - -
-
- - -
- - -

- -
-
- - diff --git a/logout.php b/logout.php deleted file mode 100644 index 766a593..0000000 --- a/logout.php +++ /dev/null @@ -1,6 +0,0 @@ -addCC($cc); } foreach ((array)($opts['bcc'] ?? []) as $bcc){ if (filter_var($bcc, FILTER_VALIDATE_EMAIL)) $mail->addBCC($bcc); } + // Attachments + foreach ($attachments as $attachment) { + if (isset($attachment['tmp_name']) && isset($attachment['name']) && is_uploaded_file($attachment['tmp_name'])) { + $mail->addAttachment($attachment['tmp_name'], $attachment['name']); + } + } + // Optional DKIM if (!empty($cfg['dkim_domain']) && !empty($cfg['dkim_selector']) && !empty($cfg['dkim_private_key_path'])) { $mail->DKIM_domain = $cfg['dkim_domain']; diff --git a/order.php b/order.php new file mode 100644 index 0000000..37cd9c0 --- /dev/null +++ b/order.php @@ -0,0 +1,242 @@ +New Order Details:"; + $email_body .= "Product: {$product}
"; + $email_body .= "Client Name: {$client_name}
"; + $email_body .= "Phone Number: {$phone_number}
"; + $email_body .= "Delivery Address: {$delivery_address}
"; + $email_body .= "

📦 Carton Order Details

"; + $email_body .= "Model: {$model}
"; + $email_body .= "Dimensions (cm): {$dimensions}
"; + $email_body .= "Thickness: {$thickness}
"; + $email_body .= "Quantity: {$quantity}
"; + $email_body .= "

🗒 Notes

"; + $email_body .= "

" . ($notes ?: 'N/A') . "

"; + $email_body .= "📅 Delivery Preferred Date: {$delivery_date}
"; + + $text_body = "New Order Details:\n\n"; + $text_body .= "Product: {$product}\n"; + $text_body .= "Client Name: {$client_name}\n"; + $text_body .= "Phone Number: {$phone_number}\n"; + $text_body .= "Delivery Address: {$delivery_address}\n"; + $text_body .= "--- Carton Order Details ---\n"; + $text_body .= "Model: {$model}\n"; + $text_body .= "Dimensions (cm): {$dimensions}\n"; + $text_body .= "Thickness: {$thickness}\n"; + $text_body .= "Quantity: {$quantity}\n"; + $text_body .= "--- Notes ---\n"; + $text_body .= ($notes ?: 'N/A') . "\n"; + $text_body .= "Delivery Preferred Date: {$delivery_date}\n"; + + if (isset($pro_forma_email) && filter_var($pro_forma_email, FILTER_VALIDATE_EMAIL)) { + $email_body .= "

Pro-forma Invoice Request

"; + $email_body .= "

Please send a pro-forma invoice to: {$pro_forma_email}

"; + $text_body .= "\n--- Pro-forma Invoice Request ---\n"; + $text_body .= "Please send a pro-forma invoice to: {$pro_forma_email}\n"; + } + + $attachments = []; + if (isset($_FILES['design_file']) && $_FILES['design_file']['error'] == UPLOAD_ERR_OK) { + $attachments[] = $_FILES['design_file']; + } + + $result = MailService::sendMail($to, $subject, $email_body, $text_body, [], $attachments); + + if (!empty($result['success'])) { + $message_sent = true; + } else { + $error_message = "Sorry, there was an error sending your order. Please try again later."; + error_log("MailService Error: " . ($result['error'] ?? 'Unknown error')); + } + } +} +?> + + + + + + Order <?php echo $product; ?> - <?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'Packaging Solutions'); ?> + + + + + + + + + + + + + +
+
+
+
+

Order:

+
+

Fill out the form below to place your order.

+
+
+
+
+ + + + + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ 📦 Carton Order Details +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ +
+
+
+
+
+
+ + + + + + + + + diff --git a/partnership.php b/partnership.php new file mode 100644 index 0000000..213bd62 --- /dev/null +++ b/partnership.php @@ -0,0 +1,81 @@ + + + + + + + Partnership - <?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'Packaging Solutions'); ?> + + + + + + + + + + + + + + + + + + + + + + +
+
+

Partnership Opportunities

+
+
+
+

We are open to partnership offers and collaborations. Let's work together to achieve mutual success.

+

In addition to our core services, we also specialize in building custom digital solutions for your business. We can create:

+
    +
  • Custom tool websites
  • +
  • Management software (logiciel de gestion)
  • +
  • And much more!
  • +
+

Contact us to discuss your project and how we can help you build the tools you need to succeed.

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