-
Notifications
You must be signed in to change notification settings - Fork 4
/
my_progress.php
56 lines (47 loc) · 2.29 KB
/
my_progress.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
<?php
namespace gameme;
use gameme\PHPGamification\DAO;
global $_base_path;
define('AT_INCLUDE_PATH', '../../include/');
require (AT_INCLUDE_PATH.'vitals.inc.php');
if($_REQUEST['member_id'] > 0){
$this_member =$_REQUEST['member_id'];
$_SESSION['tmp_member'] = $this_member =$_REQUEST['member_id'];
}else{
$this_member =$_SESSION['member_id'];
unset($_SESSION['tmp_member'] );
}
$sql="SELECT course_id FROM %scourse_enrollment WHERE member_id =%d";
$enrolled_courses = queryDB($sql, array(TABLE_PREFIX, $this_member));
$_custom_css = $_base_path . 'mods/gameme/module.css'; // use a custom stylesheet
//$_custom_head ='<script type="text/javascript" src="'.$_base_path .'jscripts/lib/jquery.1.10.1.min.js"></script>'."\n";
$_custom_head.='<script type="text/javascript" src="'.$_base_path .'mods/gameme/gamify.js"></script>'."\n";
$_custom_head .= '<script type="text/javascript" src="'.$_base_path.'mods/gameme/jquery/js.cookie-min.js"></script>'."\n";
require (AT_INCLUDE_PATH.'header.inc.php');
$this_path = preg_replace ('#/get.php#','',$_SERVER['DOCUMENT_ROOT'].$_base_path);
require_once($this_path.'mods/gameme/gamify.lib.php');
require_once($this_path.'mods/gameme/PHPGamification/PHPGamification.class.php');
$gamification = new PHPGamification();
$gamification->setDAO(new DAO(DB_HOST, DB_NAME, DB_USER, DB_PASSWORD));
$gamification->setUserId($_SESSION['member_id']);
?>
<div id="gamify">
<!-- <ul class="tablist" role="tablist" id="game_panel"> -->
<ul id="subnavlist" class="tablist " role="tablist">
<li id="tab1" class="tab" aria-controls="panel1" aria-selected="true" tabindex="0" role="tab" onclick="javascript:Cookies.set('activetab', 'tab1');">
<?php echo _AT('gm_badges'); ?></li>
<li id="tab2" class="tab" aria-controls="panel2" role="tab" tabindex="0" aria-selected="false" onclick="javascript:Cookies.set('activetab', 'tab2');">
<?php echo _AT('gm_levels'); ?></li>
</ul>
<div id="panel1" class="panel" aria-labelledby="tab1" role="tabpanel" aria-hidden="false">
<?php
showUserBadgesStudents($gamification);
?>
</div>
<div id="panel2" class="panel" aria-labelledby="tab2" role="tabpanel" aria-hidden="true">
<?php
showUserLevels($gamification, $_SESSION['course_id']);
?>
</div>
</div>
<?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>