diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..d9ed92c --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,44 @@ +body { + background-color: #F8F9FA; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; +} + +.navbar { + border-bottom: 1px solid #dee2e6; +} + +.hero-section { + background: linear-gradient(to right, rgba(74, 144, 226, 0.1), rgba(248, 249, 250, 0.1)); + padding: 4rem 0; +} + +.card { + border-radius: 0.5rem; + border: none; + box-shadow: 0 4px 6px rgba(0,0,0,.05); +} + +.form-control { + border-radius: 0.5rem; +} + +.btn-primary { + background-color: #4A90E2; + border-color: #4A90E2; + border-radius: 0.5rem; + padding: 0.75rem 1.25rem; +} + +.btn-secondary { + background-color: #F5A623; + border-color: #F5A623; + border-radius: 0.5rem; + padding: 0.75rem 1.25rem; +} + +.toast-container { + position: fixed; + top: 1rem; + right: 1rem; + z-index: 1055; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..2b8e4f3 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,41 @@ +document.addEventListener('DOMContentLoaded', function () { + const onboardingForm = document.getElementById('vendorOnboardingForm'); + if (onboardingForm) { + onboardingForm.addEventListener('submit', function (event) { + let isValid = true; + const requiredFields = ['business_name', 'contact_name', 'email']; + + requiredFields.forEach(function(field) { + const input = document.getElementById(field); + if (!input.value) { + isValid = false; + input.classList.add('is-invalid'); + } else { + input.classList.remove('is-invalid'); + } + }); + + const emailField = document.getElementById('email'); + const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (emailField.value && !emailPattern.test(emailField.value)) { + isValid = false; + emailField.classList.add('is-invalid'); + } else if (emailField.value) { + emailField.classList.remove('is-invalid'); + } + + if (!isValid) { + event.preventDefault(); + event.stopPropagation(); + } + }); + } + + // Auto-hide toast notifications + const toastElList = [].slice.call(document.querySelectorAll('.toast')); + const toastList = toastElList.map(function (toastEl) { + const toast = new bootstrap.Toast(toastEl, { delay: 5000 }); + toast.show(); + return toast; + }); +}); diff --git a/index.php b/index.php index 7205f3d..78e9bdd 100644 --- a/index.php +++ b/index.php @@ -7,144 +7,98 @@ declare(strict_types=1); $phpVersion = PHP_VERSION; $now = date('Y-m-d H:i:s'); ?> - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + MVNOLocationBasedOffer + + + + + + + + + + + + + + + + + + + + + + + + -
-
-

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

-
-
- + + +
+
+

Find Amazing Deals Near You

+

Connecting you with the best local offers, right where you are.

+ Partner With Us +
+
+ +
+
+
+

How It Works

+
+
+
+
+

1. Discover

+

Browse offers from a wide range of local vendors.

+
+
+

2. Claim

+

Get notifications and claim deals directly from the app.

+
+
+

3. Enjoy

+

Redeem your offers in-store and enjoy the savings.

+
+
+
+ + + + + - + \ No newline at end of file diff --git a/vendor-onboarding.php b/vendor-onboarding.php new file mode 100644 index 0000000..31a7ec7 --- /dev/null +++ b/vendor-onboarding.php @@ -0,0 +1,139 @@ +exec("CREATE TABLE IF NOT EXISTS vendors (id INT AUTO_INCREMENT PRIMARY KEY, business_name VARCHAR(255) NOT NULL, contact_name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL UNIQUE, phone VARCHAR(50), status VARCHAR(50) DEFAULT 'pending_approval', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP)"); +} catch (PDOException $e) { + // In a real app, log this error. For now, we'll just ignore if it fails. +} + +if ($_SERVER["REQUEST_METHOD"] == "POST") { + $business_name = trim($_POST['business_name'] ?? ''); + $contact_name = trim($_POST['contact_name'] ?? ''); + $email = trim($_POST['email'] ?? ''); + $phone = trim($_POST['phone'] ?? ''); + + if (empty($business_name) || empty($contact_name) || !filter_var($email, FILTER_VALIDATE_EMAIL)) { + $message = "Error: Please fill all required fields with valid data."; + $message_type = 'danger'; + } else { + try { + $pdo = db(); + $stmt = $pdo->prepare("INSERT INTO vendors (business_name, contact_name, email, phone) VALUES (?, ?, ?, ?)"); + $stmt->execute([$business_name, $contact_name, $email, $phone]); + $message = "Thank you! Your application has been submitted for review."; + $message_type = 'success'; + } catch (PDOException $e) { + if ($e->errorInfo[1] == 1062) { // Duplicate entry + $message = "Error: An account with this email address already exists."; + } else { + $message = "An unexpected error occurred. Please try again later."; + } + $message_type = 'danger'; + } + } +} +?> + + + + + + Vendor Onboarding - MVNOLocationBasedOffer + + + + + + + + + + + + + + +
+ +
+ + + + +
+
+
+
+
+

Become a Partner

+

Join our network to reach more customers. Fill out the form below to get started.

+
+
+
+ + +
Please enter your business name.
+
+
+ + +
Please enter a contact name.
+
+
+ + +
Please enter a valid email address.
+
+
+ + +
+
+ +
+
+
+
+
+
+ + + + + + +