-
Notifications
You must be signed in to change notification settings - Fork 0
/
reg-complaint.php
273 lines (255 loc) · 13.3 KB
/
reg-complaint.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<?php session_start();
$myHost = "localhost";
$myUserName = "root";
$myPassword = "";
$myDataBaseName = "bc2i";
$con = mysqli_connect("$myHost", "$myUserName", "$myPassword", "$myDataBaseName");
if( !$con )
{
include("error.html");
// die("Connection object not created: ".mysqli_error($con));
}
$username = $_SESSION['email'];
$query="SELECT * FROM `user` WHERE `email`= '$username'";
$result=mysqli_query($con,$query);
$row = mysqli_fetch_assoc($result);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Complaint | BC2I</title>
<link rel="icon" href="assets/icons/bc2i-32.png">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/reg-complaint.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
<!-- Google Icons
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> -->
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet">
<script src="assets/js/reg-complaint.js"></script>
</head>
<body>
<?php
if(!isset($_SESSION['email']))
{
header("Location:login.php");
}
?>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<img class="img-icon" src="assets/icons/bc2i-64.ico" alt="img-bc2i"> 
<a class="navbar-brand p-1" href="index.html">BC2I</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="user-index.php"><i class="fas fa-home"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php"><i class="fa fa-phone"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="modal" data-target="#exampleModalCenter"><i class="fa fa-sign-out-alt"></i></a>
</li>
<li>
<a class="nav-link" href="#"><?php echo $username;?></a>
</li>
</ul>
</div>
</div>
<div>
</div>
</nav>
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle"><i class="fa fa-lock"></i> Logout</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to logout?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a href="logout.php" class="btn btn-primary">Yes, Logout</a>
</div>
</div>
</div>
</div>
<div class="container pb-5">
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-8">
<form method="post" action="lodgecomp.php" class="shadow p-3 mb-5 bg-white rounded needs-validation" name="comp" onsubmit="return compValidate()" novalidate>
<br>
<center><img src="assets/icons/bc2i-32.png" alt="logo"><br><br>
<span class="head h3">Complaint Registration Form</span></center>
<br>
<hr>
<div>
<span style="font-size: 18px;"><strong>Complaint Details</strong></span><hr>
<div class="form-group">
<label for="subject">Subject</label>
<input type="text" class="form-control form-control-sm" name="subject" id="subject" placeholder="Mention subject here" required>
<div class="invalid-feedback">
Please add subject.
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group pt-3">
<label for="date">Date of Incident</label>
<input type="date" name="date" class="form-control form-control-sm" id="date" required>
<div class="invalid-feedback">
Please enter a valid date.
</div>
</div>
</div>
<div class="col">
<div class="form-group pt-3">
<label for="time">Time of Incident</label>
<input type="time" name="time" class="form-control form-control-sm" id="time" required>
<div class="invalid-feedback">
Please enter a valid time.
</div>
</div>
</div>
</div>
<div class="form-group pt-3">
<label for="type">Type of crime</label>
<select class="custom-select" name="type" required>
<option value="">Select anyone</option>
<option value="Hacking">Hacking</option>
<option value="Identity-theft">Identity Theft</option>
<option value="Transaction-fraud">Transaction Fraud</option>
<option value="Piracy">Piracy</option>
<option value="Other">Other</option>
</select>
<div class="invalid-feedback">Please select anyone.</div>
</div>
<div class="form-group pt-3">
<label for="complaint">Write Complaint</label>
<textarea name="complaint" id="complaint" name="complaint" cols="30" rows="5" class="form-control" placeholder="Write your detailed complaint" required></textarea>
<div class="invalid-feedback">
Please write detailed complaint.
</div>
</div>
</div>
<br>
<div>
<span style="font-size: 18px;"><strong>Personal Details</strong></span>
<hr>
<div class="form-group">
<label for="name">Complaintant Name</label>
<input type="text" id="name" class="form-control form-control-sm" value="<?php echo $row['name'];?>" required disabled>
</div>
<div class="row">
<div class="col">
<div class="form-group pt-3">
<label for="phone-number">Phone Number</label>
<input type="tel" id="phone-number" class="form-control form-control-sm" value="<?php echo $row['phone'];?>" required disabled>
<div class="invalid-feedback">
Please provide a valid Phone number.
</div>
</div>
</div>
<div class="col">
<div class="form-group pt-3">
<label for="email">Email ID</label>
<input type="email" class="form-control form-control-sm" value="<?php echo $row['email'];?>" required disabled>
<div class="invalid-feedback">
Please provide a valid email.
</div>
</div>
</div>
</div>
<div class="form-group pt-3 mb-4">
<label for="address"><strong>Address</strong></label><br>
<label for="line1">Address Line 1</label>
<input type="text" id="line1" class="form-control form-control-sm" required>
<div class="invalid-feedback">
Please enter a valid address in line 1.
</div>
<label for="line2" class="pt-3">Address Line 2</label>
<input type="text" id="line2" class="form-control form-control-sm" required>
<div class="invalid-feedback">
Please enter a valid address in line 2.
</div>
<div class="row pt-3">
<div class="col">
<label for="city">City/Town</label>
<input type="text" id="city" class="form-control form-control-sm" required>
<div class="invalid-feedback">
Please provide a valid City/Town.
</div>
</div>
<div class="col">
<label for="state">State</label>
<input type="text" id="state" class="form-control form-control-sm" required>
<div class="invalid-feedback">
Please provide a valid State.
</div>
</div>
</div>
</div>
<div class="form-group form-check pl-4 mb-3 pt-3">
<input type="checkbox" class="form-check-input" id="customCheck1" required>
<label class="form-control-label" for="customCheck1">I hereby declare that the details furnished above are true and correct to the best of my knowledge and belief and I undertake to inform <strong>BC2I</strong> of any changes therein, immediately.</label required>
<div class="invalid-feedback">
You must agree before submitting.
</div>
</div>
<div class="form-group pt-4">
<input type="submit" name="Submit" class="btn btn-primary btn-md btn-block submit" value="SUBMIT">
</div>
</div>
</form>
</div>
<div class="col-md-2">
</div>
</div>
</div>
<script>
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function() {
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
})();
</script>
<footer class="py-5 bg-dark pt-5 mt-5">
<div class="container">
<p class="m-0 text-center text-white">Copyright © BC2I 2019</p>
</div>
<!-- end of Footer container -->
</footer>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>