2014-03-04 13:08:11 +00:00
|
|
|
<?php
|
|
|
|
require "common/common.php";
|
|
|
|
|
|
|
|
auth(AUTH_PUPIL);
|
|
|
|
|
|
|
|
showHeader("Dashboard");
|
2014-03-08 15:08:56 +00:00
|
|
|
|
|
|
|
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){
|
2014-03-08 15:08:56 +00:00
|
|
|
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>
|
2014-03-08 15:08:56 +00:00
|
|
|
<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
|
2014-03-08 15:08:56 +00:00
|
|
|
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>
|