-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
42 lines (34 loc) · 862 Bytes
/
main.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
<?php
session_set_cookie_params(0, '/', 'localhost', true, true);
session_start();
if(!isset($_SESSION['username']) && $_SESSION['Auth'] !== true || time() - $_SESSION['login_time'] > 30 * 60){
session_unset();
session_destroy();
header("Location: login");
} else {
$_SESSION['login_time'] = time();
session_regenerate_id(true);
echo "Welcome " . $_SESSION['username'] . "<br>";
$userid = $_SESSION['id'];
}
require_once("vendor/autoload.php");
use app\Connection;
use app\Dashboard;
$conn = Connection::get()->connect();
$account_detail = new Dashboard($conn, $userid);
$view = $account_detail->getDetails();
print_r($view);
?>
<table>
<?php foreach($view as $key => $value){ ?>
<tr>
<td>
<?php echo $key?>
</td>
<td>
<?php echo $value?>
</td>
</tr>
<?php } ?>
</table>
<a href="../logout">logout</a>