示例#1
0
function game_showcheckbox($name, $value)
{
    $a = array();
    $a[0] = get_string('no');
    $a[1] = get_string('yes');
    return game_showselectcontrol($name, $a, $value);
    $ret = '<input type="checkbox" name="' . $name . '"  value="' . $value . '"';
    if ($value == 1) {
        $ret .= 'checked="checked"';
    }
    $ret .= '/>';
    return $ret;
}
function game_showcheckbox($name, $value)
{
    $a = array();
    $a[0] = get_string('no');
    $a[1] = get_string('yes');
    return game_showselectcontrol($name, $a, $value);
}
示例#3
0
echo '<td><center>' . get_string('bookquiz_chapters', 'game') . '</td>';
echo '<td><center>' . get_string('bookquiz_categories', 'game') . '</td>';
echo '<td><center>' . get_string('bookquiz_numquestions', 'game') . '</td>';
echo "</tr>\r\n";
$ids = '';
if (($recs = $DB->get_records('book_chapters', array('bookid' => $game->bookid), 'pagenum', 'id,title')) != false) {
    foreach ($recs as $rec) {
        echo '<tr>';
        echo '<td>' . $rec->title . '</td>';
        echo '<td>';
        if (array_key_exists($rec->id, $categories)) {
            $categoryid = $categories[$rec->id];
        } else {
            $categoryid = 0;
        }
        echo game_showselectcontrol('categoryid_' . $rec->id, $a, $categoryid, '');
        echo '</td>';
        echo '<td>';
        if (array_key_exists($rec->id, $numbers)) {
            echo '<center>' . $numbers[$rec->id] . '</center>';
        } else {
            echo '&nbsp;';
        }
        echo '</td>';
        echo "</tr>\r\n";
        $ids .= ',' . $rec->id;
    }
}
?>
</table>
<br>