Heray-Was-Here
Server : LiteSpeed
System : Linux uk-fast-web1372.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User : u390967363 ( 390967363)
PHP Version : 8.2.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Directory :  /home/u390967363/domains/aibenproperties.com/public_html/app/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u390967363/domains/aibenproperties.com/public_html/app/agent-signup.php
<?php
session_start();
require 'includes/db.php';

$error = '';
$success = '';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $name = trim($_POST['name'] ?? '');
    $email = trim($_POST['email'] ?? '');
    $password = trim($_POST['password'] ?? '');
    $phone = trim($_POST['phone'] ?? '');
    $experience = trim($_POST['experience'] ?? '');
    $bio = trim($_POST['bio'] ?? '');

    if ($name && $email && $password) {
        // Check if email exists
        $stmt = $pdo->prepare("SELECT id FROM users WHERE email = ?");
        $stmt->execute([$email]);
        if ($stmt->fetch()) {
            $error = "An account with this email already exists.";
        } else {
            // Create Agent User (Pending Approval)
            // Ideally, status should be 'pending' but for now we set role as 'agent_pending' or use a status column.
            // Assuming 'agent' role but we might need an approval process.
            // Let's create as 'agent' but Log it for admin to review.
            
            $hashed_password = password_hash($password, PASSWORD_DEFAULT);
            
            // In a real system, you might set role='agent_applicant' or status='pending'
            $stmt = $pdo->prepare("INSERT INTO users (name, email, password, phone, role) VALUES (?, ?, ?, ?, 'agent')");
            
            if ($stmt->execute([$name, $email, $hashed_password, $phone])) {
                $user_id = $pdo->lastInsertId();
                
                // Store extra details (bio, experience) in a profile table if exists, or just log it for now
                // For this demo, we'll just log the application
                if (function_exists('log_action')) {
                    log_action($pdo, $user_id, 'APPLY', "New Agent Application: $name. Exp: $experience years.");
                }
                
                $success = "Application submitted successfully! Our team will review your profile.";
            } else {
                $error = "Application failed. Please try again.";
            }
        }
    } else {
        $error = "Please fill in all required fields.";
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Become an Agent | Aiben Properties</title>
    
    <!-- Bootstrap 5 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- Custom CSS -->
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/auth.css">
    <style>
        /* Agent Specific Override */
        .auth-sidebar.agent-theme {
            background-color: #1a4d2e; /* Dark Green */
            background-image: 
                radial-gradient(at 0% 0%, hsla(145, 63%, 15%, 1) 0px, transparent 50%),
                radial-gradient(at 100% 100%, hsla(145, 63%, 15%, 1) 0px, transparent 50%),
                linear-gradient(135deg, #1a4d2e 0%, #0d2b1a 100%);
        }
        .auth-features li i { color: #ffd700; /* Gold for agents */ }
    </style>
</head>
<body class="auth-page">

    <div class="auth-wrapper">
        <!-- LEFT SIDE: BRANDING & VALUE PROP -->
        <div class="auth-sidebar agent-theme">
            <div class="auth-sidebar-content">
                <div class="auth-logo">
                    <img src="https://aibenproperties.com/wp-content/uploads/2024/09/Aiben-Group-Logo.png" alt="Aiben" height="30" style="filter: brightness(0) invert(1);">
                </div>
                
                <div class="mt-5">
                    <h2 class="text-white fw-bold mb-4">Join Our Top-Tier<br>Sales Network</h2>
                    <p class="text-white-50 mb-4">Partner with Aiben Properties and access a world of opportunities in real estate.</p>
                    
                    <ul class="auth-features">
                        <li>
                            <i class="fa-solid fa-briefcase"></i>
                            <span><strong>Exclusive Inventory:</strong> Sell premium properties before they hit the market.</span>
                        </li>
                        <li>
                            <i class="fa-solid fa-percent"></i>
                            <span><strong>High Commissions:</strong> Competitive structures with transparent tracking.</span>
                        </li>
                        <li>
                            <i class="fa-solid fa-users-viewfinder"></i>
                            <span><strong>Lead Generation:</strong> Get qualified leads directly to your dashboard.</span>
                        </li>
                        <li>
                            <i class="fa-solid fa-award"></i>
                            <span><strong>Performance Rewards:</strong> Bonuses for top-performing agents.</span>
                        </li>
                    </ul>
                </div>
            </div>
            
            <div class="auth-sidebar-footer text-white-50 small mt-auto">
                &copy; <?= date('Y') ?> Aiben Properties. All rights reserved.
            </div>
        </div>

        <!-- RIGHT SIDE: SIGNUP FORM -->
        <div class="auth-main">
            <div class="auth-form-container">
                <div class="auth-header">
                    <span class="badge bg-success-subtle text-success mb-2 px-3 py-2 rounded-pill">Agent Partner Program</span>
                    <h1 class="auth-title">Apply to Join</h1>
                    <p class="auth-subtitle">Start your journey as an accredited Aiben Agent.</p>
                </div>

                <?php if ($error): ?>
                    <div class="alert alert-danger d-flex align-items-center" role="alert">
                        <i class="fa-solid fa-circle-exclamation me-2"></i>
                        <div><?= htmlspecialchars($error) ?></div>
                    </div>
                <?php endif; ?>

                <?php if ($success): ?>
                    <div class="alert alert-success d-flex align-items-center" role="alert">
                        <i class="fa-solid fa-circle-check me-2"></i>
                        <div>
                            <?= htmlspecialchars($success) ?>
                            <div class="mt-2">
                                <a href="login.php" class="btn btn-sm btn-success">Go to Login</a>
                            </div>
                        </div>
                    </div>
                <?php else: ?>

                <form method="POST" class="needs-validation" novalidate>
                    <div class="row g-3">
                        <div class="col-12">
                            <div class="form-floating">
                                <input type="text" class="form-control" id="name" name="name" placeholder="John Doe" required>
                                <label for="name">Full Name</label>
                            </div>
                        </div>
                        
                        <div class="col-12">
                            <div class="form-floating">
                                <input type="email" class="form-control" id="email" name="email" placeholder="name@example.com" required>
                                <label for="email">Email Address</label>
                            </div>
                        </div>

                        <div class="col-12">
                            <div class="form-floating">
                                <input type="tel" class="form-control" id="phone" name="phone" placeholder="+234...">
                                <label for="phone">Phone Number</label>
                            </div>
                        </div>

                         <div class="col-12">
                            <div class="form-floating">
                                <select class="form-select" id="experience" name="experience">
                                    <option value="0-1">0-1 Years</option>
                                    <option value="2-5">2-5 Years</option>
                                    <option value="5+">5+ Years</option>
                                </select>
                                <label for="experience">Real Estate Experience</label>
                            </div>
                        </div>

                        <div class="col-12">
                            <div class="form-floating position-relative">
                                <input type="password" class="form-control pe-5" id="password" name="password" placeholder="Password" required>
                                <label for="password">Create Password</label>
                                <button type="button" class="btn btn-link position-absolute top-50 end-0 translate-middle-y me-2 p-0 text-muted js-toggle-password" data-target="#password" aria-label="Show password">
                                    <i class="fa-regular fa-eye"></i>
                                </button>
                            </div>
                        </div>

                        <div class="col-12 mt-4">
                            <button type="submit" class="btn btn-auth" style="background-color: #1a4d2e;">
                                Submit Application <i class="fa-solid fa-paper-plane ms-2"></i>
                            </button>
                        </div>

                        <div class="col-12 text-center mt-3">
                            <p class="text-muted small">
                                Already an agent? <a href="login.php" class="text-decoration-none fw-bold text-success">Sign In</a>
                            </p>
                        </div>
                    </div>
                </form>
                <?php endif; ?>
            </div>
        </div>
    </div>

    <!-- Bootstrap JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
    (function () {
        function onToggle(btn) {
            var sel = btn.getAttribute('data-target');
            var input = sel ? document.querySelector(sel) : null;
            if (!input) return;
            var isPassword = (input.getAttribute('type') || '').toLowerCase() === 'password';
            input.setAttribute('type', isPassword ? 'text' : 'password');
            btn.setAttribute('aria-label', isPassword ? 'Hide password' : 'Show password');
            var icon = btn.querySelector('i');
            if (icon) {
                icon.classList.remove('fa-eye', 'fa-eye-slash');
                icon.classList.add(isPassword ? 'fa-eye-slash' : 'fa-eye');
            }
        }
        document.querySelectorAll('.js-toggle-password').forEach(function (btn) {
            btn.addEventListener('click', function () { onToggle(btn); });
        });
    })();
    </script>
</body>
</html>

Hry