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AgICAmbHQ7bGFiZWwgZm9yPSZxdW90O2Rlc2NyaXB0aW9uJnF1b3Q7Jmd0O0Rlc2NyaXB0aW9uOiZsdDsvbGFiZWwmZ3Q7CiAgICAgICAgICAgICZsdDt0ZXh0YXJlYSBjbGFzcz0mcXVvdDtmb3JtLWNvbnRyb2wmcXVvdDsgaWQ9JnF1b3Q7ZGVzY3JpcHRpb24mcXVvdDsgbmFtZT0mcXVvdDtkZXNjcmlwdGlvbiZxdW90OyByb3dzPSZxdW90OzQmcXVvdDsgcmVxdWlyZWQmZ3Q7Jmx0Oy90ZXh0YXJlYSZndDsKICAgICAgICAmbHQ7L2RpdiZndDsKICAgICAgICAmbHQ7YnV0dG9uIHR5cGU9JnF1b3Q7c3VibWl0JnF1b3Q7IG5hbWU9JnF1b3Q7c3VibWl0JnF1b3Q7IGNsYXNzPSZxdW90O2J0biBidG4tcHJpbWFyeSZxdW90OyZndDtBZGQgT2ZmZW5kZXImbHQ7L2J1dHRvbiZndDsKICAgICZsdDsvZm9ybSZndDsKJmx0Oy9kaXYmZ3Q7CiZsdDtzY3JpcHQgc3JjPSZxdW90O2pzL2Jvb3RzdHJhcC5taW4uanMmcXVvdDsmZ3Q7Jmx0Oy9zY3JpcHQmZ3Q7CiZsdDsvYm9keSZndDsKJmx0Oy9odG1sJmd0OwombHQ7P3BocAovLyBJbmNsdWRlIGZvb3RlciBhbmQgb3RoZXIgbmVjZXNzYXJ5IHBhcnRzCmluY2x1ZGVfb25jZSgnaW5jbHVkZXMvZm9vdGVyLnBocCcpOwo/Jmd0Owo=
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['clientmaid']) == 0) {
header('location:logout.php');
} else {
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$age = intval($_POST['age']);
$gender = $_POST['gender'];
$crimeType = $_POST['crimeType'];
$description = $_POST['description'];
// Insert new offender into the database
$sql = "INSERT INTO tblcriminals(Name, Age, Gender, CrimeType, Description) VALUES (:name, :age, :gender, :crimeType, :description)";
$query = $dbh->prepare($sql);
$query->bindParam(':name', $name, PDO::PARAM_STR);
$query->bindParam(':age', $age, PDO::PARAM_INT);
$query->bindParam(':gender', $gender, PDO::PARAM_STR);
$query->bindParam(':crimeType', $crimeType, PDO::PARAM_STR);
$query->bindParam(':description', $description, PDO::PARAM_STR);
if ($query->execute()) {
echo '<script>alert("New offender added successfully.")</script>';
echo "<script>window.location.href='view_criminals.php'</script>";
} else {
echo '<script>alert("Error adding offender. Please try again.")</script>';
}
}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Add New Offender</title>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="container">
<h2>Add New Offender</h2>
<form method="post">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="form-group">
<label for="age">Age:</label>
<input type="number" class="form-control" id="age" name="age" required>
</div>
<div class="form-group">
<label for="gender">Gender:</label>
<select class="form-control" id="gender" name="gender" required>
<option value="">Select Gender</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</div>
<div class="form-group">
<label for="crimeType">Crime Type:</label>
<input type="text" class="form-control" id="crimeType" name="crimeType" required>
</div>
<div class="form-group">
<label for="description">Description:</label>
<textarea class="form-control" id="description" name="description" rows="4" required></textarea>
</div>
<button type="submit" name="submit" class="btn btn-primary">Add Offender</button>
</form>
</div>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<?php
// Include footer and other necessary parts
include_once('includes/footer.php');
?>