-
Notifications
You must be signed in to change notification settings - Fork 0
/
ask.php
62 lines (57 loc) · 2.24 KB
/
ask.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
require_once('includes/header.php');
require_once('includes/navigation.php');
if (isset($_POST['mkrequest'])) {
$data = ['title'=>$_POST['title'],'department'=>$_POST['department'], 'time'=>time()];
try {
$query = "INSERT INTO `requests` (title, department, status, time)
VALUES ('{$data['title']}','{$data['department']}', 'pending','{$data['time']}')";
$stmt = $conn->prepare($query);
$stmt->execute();
}catch(PDOException $e){
echo 'Connection Error: ' . $e->getMessage();
}
$message = "<div class='alert alert-success'>Succesfully sent</div>";
}
?>
<div class="wrapper">
<h1>Ask</h1>
<p class="lead">Make your FOI Request here</p>
<div class="main">
<div class="inner">
<form method="post" action="" enctype="multipart/form-data">
<?php if (isset($_POST['requests'])): ?>
<h1><?= $_POST['requests']; ?></h1>
<input type="hidden" name="title" value="<?= $_POST['requests'] ?>">
<?php else: ?>
<label for="title">Request Title: </label><br>
<input type="text" size="50" name="title"><br><br>
<?php endif; ?>
<!-- <p class="lead"><label for="department">Select Department</label></p>
<select name="department">
<optgroup label="Ministers">Ministers</optgroup>
<option>Minister of Finance</option>
<option>Minister of Agriculture</option>
<option>Minister of Education</option>
<optgroup label="Governors">Governors</optgroup>
<option>Local Government</option>
<option>State Government</option>
<option>Federal Government</option>
</select> -->
<p><label for="file">Upload PDF or JPG copy of your submitted request:</label></p>
<input type="file" name="file">
<br><br>
<button name="mkrequest" class="btn btn-primary">Send Request</button>
</form>
<br>
<?php
if (isset($message)) {
echo $message;
}
?>
</div>
</div>
</div>
<div class="footer">
</div>
<?php require_once('includes/footer.php'); ?>