-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvisitor.php
146 lines (141 loc) · 5.91 KB
/
visitor.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
require "./header.php";
if(isset($_SESSION['userUidOfficer'])){
if(isset($_GET['error'])){
if($_GET['error']=="emptyfields"){
echo'<h2 class="mt-6 text-center text-3xl leading-9 font-extrabold text-red-600">
Empty fields!!
</h2>';
}elseif($_GET['error']=="sqlerror"){
echo'<h2 class="mt-6 text-center text-3xl leading-9 font-extrabold text-red-600">
sql database connection error!!
</h2>';
}elseif($_GET['error']=="reserror"){
echo'<h2 class="mt-6 text-center text-3xl leading-9 font-extrabold text-red-600">
IPC not updated!!
</h2>';
}
}
echo'
<form action="includes/visitor.inc.php" method="POST">
<div class="flex flex-col h-screen">
<section class="text-gray-700 body-font relative flex-grow">
<div class="container px-5 my-5 mx-auto">
<div class="flex flex-col text-center w-full mb-12">
<h1
class="sm:text-3xl text-2xl font-medium title-font mb-4 text-gray-900"
>
Visitor Registration
</h1>
<p class="lg:w-2/3 mx-auto leading-relaxed text-base">
Add a Visitor!
</p>
</div>
<div class="lg:w-1/2 md:w-2/3 mx-auto">
<div class="flex flex-wrap -m-2">
<div class="p-2 w-1/2">
<label class="block text-sm leading-5 font-medium text-gray-700">First Name</label>
<div class="mt-1 relative rounded-md shadow-sm">
<input
name="f_name"
class="w-full bg-gray-100 rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base form-input block w-full px-3 h-10"
placeholder="First Name"
/>
</div>
</div>
<div class="p-2 w-1/2">
<label class="block text-sm leading-5 font-medium text-gray-700">Last Name</label>
<div class="mt-1 relative rounded-md shadow-sm">
<input
name="l_name"
class="w-full bg-gray-100 rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base form-input block w-full px-3 h-10"
placeholder="Last Name"
/>
</div>
</div>
<div class="p-2 w-1/2">
<label class="block text-sm leading-5 font-medium text-gray-700">Aadhaar Number</label>
<div class="mt-1 relative rounded-md shadow-sm">
<input required
name="aadhaar"
class="w-full bg-gray-100 rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base form-input block w-full px-3 h-10"
placeholder="123456789012"
/>
</div>
</div>
<div class="p-2 w-1/2">
<label class="block text-sm leading-5 font-medium text-gray-700">
Date of Visit
</label>
<div class="mt-1 relative rounded-md shadow-sm">
<input
name="date_visit"
class="w-full bg-gray-100 rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base form-input block w-full px-3 h-10"
type="date"
/>
</div>
</div>
<div class="p-2 w-1/2">
<label class="block text-sm leading-5 font-medium text-gray-700">
Time Slot
</label>
<div class="mt-1 relative rounded-md shadow-sm">
<select
name="time_slot"
class="w-full bg-gray-100 rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base form-input block w-full px-3 h-10"
>
<option value="10AM-11AM">10AM-11AM</option>
<option value="12PM-1PM">12PM-1PM</option>
<option value="2PM-3PM">2PM-3PM</option>
<option value="4PM-5PM">4PM-5PM</option>
<option value="6PM-7PM">6PM-7PM</option>
</select>
</div>
</div>
<div class="p-2 w-1/2">
<label class="block text-sm leading-5 font-medium text-gray-700"
>Prisoner ID</label
>
<div class="mt-1 relative rounded-md shadow-sm">
<input
name="prisoner_id"
placeholder="Prisoner ID" class="w-full bg-gray-100 rounded border border-gray-400 focus:outline-none focus:border-indigo-500 text-base form-input block w-full px-3 h-10"
/>
</div>
</div>
<div class="p-5 w-full">
<input
name="visitor_add"
type="submit"
class="flex mx-auto text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-none hover:bg-indigo-600 rounded text-lg"
value="Submit"
>
</div>
</div>
</div>
</div>
</section>
</div>
</form>
';}else{
echo' <div class="hero bg-gray-100 py-16 h-screen">
<!-- container -->
<div class="container px-4 sm:px-8 lg:px-16 xl:px-20 mx-auto">
<!-- hero wrapper -->
<div class="hero-wrapper grid grid-cols-1 md:grid-cols-12 gap-8 items-center">
<!-- hero text -->
<div class="hero-text col-span-6">
<h1 class=" font-bold text-4xl md:text-5xl max-w-xl text-gray-900 leading-tight">Operation Failed</h1>
<hr class=" w-12 h-1 bg-indigo-500 rounded-full mt-8">
<p class="text-gray-800 text-base leading-relaxed mt-8 font-semibold">Access Denied</p>
</div>
<!-- hero image -->
<div class="hero-image col-span-6">
<img src="./failure.svg" alt="">
</div>
</div>
</div>
</div>';
}
require "./footer.php";
?>