0) { $p = project_load($mysqli, $pid); $p['ethics_approved'] = 1; project_save($mysqli, $p); } form_ajax_response(0); exit(); case 'i': $pid = (int)$_POST['pid']; if($pid > 0) { $p = project_load($mysqli, $pid); $p['ethics_approved'] = 0; project_save($mysqli, $p); } form_ajax_response(0); exit(); } function l_projects_load_all($mysqli, $year) { /* Load projects first */ $q = $mysqli->query("SELECT * FROM projects WHERE year='$year' "); $projects_tmp = array(); while($p = $q->fetch_assoc()) { $p_temp = project_load($mysqli, $p['pid'], $p); $projects_tmp[$p['pid']] = $p_temp; } $projects = array(); /* Now match users to projects, copying projects * into the real return array as we find them */ $q = $mysqli->query("SELECT users.*,schools.school FROM users LEFT JOIN schools ON users.schools_id=schools.id WHERE users.year='$year' AND users.enabled = '1' AND users.new = '0' AND FIND_IN_SET('student', users.`roles`)>0 "); $users = array(); while($j = $q->fetch_assoc()) { $p_user = user_load($mysqli, -1, -1, NULL, $j); $pid = $p_user['s_pid']; if($pid == 0) { print("No project for student uid={$p_user['uid']}
"); } if(!array_key_exists($pid, $projects)) { $projects[$pid] = $projects_tmp[$pid]; $projects[$pid]['students'] = array(); $projects[$pid]['s_complete'] = true; } $projects[$pid]['students'][] = $p_user; if($p_user['s_complete'] == 0) { $projects[$pid]['s_complete'] = false; } } return $projects; } $page_id = 'c_input_ethics'; $help = '

There are two buttons that may appear: Mark as Approved and Mark as NOT Approved. The Mark as Approved button is red so you can scan through the list quickly and find all projects that are not approved for ethics but need to be. Similarly the Mark as NOT Approved button is green so you can find all the projects with ethics approval. When the green Mark as NOT Approved button is showing, it means the project has been marked as having ethics approval.'; sfiab_page_begin($u, "Input Ethics Approval", $page_id, $help); ?>

Input Ethics Approvals

Use the list below to mark projects having ethics approval. There are two buttons that may appear: Mark as Approved and Mark as NOT Approved. The Mark as Approved button is red so you can scan through the list quickly and find all projects that are not approved for ethics but need to be. Similarly the Mark as NOT Approved button is green so you can find all the projects with ethics approval. When the green Mark as NOT Approved button is showing, it means the project has been marked as having ethics approval.