$PAGE->set_context($systemcontext); $PAGE->set_pagelayout('admin'); //$PAGE->set_heading ( $course->fullname ); $PAGE->navbar->add(get_string('confirmusers', 'enrol_apply')); $PAGE->set_title("{$site->shortname}: " . get_string('confirmusers', 'enrol_apply')); if (isset($_POST['enrolid'])) { if ($_POST['enrolid']) { if ($_POST['type'] == 'confirm') { confirmEnrolment($_POST['enrolid']); } elseif ($_POST['type'] == 'cancel') { cancelEnrolment($_POST['enrolid']); } redirect("{$CFG->wwwroot}/enrol/apply/manage.php"); } } $enrols = getAllEnrolment(); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('confirmusers', 'enrol_apply')); echo '<form id="frmenrol" method="post" action="manage.php">'; echo '<input type="hidden" id="type" name="type" value="confirm">'; echo '<table class="generalbox editcourse boxaligncenter"><tr class="header">'; echo '<th class="header" scope="col"> </th>'; echo '<th class="header" scope="col">' . get_string('coursename', 'enrol_apply') . '</th>'; echo '<th class="header" scope="col">' . get_string('applyuser', 'enrol_apply') . '</th>'; echo '<th class="header" scope="col">' . get_string('applyusermail', 'enrol_apply') . '</th>'; echo '<th class="header" scope="col">' . get_string('applydate', 'enrol_apply') . '</th>'; echo '</tr>'; foreach ($enrols as $enrol) { echo '<tr><td><input type="checkbox" name="enrolid[]" value="' . $enrol->id . '"></td>'; echo '<td>' . format_string($enrol->course) . '</td>'; echo '<td>' . $enrol->firstname . ' ' . $enrol->lastname . '</td>';
$PAGE->navbar->add ( get_string ( 'confirmusers', 'enrol_apply' ) ); $PAGE->set_title ( "$site->shortname: " . get_string ( 'confirmusers', 'enrol_apply' ) ); if (isset ( $_POST ['enrolid'] )) { if ($_POST ['enrolid']) { if ($_POST ['type'] == 'confirm') { confirmEnrolment ( $_POST ['enrolid'] ); } elseif ($_POST ['type'] == 'cancel') { cancelEnrolment ( $_POST ['enrolid'] ); } redirect ( "$CFG->wwwroot/enrol/apply/apply.php?id=" . $id . "&enrolid=" . $_GET ['enrolid'] ); } } $enrol_users = getAllEnrolment ($id,$enrolid); //print_object($enrol_users); //$enrol_users=array(); //foreach ( $enrols as $enrol ) { //if(is_supervisor_dashboard()){ // if($DB->record_exists_sql("SELECT * FROM {local_userdata} where supervisorid=$USER->id and userid=$enrol->userid")){ // $enrol_users[]=$enrol; // } //}elseif(is_siteadmin()){ // if($DB->record_exists_sql("SELECT * FROM {local_userdata} where userid=$enrol->userid and lms_category=''")){ // $enrol_users[]=$enrol; // } //}elseif(is_ast_nh()){ // if($DB->record_exists_sql("SELECT * FROM {local_userdata} where userid=$enrol->userid and lms_category!=''")){ // $enrol_users[]=$enrol;
//$PAGE->set_context($systemcontext); $PAGE->set_pagelayout('admin'); $PAGE->set_heading($course->fullname); $PAGE->navbar->add(get_string('confirmusers', 'enrol_apply')); $PAGE->set_title("{$site->shortname}: " . get_string('confirmusers', 'enrol_apply')); if (isset($_POST['enrolid'])) { if ($_POST['enrolid']) { if ($_POST['type'] == 'confirm') { confirmEnrolment($_POST['enrolid']); } elseif ($_POST['type'] == 'cancel') { cancelEnrolment($_POST['enrolid']); } redirect("{$CFG->wwwroot}/enrol/apply/apply.php?id=" . $id . "&enrolid=" . $_GET['enrolid']); } } $enrols = getAllEnrolment($id); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('confirmusers', 'enrol_apply')); echo '<form id="frmenrol" method="post" action="apply.php?id=' . $id . '&enrolid=' . $_GET['enrolid'] . '">'; echo '<input type="hidden" id="type" name="type" value="confirm">'; echo '<table class="generalbox editcourse boxaligncenter"><tr class="header">'; echo '<th class="header" scope="col"> </th>'; echo '<th class="header" scope="col">' . get_string('coursename', 'enrol_apply') . '</th>'; echo '<th class="header" scope="col"> </th>'; echo '<th class="header" scope="col">' . get_string('applyuser', 'enrol_apply') . '</th>'; echo '<th class="header" scope="col">' . get_string('applyusermail', 'enrol_apply') . '</th>'; echo '<th class="header" scope="col">' . get_string('applydate', 'enrol_apply') . '</th>'; echo '</tr>'; foreach ($enrols as $enrol) { $picture = get_user_picture($enrol->userid); echo '<tr><td><input type="checkbox" name="enrolid[]" value="' . $enrol->id . '"></td>';