« Back to History
feature-request.php
|
20260920_164915.php
Initial Domain Snapshot
Copy Code
<?php /* ============================================= File: /feature-request.php Purpose: Public Feature Request Submission Form ============================================= */ require_once __DIR__ . '/erp/config.php'; if (!isset($pdo)) { require_once __DIR__ . '/erp/core/db.php'; } $company_id = 3; // Default company $errors = []; $success = false; $old = []; /* -------------------------------------------------- CSRF Token -------------------------------------------------- */ if (session_status() !== PHP_SESSION_ACTIVE) { session_start(); } if (empty($_SESSION['csrf_token'])) { $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); } $csrf_token = $_SESSION['csrf_token']; /* -------------------------------------------------- Handle POST -------------------------------------------------- */ if ($_SERVER['REQUEST_METHOD'] === 'POST') { // CSRF check if (!hash_equals($csrf_token, (string)($_POST['csrf_token'] ?? ''))) { $errors[] = 'Invalid request. Please refresh the page and try again.'; } else { // Sanitize inputs $old = [ 'name' => trim(strip_tags($_POST['name'] ?? '')), 'mobile' => trim(strip_tags($_POST['mobile'] ?? '')), 'email' => trim(strip_tags($_POST['email'] ?? '')), 'business_type' => trim(strip_tags($_POST['business_type'] ?? '')), 'feature_title' => trim(strip_tags($_POST['feature_title'] ?? '')), 'feature_description' => trim(strip_tags($_POST['feature_description'] ?? '')), 'priority' => trim($_POST['priority'] ?? 'medium'), ]; // Validate if ($old['name'] === '') { $errors[] = 'Your name is required.'; } if ($old['feature_title'] === '') { $errors[] = 'Feature title is required.'; } if ($old['feature_description'] === '') { $errors[] = 'Feature description is required.'; } if (!in_array($old['priority'], ['low', 'medium', 'high'], true)) { $old['priority'] = 'medium'; } if ($old['email'] !== '' && !filter_var($old['email'], FILTER_VALIDATE_EMAIL)) { $errors[] = 'Please enter a valid email address.'; } if (empty($errors)) { try { $ip = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'] ?? null; $user_agent = $_SERVER['HTTP_USER_AGENT'] ?? null; $stmt = $pdo->prepare(" INSERT INTO feature_requests (company_id, name, mobile, email, business_type, feature_title, feature_description, priority, ip_address, user_agent) VALUES (:company_id, :name, :mobile, :email, :business_type, :feature_title, :feature_description, :priority, :ip_address, :user_agent) "); $stmt->execute([ ':company_id' => $company_id, ':name' => $old['name'], ':mobile' => $old['mobile'] ?: null, ':email' => $old['email'] ?: null, ':business_type' => $old['business_type'] ?: null, ':feature_title' => $old['feature_title'], ':feature_description' => $old['feature_description'], ':priority' => $old['priority'], ':ip_address' => $ip ? substr($ip, 0, 64) : null, ':user_agent' => $user_agent ? substr($user_agent, 0, 512) : null, ]); $success = true; $old = []; // Clear form } catch (Throwable $e) { $errors[] = 'Something went wrong. Please try again later.'; } } } } function h(mixed $v): string { return htmlspecialchars((string)($v ?? ''), ENT_QUOTES, 'UTF-8'); } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Suggest a Feature | Mr. Manager ERP</title> <meta name="description" content="Submit a feature request or improvement suggestion for Mr. Manager ERP. Your feedback helps us build smarter business software."> <link rel="stylesheet" href="/erp/public/assets/css/main.css?v=20260507"> <style> :root{ --primary:#2f7d32; --primary-dark:#215c24; --secondary:#0f172a; --border:#e2e8f0; --text:#1e293b; --muted:#64748b; --white:#ffffff; --shadow:0 10px 30px rgba(0,0,0,.08); } *{ margin:0; padding:0; box-sizing:border-box; } body{ font-family:Inter,Arial,sans-serif; background:linear-gradient(160deg,#f0fdf4 0%,#f4f8f5 50%,#eef2ff 100%); min-height:100vh; color:var(--text); line-height:1.6; } a{ text-decoration:none; } .wrapper{ width:100%; max-width:1200px; margin:auto; padding:0 20px; } /* ---- Topbar ---- */ .topbar{ background:rgba(255,255,255,.9); backdrop-filter:blur(10px); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:999; } .navbar{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; gap:16px; } .brand{ display:flex; align-items:center; gap:12px; } .brand-logo{ width:44px; height:44px; border-radius:12px; background:linear-gradient(135deg,var(--primary),#43a047); display:flex; align-items:center; justify-content:center; color:#fff; font-size:18px; font-weight:800; } .brand-text h1{ font-size:20px; color:var(--secondary); margin:0; } .brand-text p{ margin:0; font-size:12px; color:var(--muted); } .nav-btn{ display:inline-flex; align-items:center; padding:10px 20px; border-radius:10px; font-weight:700; font-size:14px; transition:.2s ease; border:1px solid var(--border); background:#fff; color:var(--secondary); } .nav-btn:hover{ background:#f1f5f9; } /* ---- Page hero ---- */ .page-hero{ padding:64px 0 48px; text-align:center; position:relative; } .page-hero::before{ content:''; position:absolute; top:-60px; left:50%; transform:translateX(-50%); width:700px; height:500px; background:radial-gradient(ellipse at center,rgba(47,125,50,.10),transparent 65%); pointer-events:none; } .hero-badge{ display:inline-flex; align-items:center; gap:8px; background:#e8f5e9; border:1px solid #c8e6c9; color:var(--primary-dark); padding:8px 18px; border-radius:999px; font-size:13px; font-weight:700; margin-bottom:20px; position:relative; } .page-hero h2{ font-size:46px; color:var(--secondary); line-height:1.15; margin-bottom:16px; position:relative; } .page-hero h2 span{ color:var(--primary); } .page-hero p{ font-size:18px; color:var(--muted); max-width:640px; margin:0 auto; position:relative; } /* ---- Main layout ---- */ .fr-layout{ display:grid; grid-template-columns:1fr 380px; gap:40px; padding:0 0 80px; align-items:start; } /* ---- Form card ---- */ .form-card{ background:#fff; border-radius:24px; border:1px solid var(--border); box-shadow:0 12px 40px rgba(0,0,0,.07); padding:40px; } .form-card h3{ font-size:22px; color:var(--secondary); margin-bottom:28px; padding-bottom:16px; border-bottom:1px solid var(--border); } .form-row{ display:grid; grid-template-columns:1fr 1fr; gap:20px; } .form-group{ margin-bottom:22px; } .form-group label{ display:block; font-size:13px; font-weight:700; color:var(--text); margin-bottom:7px; text-transform:uppercase; letter-spacing:.4px; } .form-group label .req{ color:#e53e3e; margin-left:3px; } .form-control{ width:100%; padding:13px 16px; border:1.5px solid var(--border); border-radius:12px; font-size:15px; font-family:inherit; color:var(--text); background:#fff; transition:border-color .2s ease, box-shadow .2s ease; outline:none; appearance:none; } .form-control:focus{ border-color:var(--primary); box-shadow:0 0 0 3px rgba(47,125,50,.10); } .form-control.has-error{ border-color:#e53e3e; } textarea.form-control{ min-height:160px; resize:vertical; line-height:1.6; } /* ---- Priority pills ---- */ .priority-group{ display:flex; gap:10px; } .priority-pill{ flex:1; position:relative; } .priority-pill input[type="radio"]{ position:absolute; opacity:0; width:0; height:0; } .priority-pill label{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:14px 8px; border:1.5px solid var(--border); border-radius:12px; cursor:pointer; transition:.2s ease; text-align:center; font-size:13px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; } .priority-pill input:checked + label{ border-color:var(--primary); background:#f0fdf4; color:var(--primary-dark); box-shadow:0 0 0 3px rgba(47,125,50,.10); } .priority-pill label .dot{ width:10px; height:10px; border-radius:50%; display:block; } .dot-low { background:#10b981; } .dot-medium { background:#f59e0b; } .dot-high { background:#ef4444; } /* ---- Alert / Errors ---- */ .alert{ padding:16px 20px; border-radius:12px; margin-bottom:24px; font-size:14px; line-height:1.6; } .alert-error{ background:#fef2f2; border:1px solid #fca5a5; color:#991b1b; } .alert-success{ background:#f0fdf4; border:1px solid #86efac; color:#14532d; text-align:center; padding:40px 30px; } .alert-success .success-icon{ font-size:48px; display:block; margin-bottom:16px; } .alert-success h3{ font-size:22px; margin-bottom:10px; color:#14532d; } .alert-success p{ color:#166534; font-size:15px; margin-bottom:20px; } /* ---- Submit btn ---- */ .btn-submit{ width:100%; padding:16px; background:var(--primary); color:#fff; border:none; border-radius:12px; font-size:16px; font-weight:700; cursor:pointer; transition:.25s ease; box-shadow:0 8px 24px rgba(47,125,50,.22); margin-top:8px; } .btn-submit:hover{ background:var(--primary-dark); transform:translateY(-2px); box-shadow:0 14px 36px rgba(47,125,50,.28); } /* ---- Sidebar ---- */ .sidebar{ display:flex; flex-direction:column; gap:20px; } .side-card{ background:#fff; border:1px solid var(--border); border-radius:20px; padding:28px; box-shadow:var(--shadow); } .side-card h4{ font-size:16px; color:var(--secondary); margin-bottom:16px; font-weight:700; } .why-list{ list-style:none; display:flex; flex-direction:column; gap:12px; } .why-list li{ display:flex; align-items:flex-start; gap:12px; font-size:14px; color:var(--muted); line-height:1.5; } .why-list li .icon{ width:30px; height:30px; border-radius:8px; background:#e8f5e9; display:flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0; } .priority-guide{ display:flex; flex-direction:column; gap:10px; } .pg-row{ display:flex; align-items:center; gap:10px; font-size:13px; color:var(--muted); } .pg-badge{ padding:4px 10px; border-radius:6px; font-size:12px; font-weight:700; min-width:60px; text-align:center; } .pg-low { background:#d1fae5; color:#065f46; } .pg-medium { background:#fef3c7; color:#92400e; } .pg-high { background:#fee2e2; color:#991b1b; } .stats-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; } .stat-item{ text-align:center; padding:16px; background:#f8fafc; border-radius:12px; border:1px solid var(--border); } .stat-item .num{ font-size:24px; font-weight:800; color:var(--primary); display:block; } .stat-item .lbl{ font-size:12px; color:var(--muted); margin-top:2px; } /* ---- Footer ---- */ .page-footer{ background:#0f172a; color:#94a3b8; text-align:center; padding:20px; font-size:14px; } /* ---- Responsive ---- */ @media(max-width:960px){ .fr-layout{ grid-template-columns:1fr; } .sidebar{ order:-1; } .page-hero h2{ font-size:36px; } } @media(max-width:600px){ .form-row{ grid-template-columns:1fr; } .form-card{ padding:24px; } .page-hero{ padding:48px 0 36px; } .page-hero h2{ font-size:28px; } .navbar{ flex-wrap:wrap; } } </style> </head> <body> <!-- Topbar --> <header class="topbar"> <div class="wrapper navbar"> <div class="brand"> <div class="brand-logo">MM</div> <div class="brand-text"> <h1>Mr. Manager</h1> <p>Smart ERP & Business Automation</p> </div> </div> <div> <a href="/" class="nav-btn">← Back to Home</a> </div> </div> </header> <!-- Page Hero --> <section class="page-hero"> <div class="wrapper"> <div class="hero-badge">✦ Feature Requests</div> <h2>Shape the Future of <span>Mr. Manager</span></h2> <p>Submit your ideas, workflow improvements, and custom module requests. Every suggestion helps us build a smarter ERP.</p> </div> </section> <!-- Main Layout --> <div class="wrapper fr-layout"> <!-- Form --> <div> <div class="form-card"> <h3>📋 Submit Your Feature Request</h3> <?php if ($success): ?> <div class="alert alert-success"> <span class="success-icon">✅</span> <h3>Request Submitted!</h3> <p>Thank you for your feedback! Your suggestion has been submitted successfully.<br> We review all requests and use them to continuously improve Mr. Manager ERP.</p> <a href="/feature-request.php" style="display:inline-block;margin-top:8px;padding:12px 28px;background:var(--primary);color:#fff;border-radius:10px;font-weight:700;text-decoration:none;"> Submit Another Request </a> </div> <?php else: ?> <?php if (!empty($errors)): ?> <div class="alert alert-error"> <strong>Please fix the following:</strong> <ul style="margin:8px 0 0 18px;"> <?php foreach ($errors as $e): ?> <li><?= h($e) ?></li> <?php endforeach; ?> </ul> </div> <?php endif; ?> <form method="POST" action="/feature-request.php" novalidate> <input type="hidden" name="csrf_token" value="<?= h($csrf_token) ?>"> <!-- Name + Mobile --> <div class="form-row"> <div class="form-group"> <label>Your Name <span class="req">*</span></label> <input type="text" name="name" class="form-control <?= (!empty($errors) && ($old['name'] ?? '') === '') ? 'has-error' : '' ?>" value="<?= h($old['name'] ?? '') ?>" placeholder="e.g. Rajesh Sharma" maxlength="150" required > </div> <div class="form-group"> <label>Mobile Number</label> <input type="tel" name="mobile" class="form-control" value="<?= h($old['mobile'] ?? '') ?>" placeholder="e.g. 9876543210" maxlength="30" > </div> </div> <!-- Email + Business Type --> <div class="form-row"> <div class="form-group"> <label>Email Address</label> <input type="email" name="email" class="form-control" value="<?= h($old['email'] ?? '') ?>" placeholder="you@company.com" maxlength="150" > </div> <div class="form-group"> <label>Business Type</label> <input type="text" name="business_type" class="form-control" value="<?= h($old['business_type'] ?? '') ?>" placeholder="e.g. Textile, Trading, Manufacturing" maxlength="150" > </div> </div> <!-- Feature Title --> <div class="form-group"> <label>Feature Title <span class="req">*</span></label> <input type="text" name="feature_title" class="form-control <?= (!empty($errors) && ($old['feature_title'] ?? '') === '') ? 'has-error' : '' ?>" value="<?= h($old['feature_title'] ?? '') ?>" placeholder="e.g. Auto WhatsApp alert when salary is processed" maxlength="255" required > </div> <!-- Feature Description --> <div class="form-group"> <label>Feature Description <span class="req">*</span></label> <textarea name="feature_description" class="form-control <?= (!empty($errors) && ($old['feature_description'] ?? '') === '') ? 'has-error' : '' ?>" placeholder="Describe the feature in detail — what problem does it solve? What workflow does it improve? How should it work?" maxlength="5000" required ><?= h($old['feature_description'] ?? '') ?></textarea> </div> <!-- Priority --> <div class="form-group"> <label>Priority</label> <div class="priority-group"> <div class="priority-pill"> <input type="radio" name="priority" id="p-low" value="low" <?= (($old['priority'] ?? 'medium') === 'low') ? 'checked' : '' ?>> <label for="p-low"> <span class="dot dot-low"></span> Low </label> </div> <div class="priority-pill"> <input type="radio" name="priority" id="p-medium" value="medium" <?= (($old['priority'] ?? 'medium') === 'medium') ? 'checked' : '' ?>> <label for="p-medium"> <span class="dot dot-medium"></span> Medium </label> </div> <div class="priority-pill"> <input type="radio" name="priority" id="p-high" value="high" <?= (($old['priority'] ?? 'medium') === 'high') ? 'checked' : '' ?>> <label for="p-high"> <span class="dot dot-high"></span> High </label> </div> </div> </div> <button type="submit" class="btn-submit"> ✦ Submit Feature Request </button> </form> <?php endif; ?> </div> </div> <!-- Sidebar --> <aside class="sidebar"> <div class="side-card"> <h4>💡 Why Submit a Request?</h4> <ul class="why-list"> <li> <span class="icon">✅</span> <span>Every request is reviewed by our development team personally.</span> </li> <li> <span class="icon">🔄</span> <span>Features are added in upcoming ERP updates and releases.</span> </li> <li> <span class="icon">🧩</span> <span>Custom modules can be built for specific business workflows.</span> </li> <li> <span class="icon">📢</span> <span>Your feedback directly shapes the ERP roadmap and priorities.</span> </li> <li> <span class="icon">🤝</span> <span>We genuinely listen to users — no idea is too small.</span> </li> </ul> </div> <div class="side-card"> <h4>🎯 Priority Guide</h4> <div class="priority-guide"> <div class="pg-row"> <span class="pg-badge pg-high">High</span> <span>Critical for daily operations or blocking workflow.</span> </div> <div class="pg-row"> <span class="pg-badge pg-medium">Medium</span> <span>Important improvement that would add significant value.</span> </div> <div class="pg-row"> <span class="pg-badge pg-low">Low</span> <span>Nice-to-have enhancement for the future.</span> </div> </div> </div> <div class="side-card"> <h4>📊 What Can You Request?</h4> <ul class="why-list"> <li><span class="icon">🏭</span><span>Production & machine tracking modules</span></li> <li><span class="icon">💰</span><span>Payroll, salary & payment workflows</span></li> <li><span class="icon">📦</span><span>Inventory & stock management features</span></li> <li><span class="icon">📈</span><span>Reports, dashboards & analytics</span></li> <li><span class="icon">⚙️</span><span>Automation, approvals & integrations</span></li> </ul> </div> </aside> </div><!-- /fr-layout --> <footer class="page-footer"> © <?= date('Y') ?> Mr. Manager. All Rights Reserved. </footer> </body> </html>