-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.php
274 lines (202 loc) · 9.34 KB
/
report.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
274
<?php
session_start();
include("connection.php");
include("function.php");
$id = $_SESSION['id'];
if (!isset($_SESSION['id'])) {
header("Location:login.php");
}
$query_account_validity = "SELECT * FROM tbl_account_validity where cid = $id";
$result_account_validity = mysqli_query($con, $query_account_validity);
$data_result_account_validity = mysqli_fetch_assoc($result_account_validity);
$month = $data_result_account_validity["month"];
$url = $data_result_account_validity["timestamp_account"];
$today = date("Y-m-d");
"today" . $today;
$dt_today = new DateTime("$today");
$dt_today->format("Y M D");
$fullArray = explode(' ', $url);
$dt = strval($fullArray[0]);
$fullArray2 = explode('-', $dt);
$dt_yy = strval($fullArray2[0]);
$dt_mm = strval($fullArray2[1]);
$dt_dd = strval($fullArray2[2]);
$check_datess = "$dt_yy-$dt_mm-$dt_dd";
$dt = new DateTime("$check_datess");
$dt->format("Y M D");
$dt->modify("+5 month");
$dt->format("Y M D");
$dt_today->format("Y M D");
$dt->format("Y M D");
$k = 0;
if ($dt_today <= $dt) {
} else {
$k = 1;
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$id_f = $_POST['ID'];
?>
<script>
// alert("<?php echo $id; ?>");
</script>
<?php
$message = $_POST['message'];
if ($id_f != "") {
$query_first_time_user = "SELECT * from tbl_report where cid = $id and r_id = $id_f ";
$result_first_time_user = mysqli_query($con, $query_first_time_user);
if (mysqli_num_rows($result_first_time_user) > 0) {
?>
<script>
alert("You already Reported this ID once !!!");
</script>
<?php
} else {
$query = "INSERT into tbl_report (cid,r_id,message) values ($id,$id_f,'$message')";
mysqli_query($con, $query);
// header("Location: login.php");
?>
<script>
alert("Reported");
</script>
<?php
}
} else {
echo "please enter some validinformation";
?>
<script>
alert("<?php echo "Unknown Error"; ?>");
</script>
<?php
}
}
?>
<html>
<head>
<title>E Wed</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</head>
<body style="background-color:white">
<nav class="navbar navbar-light bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="#" style="color:blue;margin-left:20px">
<h2 style=" margin-left: 20px;">E Wed</h2>
</a>
<?php
$fetchimage = "SELECT * FROM photos where cid = $id";
$fetchimageresult = mysqli_query($con, $fetchimage);
while ($fetchimageresultdata = mysqli_fetch_assoc($fetchimageresult)) {
$user_name = "SELECT fname,lname FROM login where id = $id";
$user_name_result = mysqli_query($con, $user_name);
while ($user_name_result_data = mysqli_fetch_assoc($user_name_result)) {
?>
<h7 style="color:white">
<?php
echo $user_name_result_data['fname'];
?>
<br>
<?php
echo $user_name_result_data['lname'];
}
?>
</h7>
<?php
$name = $fetchimageresultdata["profiles"];
?>
<img src="image_upload/images/<?php echo $name; ?>" style="width: 40px;height: 40px;border-radius:25px;border:2px solid white;margin: -75% ;" alt="Error" />
<?php } ?>
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasNavbar" aria-controls="offcanvasNavbar" style="background:grey">
<span class="navbar-toggler-icon"></span>
</button>
<div style="color:blue;background:black;border:white;" class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasNavbar" aria-labelledby="offcanvasNavbarLabel">
<div class="offcanvas-header">
<h4 class="offcanvas-title" id="offcanvasNavbarLabel" Style="color: blue;">E Wed</h4>
<button style="border:1px solid white;" type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close">
<h2 style="margin-top:-15px;color:blue">
<b>x</b>
</h2>
</button>
</div>
<div class="offcanvas-body">
<?php
include("side_menu.php");
?>
</div>
</div>
</div>
</nav><br><br><br><br>
<?php
if ($k == 1) {
?>
<script>
alert("please Pay to Use !!!");
</script>
<?php
?>
</center>
<div class="container">
<br><br><br>
<div class="alert alert-primary container" style="text-align:center">
<?php echo "Please pay to use !!!"; ?>
</div>
</div>
</center>
<?php
} else {
?>
<center>
<div class="container rounded " style="box-shadow: 1px 1px 5px 5px lightblue;background-color: #e8eff4">
<div class=" col">
<?php
$user_name = "SELECT fname,lname FROM login where id = $id";
$user_name_result = mysqli_query($con, $user_name);
while ($user_name_result_data = mysqli_fetch_assoc($user_name_result)) {
$name = $user_name_result_data['fname'] . ' ' . $user_name_result_data['lname'];
?>
<form method="POST" style="text-align:start">
<br>
<div style="background-color:white;padding:0.60%;background-color: blue;border-radius:5px;">
<center>
<h3 style="color:white">Report Account</h3>
</center>
</div>
<br>
<div class="control-group">
<div class="controls">
<label for="exampleInputEmail1" class="form-label">Name :</label>
<input type="text" class="form-control" placeholder="Full Name" value="<?php echo $name ?>" id="fullname" required data-validation-required-message="Please enter your name" readonly />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<div class="controls">
<label for="exampleInputEmail1" class="form-label">Your ID :</label>
<input type="text" class="form-control" placeholder="Account ID" value="<?php echo $id ?>" id="email" required data-validation-required-message="Please enter your email" readonly />
</div>
</div><br>
<div class="control-group">
<div class="controls">
<input type="text" class="form-control" placeholder="Account ID to be reported" id="ID" name="ID" required data-validation-required-message="Please enter your name" required />
</div>
</div><br>
<div class="control-group">
<div class="controls">
<textarea rows="10" cols="100" class="form-control" placeholder="Message" id="message" name="message" required data-validation-required-message="Please enter your message" minlength="5" data-validation-minlength-message="Min 5 characters" maxlength="999" style="resize:none" required></textarea>
</div>
</div>
<?php
}
?>
<div id="success" style="text-align:center"> <br>
<input type="submit" class="btn btn-primary pull-right" value="submit" />
<input type="reset" class="btn btn-primary pull-right" value="reset" /><br><br>
</div>
</form>
</div>
</div>
</center>
<?php
}
?>
</body>
</html>