-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlog.php
208 lines (194 loc) · 7.62 KB
/
log.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
<!DOCTYPE html>
<html>
<head>
<title>LostFound · VIPS</title>
<link rel="shortcut icon" href="imgs/favicon.png">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="icon" href="imgs/favicon.PNG">
<link rel="stylesheet" type="text/css" href="css/style.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="LostFound @ VIPS">
<meta property="og:title" content="LostFound - VIPS" />
<meta property="og:description" content="An portal to find lost/found stuff built by ACE members at VIPS." />
</head>
<body>
<header>
<div id="wrap">
<img src="imgs/logo.jpg" width="170px">
</div>
</header>
<div id="wrap">
<div id="content">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<center>
<thead>
<tr>
<td>Item</td>
<td>Details</td>
<td>Specification</td>
<td>Report</td>
<td>Image</td>
</tr>
</thead>
<?php
include('controllers/config.php');
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $host, $password);
$sql = "SELECT * FROM items order by id desc";
$query = $conn->prepare($sql);
$query->execute();
$final = $query->fetchAll();
foreach ($final as $row) {
$id = $row['id'];
$x = $row['x'];
$y = $row['y'];
$item = $row['item'];
$desc = $row['desc'];
$time = $row['time'];
$item_type = $row['item_type'];
$link = $row['link'];
$img = $row['img'];
echo "
<tr>
<td>".$item."</td>
<td>".$time."</td>
<td>".$desc."</td>";
if($item_type == "found") {
echo "
<td><button class='btn btn-info btn-md confirm-button' data-toggle='modal' onclick=requestItem(".$id.",1) data-remote='true' data-type='lost' data-id='331' >It's Mine</button></td>
";
}
else {
echo "
<td><button class='btn btn-danger btn-md confirm-button' data-toggle='modal' data-remote='true' onclick=requestItem(".$id.",0) data-type='lost' data-id='331' >I've found it.</button></td>
";
}
if($img == "") {
echo "
<td> <center> <span style='color:#d3d3d3; font-size:1.5em;' class='glyphicon glyphicon-camera' > </span> </center></td>
";
}
else {
echo "
<td> <center> <a href=".$img." target='_blank'> <span style='color:#000; font-size:1.5em;' class='glyphicon glyphicon-camera' > </span></a> </center></td>
";
}
echo "</tr>
";
}
}
catch(PDOException $e) {
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;
?>
</center>
</table>
<div id="map"></div>
<div class="mapAlert">
<div class="mapRel">
<div class="mapMsg">
<div class="container">
<center>
<div class="alert alert-info fade in" id="clickMSG" style="display:none;">
<a href="#" class="close" onclick="$('.alert').hide()" style="color:black;">x</a>
<strong>Great:</strong> Now point to the place, where you have lost or found this item.
</div>
<div class="alert alert-danger fade in" id="dangMSG" style="display:none;">
<a href="#" class="close" onclick="$('.alert').hide()" style="color:black;">x</a>
<strong>Oops:</strong> You can only login through ( @vips.edu ) student account.
</div>
</center>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
</footer>
<div id="ModalAlert" class="modal fade" role="dialog">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<center>
<div class="AlertHeader">
<i class="glyphicon glyphicon-bullhorn AlertIcon"></i><br>
ARE YOU SURE?
</div><br>
<div class="AlertMsg">
<p> Are you sure the item is yours or you have found it? This person will be intimated and <br> contact info of this person will be mailed to you. Your email will be saved to prevent misuse.</p>
</div>
<div>
<a href="#" class="button" data-dismiss="modal"> No </a>
<a href="#" class="button blue" id="LostFoundYes" data-dismiss="modal"> Yes </a>
</div>
</center>
</div>
</div>
</div>
</div>
<div id="LostReqModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" id="lostModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">X</button>
<h3 class="modal-title">REQUEST TO SUBMIT THE ITEM</h3>
</div>
<form action="controllers/LostReq.php" method="post">
<div class="modal-body">
<p>PHONE NUMBER</p>
<center>
<input maxlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" type="text" name="lostReqPhn" class="ModalText">
</center>
<br>
<input type="hidden" name="lostReqEmail" id="lostReqEmail" value="" class="lostEmail">
<input type="hidden" name="lostReqName" id="lostReqName" value="" class="lostName">
<input type="hidden" name="lostReqId" id="lostReqId" value="" class="lostId">
<input type="hidden" name="lostReqRoll" id="lostReqRoll" value="" class="lostRoll">
</div>
<div class="modal-footer">
<input type="submit" name="lostReqSubmit" class="ModalBut" value="SUBMIT">
</div>
</form>
</div>
</div>
</div>
<div id="FoundReqModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" id="foundModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">X</button>
<h3 class="modal-title">REQUEST FOR YOUR ITEM</h3>
</div>
<form action="controllers/FoundReq.php" method="post">
<div class="modal-body">
<p>PHONE NUMBER</p>
<center>
<input maxlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" type="text" name="foundReqPhn" class="ModalText blueTxt">
</center>
<br>
<input type="hidden" name="foundReqEmail" id="foundReqEmail" value="" class="foundEmail">
<input type="hidden" name="foundReqName" id="foundReqName" value="" class="foundName">
<input type="hidden" name="foundReqId" id="foundReqId" value="" class="foundId">
<input type="hidden" name="foundReqRoll" id="foundReqRoll" value="" class="foundRoll">
</div>
<div class="modal-footer">
<input type="submit" name="foundReqSubmit" class="ModalBut txtBlue" value="SUBMIT">
</div>
</form>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://apis.google.com/js/api:client.js"></script>
<script src="js/LostFoundLog.js"></script>
<script>LostFound();</script>
</body>
</html>