Example #1
0
function process_universities()
{
    global $userrole;
    if ($userrole === "admin") {
        print '<b>Universities</b><br /><br />';
        if (isset($_GET['act'])) {
            if ($_POST['Edit'] === 'edit') {
                $uni = db_universities_without_countries();
                edit_university($uni);
            } else {
                if ($_POST['Add'] === 'add') {
                    add_university();
                } else {
                    if ($_POST['Save'] === 'save') {
                        save_university();
                    } else {
                        if ($_POST['Remove'] === 'remove') {
                            $uni = db_universities_with_countries();
                            remove_record($uni);
                        } else {
                            if ($_POST['Remove'] === 'yes') {
                                yes_remove_university();
                            }
                        }
                    }
                }
            }
        }
        $unidata = db_universities_with_countries();
        show_table(array('ID', 'University name (country)', 'Erasmus code'), $unidata);
    } else {
        return;
    }
}
Example #2
0
function add_agreement()
{
    $unis = db_universities_with_countries();
    $said = db_get_first_subject_area();
    $newid = db_save_agreement('-', $unis[0][0], '2014/2015', '2020/2021', $said, 'enter coordinator name', 0, 0, 0, 0);
    $aggr = db_retrieve_agreement_byID($newid);
    addedit_agreement($aggr);
}