Beispiel #1
0
function process_study_programs()
{
    global $userrole;
    if ($userrole === "admin") {
        print '<b>Study Programs</b><br /><br />';
        if (isset($_GET['act'])) {
            if ($_POST['Edit'] === 'edit') {
                $sp = db_study_programs();
                edit_study_program($sp);
            } else {
                if ($_POST['Add'] === 'add') {
                    add_study_program();
                } else {
                    if ($_POST['Save'] === 'save') {
                        save_study_program();
                    } else {
                        if ($_POST['Remove'] === 'remove') {
                            $sp = db_study_programs();
                            remove_record($sp);
                        } else {
                            if ($_POST['Remove'] === 'yes') {
                                yes_remove_study_program();
                            }
                        }
                    }
                }
            }
        }
        $spdata = db_study_programs();
        show_table(array('ID', 'Study program CODE', 'Study program NAME'), $spdata);
    } else {
        return;
    }
}
Beispiel #2
0
function addedit_travel($tv)
{
    $column_labels = array('ID', 'Level', 'Agreement', 'Date FROM (Y-m-d)', 'Date TO (Y-m-d)', 'Student', 'Study program', 'Semester', 'Language:', 'Has level', 'Expected level', 'Soc.stip.', 'Handicap', 'Files', 'Courses', 'Notes', 'Cancelled', 'Year');
    $column_types = array('RDONLY', '*', '*', 'date', 'date', '*', '*', '*', '*', 'text', 'text', 'checkbox', 'checkbox', 'files', 'RDONLY', '100text', 'checkbox', '*');
    $aggr = db_retrieve_agreements_data(TRUE);
    $stds = db_students(TRUE);
    $sps = db_study_programs(TRUE);
    $langs = db_languages();
    //$cors = db_courses_for_an_exchange($tv[0]);
    $levels = array(array(1, "Bachelor"), array(2, "Master"), array(3, "Doctoral"));
    $years = selection_of_years();
    show_edit_form($column_labels, $tv, $column_types, array($levels, $aggr, $stds, $sps, array(array('W', 'winter'), array('S', 'summer')), $langs, $years));
}
Beispiel #3
0
function addedit_student($st)
{
    $column_labels = array('ID', 'First name', 'Middle names', 'Last name', 'Born', 'Student ID', 'Gender', 'Citizenship', 'E-mail', 'Study programs', 'Year 1st participated');
    $column_types = array('RDONLY', 'text', 'text', 'text', 'date', 'text', '*', '*', 'text', '+', '*');
    $studprogs = db_study_programs(TRUE);
    $cntries = db_countries();
    $years = selection_of_years();
    show_edit_form($column_labels, $st, $column_types, array(array(array('M', 'male'), array('F', 'female')), $cntries, $studprogs, $years));
}