| Server IP : 173.209.174.21 / Your IP : 216.73.216.89 Web Server : Apache/2.4.58 (Ubuntu) System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : nodor ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/thelittlebigshow/self-hosted/ |
Upload File : |
<?php include 'protect.php'; ?>
<?php
include 'db.php';
require_once __DIR__ . '/brand_header.php';
$message = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$first = trim($_POST['first_name'] ?? '');
$last = trim($_POST['last_name'] ?? '');
$contact = trim($_POST['contact_info'] ?? '');
if ($first !== '' && $last !== '') {
$stmt = $conn->prepare("INSERT INTO customers (first_name, last_name, contact_info) VALUES (?, ?, ?)");
$stmt->bind_param("sss", $first, $last, $contact);
$stmt->execute();
$message = 'Customer added.';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Add Customer</title>
<style>
body { font-family: Arial, sans-serif; background: #f9f9f9; padding: 30px; color: #333; }
.container { max-width: 720px; margin: auto; background: #fff; padding: 28px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); border-radius: 10px; }
label { display: block; margin-top: 16px; font-weight: bold; }
input[type="text"], textarea { width: 100%; padding: 10px; margin-top: 6px; border: 1px solid #d0d7de; border-radius: 6px; }
textarea { min-height: 90px; resize: vertical; }
.submit-btn { margin-top: 20px; background: #4CAF50; color: white; border: none; padding: 10px 18px; font-size: 16px; cursor: pointer; border-radius: 6px; }
.submit-btn:hover { background: #45a049; }
.filter-links a { margin-right: 10px; text-decoration: none; color: #1d4ed8; font-weight: 700; }
.filter-links a:hover { text-decoration: underline; }
.msg { margin: 0 0 16px; padding: 12px; border-radius: 8px; background: #ecfdf5; border: 1px solid #86efac; color: #166534; }
</style>
<?php echo appBrandStyles(); ?>
</head>
<body>
<div class="container">
<?php renderAppBrandHeader(); ?>
<h1>Add Customer</h1>
<?php if ($message): ?>
<div class="msg"><?php echo htmlspecialchars($message, ENT_QUOTES, 'UTF-8'); ?></div>
<?php endif; ?>
<h3>A-Z Customer Filter</h3>
<p class="filter-links">
<?php foreach (range('A', 'Z') as $l): ?>
<a href="index.php?letter=<?php echo $l; ?>"><?php echo $l; ?></a>
<?php endforeach; ?>
</p>
<form method="post">
<label>First Name:</label>
<input type="text" name="first_name" required>
<label>Last Name:</label>
<input type="text" name="last_name" required>
<label>Contact Info (optional):</label>
<textarea name="contact_info"></textarea>
<input class="submit-btn" type="submit" value="Add Customer">
</form>
<p style="margin-top:22px;"><a href="index.php">← Back to Dashboard</a></p>
</div>
</body>
</html>