-
Notifications
You must be signed in to change notification settings - Fork 0
/
badges.php
41 lines (36 loc) · 1.58 KB
/
badges.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
<div id="medals_div">
<?php
$badgeCount == 0;
// mysql_select_db('medals') or die('Unable to select the database');
$querymedals = "SELECT id, name, icon, description, category FROM mdl_badges";
$resultsBadges = $DB->get_records_sql($querymedals);
$num_rows = count($resultsBadges);
//echo 'num rows: ' . $num_rows;
echo '<h3>Select Badges</h3>';
// echo '**Warning the student must have manual mtg set on the flightplan for medals to work**';
echo '<table>';
foreach ($resultsBadges as $row) {
if ($badgeCount == 0) {
echo '<tr><td>' . $row->name . ' ';
echo '</td><td><img src="' . $CFG->wwwroot . '/blocks/ilp/custom/pix/badges/' . $row->icon . '.png"/></td>';
echo '<td>';
echo '<input type="radio" name="medal" value="' . $row->id . '" />';
echo '</td>';
} else {
echo '<td width="20px"></td><td>' . $row->name . ' ';
echo '</td><td><img src="' . $CFG->wwwroot . '/blocks/ilp/custom/pix/badges/' . $row->icon . '.png"/></td>';
echo '<td>';
//<input type="checkbox" id="checkbox_medal" name="checkbox_medal[]" value="' . $row['id'] . '" />';
echo '<input type="radio" name="medal" value="' . $row->id . '" />';
echo '</td></tr>';
}
// echo 'badge count is ' . $badgeCount;
if ($badgeCount == 0) {
$badgeCount = 1;
} elseif ($badgeCount == 1) {
$badgeCount = 0;
}
}
echo '</table>';
?>
</div>