* (Resolved) Removed success message from the loop, So that it won't redirect */ $currenturl = "{$CFG->wwwroot}/local/collegestructure/assignusers.php"; if (empty($data)) { $hierarche->set_confirmation(get_string('pleaseselectschool', 'local_collegestructure'), $currenturl); } $users = array(); foreach ($data as $key => $value) { if (preg_match('/^c\d+$/', $key)) { $userid = substr($key, 1); array_push($users, $userid); } } $school->add_users($users, $data->moveto); } /* ---end of the user assigning to schools--- */ /* ---Prepare the standard URL params for this page. We'll need them later--- */ $urlparams = array('id' => $schoolids); if ($page) { $urlparams['page'] = $page; } if ($perpage) { $urlparams['perpage'] = $perpage; } echo $OUTPUT->heading(get_string('manageschools', 'local_collegestructure')); $currenttab = 'assignregistrar';