47 lines
1012 B
PHP
Raw Normal View History

2014-03-04 13:08:11 +00:00
<?php
require "common/common.php";
auth(AUTH_PUPIL);
showHeader("Dashboard");
if ($_GET['404']==1){
?>
<div style="background:red;color:white;padding:1em;margin:0.5em;margin-bottom:1em;border-radius:2px;">
That's a 404; We could not find that page :/
</div>
<?php
}
2014-03-04 13:08:11 +00:00
?>
<h2>Dashboard</h2>
<?php
if ($current_user->isPupil()){
echo "<table id=\"testlist\">";
$ass = $current_user->tests();
foreach ($ass as $a){
echo "<tr><td>".$a->test()->title."</td><td class=\"take\"><a href=\"".burl("test/take.php?id=".$a->test()->id)."\">Take</a></td></tr>";
2014-03-04 13:08:11 +00:00
}
}else if ($current_user->isStaff()){
?>
<div class="dashbox">
<div class="dashbox_title">
Staff Panel
</div>
<div class="dashbox_content">
<ul>
<li><a href="<?php echo burl("users.php?rank=1");?>">Pupils</a></li>
<li><a href="<?php echo burl("test/?user=".$current_user->id);?>">My Tests</a></li>
2014-03-04 13:08:11 +00:00
<?php
echo "\t\t\t<li><a href=\"".burl("admin.php")."\">Admin Tools</a></li>";
2014-03-04 13:08:11 +00:00
?>
</ul>
</div>
</div>
<?php
}
?>
</table>