コード例 #1
0
ファイル: bolt_admin.php プロジェクト: Turante/boincweb
    page_head("Create Bolt database");
    $db_name = $db->db_name;
    echo "\n\t\tThe database tables for Bolt don't seem to exist.\n\t\tTo create them, go to ~/boinc/db and type\n\t\t<pre>\nmysql {$db_name} < bolt_schema.sql\n</pre>\n\tThen <a href=bolt_admin.php>reload this page</a>.\n\t";
    page_tail();
    exit;
}
BoltUser::lookup($user);
$course_id = get_int('course_id', true);
if ($course_id) {
    $course = BoltCourse::lookup_id($course_id);
}
$action = get_str('action', true);
switch ($action) {
    case 'add_course_form':
        admin_page_head("Add course");
        add_course_form();
        admin_page_tail();
        break;
    case 'add_course':
        $short_name = BoltDb::escape_string(get_str('short_name'));
        $name = BoltDb::escape_string(get_str('course_name'));
        $description = BoltDb::escape_string(get_str('description'));
        $now = time();
        BoltCourse::insert("(create_time, short_name, name, description) values ({$now}, '{$short_name}', '{$name}', '{$description}')");
        Header('Location: bolt_admin.php');
        break;
    case 'update_user_form':
        admin_page_head("Bolt user settings");
        user_settings();
        admin_page_tail();
        break;
コード例 #2
0
ファイル: index.php プロジェクト: reidHoruff/dbproj
 function render_body()
 {
     add_eraider_form();
     add_instructor_form();
     link_business_admin_form();
     add_course_form();
     add_section_form();
     add_text_book_form();
     add_ta_form();
     add_teacher_to_section();
     add_ta_to_section();
 }