-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
76 lines (61 loc) · 2.04 KB
/
profile.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
<?php
require 'includes/dbh.inc.php';
session_start();
if(isset( $_SESSION['userId'])){
$id = $_SESSION['userId'];
$sql = "SELECT * FROM data WHERE ref = $id";
$result = mysqli_query($conn,$sql);
if($result){
$result_check = mysqli_num_rows($result);
}
$time = time();
$flag = 0;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="profile_style.css"/>
<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Raleway:400,600,700"
rel="stylesheet"
/>
<title>Disappr</title>
</head>
<body>
<div class="header">
<a href="index.php" class="logo"><img src="logo/disappr.png" alt="logo" class="logo_icon"></a>
<div class="nav">
<a href="index.php" class="home">Home</a>
<a href="./includes/logout.inc.php" class="logout_btn logout_button">Logout</a>
</div>
</div>
<div class="boxes">
<?php
if(isset( $_SESSION['userId'])){
if($result_check > 0){
while($rows = mysqli_fetch_assoc($result)){
$n_time = floor(($time-$rows['added_time'])/(60*60));
$time_diff = 24-$n_time;
if(!($n_time > 24)){
echo '<form action ="scripts/redirect.php" method="POST"><div class="box"><div class="title">'.$rows['title'].'</div><div class="bottom"><div class="open"><a href='.$rows['link'].'>open</a></div><div class="time">Time Remaining = '.$time_diff.' hrs</div></div></div></form>';
$flag++;
}
}
}
if($flag == 0){
echo '<h1 class="no_active">There are no Active Messages</h1>';
}
}
?>
</div>
</body>
</html>