Пример #1
0
function process_credits()
{
    print '<b>Travel courses</b><br /><br />';
    $tcdata = NULL;
    if (isset($_GET['act'])) {
        if (strcmp($_POST['Edit'], 'edit') === 0) {
            $tcdata = db_travel_courses();
            edit_travel_course($tcdata);
        } else {
            if (strcmp($_POST['Add'], 'add') === 0) {
                add_travel_course();
            } else {
                if (strcmp($_POST['Save'], 'save') === 0) {
                    save_travel_course();
                } else {
                    if (strcmp($_POST['Remove'], 'remove') === 0) {
                        $tcdata = db_travel_courses();
                        remove_record($tcdata);
                    } else {
                        if (strcmp($_POST['Remove'], 'yes') === 0) {
                            yes_remove_travel_courses();
                        }
                    }
                }
            }
        }
    }
    if ($tcdata == NULL) {
        $tcdata = db_travel_courses();
    }
    $tcf = format_travel_courses($tcdata);
    show_table(array('ID', 'Associated travel', 'Foreign course code', 'Foreign course name', 'Credits', 'Grade', 'Course type', 'FMFI course'), $tcf);
}
Пример #2
0
function process_foreign_credits()
{
    global $userrole;
    if ($userrole === "admin") {
        print '<b>Travel foreign courses</b><br /><br />';
        $filter_exchange = retrieve_filter_exchange();
        show_exchange_filter($filter_exchange);
        $tcdata = NULL;
        if (isset($_GET['act'])) {
            if ($_POST['Edit'] === 'edit') {
                $tcdata = db_foreign_courses_for_an_exchange($filter_exchange, TRUE);
                edit_travel_course($tcdata);
            } else {
                if ($_POST['Add'] === 'add') {
                    add_travel_course($filter_exchange);
                } else {
                    if ($_POST['Save'] === 'save') {
                        save_travel_course($filter_exchange);
                    } else {
                        if ($_POST['Remove'] === 'remove') {
                            $tcdata = db_foreign_courses_for_an_exchange($filter_exchange, TRUE);
                            remove_record($tcdata);
                        } else {
                            if ($_POST['Remove'] === 'yes') {
                                yes_remove_travel_courses();
                            }
                        }
                    }
                }
            }
        }
        logmsg("retr");
        if ($tcdata == NULL) {
            $tcdata = db_foreign_courses_for_an_exchange($filter_exchange, TRUE);
        }
        logmsg("ieve");
        $tcf = format_travel_foreign_courses($tcdata);
        show_table(array('ID', 'Foreign course code', 'Foreign course name', 'Credits', 'Grade', 'Course type'), $tcf);
    } else {
        return;
    }
}