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.