Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
@ -1,114 +0,0 @@
|
|||||||
|
|
||||||
<?php
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
$success_message = '';
|
|
||||||
$error_message = '';
|
|
||||||
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
||||||
$name = trim($_POST['name']);
|
|
||||||
$email = trim($_POST['email']);
|
|
||||||
$message = trim($_POST['message']);
|
|
||||||
|
|
||||||
if (empty($name) || empty($email) || empty($message)) {
|
|
||||||
$error_message = "Please fill out all fields.";
|
|
||||||
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
|
||||||
$error_message = "Invalid email format.";
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
$sql = "INSERT INTO investigation_requests (name, email, message) VALUES (?, ?, ?)";
|
|
||||||
$stmt = $pdo->prepare($sql);
|
|
||||||
$stmt->execute([$name, $email, $message]);
|
|
||||||
$success_message = "Your request has been submitted successfully.";
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$error_message = "Error submitting request: " . $e->getMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Request an Investigation</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
color: #333333;
|
|
||||||
font-family: 'Roboto', sans-serif;
|
|
||||||
}
|
|
||||||
.navbar {
|
|
||||||
background-color: #333333;
|
|
||||||
}
|
|
||||||
.navbar-brand, .nav-link {
|
|
||||||
color: #FFFFFF !important;
|
|
||||||
}
|
|
||||||
.form-container {
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
padding: 30px;
|
|
||||||
border-radius: 10px;
|
|
||||||
margin-top: 50px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav class="navbar navbar-expand-lg">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<a class="navbar-brand" href="/">Investigation Tracker</a>
|
|
||||||
<div class="collapse navbar-collapse">
|
|
||||||
<ul class="navbar-nav ms-auto">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="request-investigation.php">Request an Investigation</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<div class="container">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="form-container">
|
|
||||||
<h2 class="text-center mb-4">Request an Investigation</h2>
|
|
||||||
<?php if ($success_message): ?>
|
|
||||||
<div class="alert alert-success"><?php echo $success_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($error_message): ?>
|
|
||||||
<div class="alert alert-danger"><?php echo $error_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<form id="request-form" method="POST" action="request-investigation.php">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="name" class="form-label">Name</label>
|
|
||||||
<input type="text" class="form-control" id="name" name="name" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="email" class="form-label">Email</label>
|
|
||||||
<input type="email" class="form-control" id="email" name="email" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="message" class="form-label">Message</label>
|
|
||||||
<textarea class="form-control" id="message" name="message" rows="5" required></textarea>
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="btn btn-primary w-100">Submit Request</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
const form = document.getElementById('request-form');
|
|
||||||
form.addEventListener('submit', function(event) {
|
|
||||||
const name = document.getElementById('name').value.trim();
|
|
||||||
const email = document.getElementById('email').value.trim();
|
|
||||||
const message = document.getElementById('message').value.trim();
|
|
||||||
|
|
||||||
if (name === '' || email === '' || message === '') {
|
|
||||||
alert('Please fill out all fields.');
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user