function process_students() { global $userrole; if ($userrole === "admin") { print '<b>Students</b><br /><br />'; if (isset($_GET['act'])) { if ($_POST['Edit'] === 'edit') { $st = db_students(); edit_student($st); } else { if ($_POST['Add'] === 'add') { add_student(); } else { if ($_POST['Save'] === 'save') { save_student(); } else { if ($_POST['Remove'] === 'remove') { $st = db_students(); remove_record($st); } else { if ($_POST['AddOption'] === 'add') { add_study_program_to_student_and_edit_student(); } else { if ($_POST['Remove'] === 'yes') { yes_remove(); } else { if ($_POST['Remove'] === 'no') { no_remove(); } else { foreach ($_POST as $var => $val) { if (strncmp($var, 'deletelist', 10) === 0) { delete_sp_and_edit_student($var); break; } } } } } } } } } } $stdata = db_students(); $stfd = format_student_data($stdata); show_table(array('ID', 'First name', 'Middle names', 'Last name', 'Born', 'StudentID', 'Gender', 'Citizenship', 'E-mail', 'Study programs', 'Year 1st participated'), $stfd); } else { return; } }
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)); }