-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport.php
69 lines (69 loc) · 3.14 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
<?php
session_start();
include "functions/database.php";
@$loggedId = $_SESSION['id'];
@$loggedType = $_SESSION['type'];
if (!isset($_SESSION['user']) && !isset($_SESSION['type'])&& !isset($_SESSION['id'])){
header("location: login.php");
exit;
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/report.css">
<title>DatosAnalyticos | Report</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
</head>
<body>
<nav class="nav">
<div class="container">
<h2 style="margin: 6px 0 10px 0; float: left;">DatosAnalyticos</h2>
<a href="functions/lslfunction.php?logout" type="submit" id="logout"><i class="fas fa-sign-out-alt" ></i>Logout</a>
</div>
</nav>
<!--Content-->
<div class="container">
<div class="row">
<div class="colOne">
<ul>
<li><a href="index.php" class="link" ><i class="fas fa-home fa-lg" style="color: #a5a2a2;"></i> Home</a></li>
<li><a href="updates.php" class="link"><i class="fas fa-edit fa-lg" style="color: #a5a2a2;"></i> Updates</a></li>
<?php
if ($loggedType > 0){
echo ' <li><a href="adminpost.php" class="link"><i class="fas fa-pen-alt fa-lg" style="color: #a5a2a2;"></i> Post</a></li>';
echo ' <li><a href="sent_reports.php" class="link"><i class="fas fa-envelope-open" style="color: #a5a2a2;"></i> View reports</a></li>';
} else{
echo '<li class="active"><a href="report.php" class="link"> <i class="fas fa-file fa-lg" ></i> Report</a></li>';
}
?>
<li><a href="#" class="link"><i class="fas fa-phone fa-lg" style="color: #a5a2a2;"></i> Contact us</a></li>
</ul>
<a href="sendreport.php" class="createReport">Create a report?</a>
</div>
<div>
<?php
$sql = "SELECT report.*,users.username FROM report,users WHERE report.user_id = '$loggedId' AND report.user_id = users.id ORDER BY id DESC";
$query = mysqli_query($connect,$sql);
$posts = array();
while ($row = mysqli_fetch_array($query)){
array_push($posts,$row);
}
mysqli_free_result($query);
foreach ($posts as $p){
echo "<div class='colTwo'>";
echo " <a href='viewreport_user.php?rpid=".$p['id']."' style='text-decoration-line:none; color: black; font-size: 22px;'><strong style='color:indianred;'>[Report] </strong>".$p['title']."</a><br>";
echo "<small>".$p['username']." | ".$p['send_at']." </small>";
echo "</div>";
}
?>
</div>
</div>
</div>
<script src="js/smooth-scroll.js"></script>
</body>
</html>