-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsessions.php
More file actions
37 lines (33 loc) · 801 Bytes
/
sessions.php
File metadata and controls
37 lines (33 loc) · 801 Bytes
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
<?php
require_once('checkuser.php');
require_once('connect.php');
require 'libs/Smarty.class.php';
$sessions = array();
$db = db_connect();
$stmt = $db->stmt_init();
if ($stmt->prepare("SELECT distinct id FROM session ORDER BY id asc"))
{
$stmt->execute();
$stmt->bind_result($date);
while($stmt->fetch())
{
array_push($sessions,$date);
}
$stmt->close();
}
$db->close();
$smarty = new Smarty;
//$smarty->force_compile = true;
//$smarty->debugging = true;
//$smarty->caching = true;
//$smarty->cache_lifetime = 120;
$smarty->assign('title','Sessions');
if ($_SESSION['user'] == 'admin'){
$back_link = 'admin.php';
}else{
$back_link = 'user.php';
}
$smarty->assign('back_link',$back_link);
$smarty->assign('sessions',$sessions);
$smarty->display('sessions.tpl');
?>