<div class='form-group'> <label for='coursepassword' class='col-sm-2 control-label'>$langOptPassword:</label> <div class='col-sm-10'> <input class='form-control' id='coursepassword' type='text' name='password' value='".@q($password)."' autocomplete='off'> </div> </div> <div class='form-group'> <div class='col-sm-10 col-sm-offset-2'> <input class='btn btn-primary' type='submit' name='create_course' value='".q($langCourseCreate)."'> <a href='{$urlServer}main/portfolio.php' class='btn btn-default'>$langCancel</a> </div> </div> </div> <div class='text-right'><small>$langFieldsOptionalNote</small></div> </fieldset> ". generate_csrf_token_form_field() ." </form> </div>"; } else { // create the course and the course database // validation in case it skipped JS validation if (!isset($_POST['token']) || !validate_csrf_token($_POST['token'])) csrf_token_error(); $validationFailed = false; if (count($departments) < 1 || empty($departments[0])) { Session::Messages($langEmptyAddNode); $validationFailed = true; } if (empty($title) || empty($prof_names)) { Session::Messages($langFieldsMissing); $validationFailed = true;
/** * @brief form to edit session data * @global type $tool_content * @global type $langModify * @global type $course_code * @global type $langNewBBBSessionDesc * @global type $langNewBBBSessionStart * @global type $langNewBBBSessionType * @global type $langNewBBBSessionPublic * @global type $langNewBBBSessionPrivate * @global type $langNewBBBSessionStatus * @global type $langNewBBBSessionActive * @global type $langNewBBBSessionInActive * @global type $langBBBSessionAvailable * @global type $langBBBMinutesBefore * @global type $langBBBNotifyUsers * @global type $langBBBNotifyExternalUsers * @param type $session_id */ function edit_bbb_session($session_id) { global $tool_content, $langModify, $course_code, $course_id, $uid; global $langNewBBBSessionDesc, $langNewBBBSessionStart; global $langNewBBBSessionType, $langNewBBBSessionPublic, $langNewBBBSessionPrivate; global $langNewBBBSessionStatus, $langNewBBBSessionActive, $langNewBBBSessionInActive,$langBBBSessionAvailable,$langBBBMinutesBefore; global $langTitle, $langBBBNotifyExternalUsersHelpBlock; global $langBBBNotifyUsers,$langBBBNotifyExternalUsers; global $langAllUsers,$langParticipants,$langBBBRecord,$langBBBRecordTrue,$langBBBRecordFalse,$langBBBSessionMaxUsers; global $langBBBSessionSuggestedUsers,$langBBBSessionSuggestedUsers2; global $langBBBAlertTitle, $langBBBAlertMaxParticipants, $langJQCheckAll, $langJQUncheckAll; $row = Database::get()->querySingle("SELECT * FROM bbb_session WHERE id = ?d ", $session_id); $type = ($row->public == 1 ? 1 : 0); $status = ($row->active == 1 ? 1 : 0); $record = ($row->record == "true" ? 1 : 0); #print_r($row); $r_group = explode(",",$row->participants); $startDate_obj = DateTime::createFromFormat('Y-m-d H:i:s', $row->start_date); $start = $startDate_obj->format('d-m-Y H:i'); $textarea = rich_text_editor('desc', 4, 20, $row->description); $c = Database::get()->querySingle("SELECT COUNT(*) count FROM course_user WHERE course_id=(SELECT id FROM course WHERE code=?s)",$course_code)->count; if ($c>80) { $c = $c/2; } // If more than 80 course users, we suggest 50% of them $tool_content .= " <div class='form-wrapper'> <form class='form-horizontal' role='form' name='sessionForm' action='$_SERVER[SCRIPT_NAME]?id=" . getIndirectReference($session_id) . "' method='post'> <fieldset> <div class='form-group'> <label for='title' class='col-sm-2 control-label'>$langTitle:</label> <div class='col-sm-10'> <input class='form-control' type='text' name='title' id='title' value='".q($row->title)."'> </div> </div> <div class='form-group'> <label for='desc' class='col-sm-2 control-label'>$langNewBBBSessionDesc:</label> <div class='col-sm-10'> $textarea </div> </div> <div class='form-group'> <label for='start_session' class='col-sm-2 control-label'>$langNewBBBSessionStart:</label> <div class='col-sm-10'> <input class='form-control' type='text' name='start_session' id='start_session' value='".q($start)."'> </div> </div> <div class='form-group'> <label for='select-groups' class='col-sm-2 control-label'>$langParticipants:</label> <div class='col-sm-10'> <select name='groups[]' multiple='multiple' class='form-control' id='select-groups'>"; //select all users from this course except yourself $sql = "SELECT `group`.`id`,`group`.`name` FROM `group` RIGHT JOIN course ON group.course_id=course.id WHERE course.code=?s ORDER BY UPPER(NAME)"; $res = Database::get()->queryArray($sql, $course_code); foreach ($res as $r) { if (isset($r->id)) { $tool_content .= "<option value='_{$r->id}'"; if (in_array(("'_{$r->id}'"), $r_group)) { $tool_content .= ' selected'; } $tool_content .=">" . q($r->name) . "</option>"; } } //select all users from this course except yourself $sql = "SELECT DISTINCT u.id user_id, CONCAT(u.surname,' ', u.givenname) AS name, u.username FROM user u, course_user cu WHERE cu.course_id = ?d AND cu.user_id = u.id AND cu.status != ?d AND u.id != ?d ORDER BY UPPER(u.surname), UPPER(u.givenname)"; $res = Database::get()->queryArray($sql, $course_id, USER_GUEST, $uid); foreach ($res as $r) { if (isset($r->user_id)) { $tool_content .= "<option value='{$r->user_id}'"; if (in_array(("'{$r->user_id}'"), $r_group)) { $tool_content .= ' selected'; } $tool_content .= ">" . q($r->name) . " (".q($r->username).")</option>"; } } if (Database::get()->querySingle("SELECT count(*) count FROM bbb_servers WHERE enabled='true' AND enable_recordings='true'")->count == 0) { $recordingDisabled = ' disabled'; } else { $recordingDisabled = ''; } $tool_content .= "</select><a href='#' id='selectAll'>$langJQCheckAll</a> | <a href='#' id='removeAll'>$langJQUncheckAll</a> </div> </div> <div class='form-group'> <label for='group_button' class='col-sm-2 control-label'>$langBBBRecord:</label> <div class='col-sm-10'> <div class='radio'> <label> <input type='radio' id='user_button' name='record' value='1' " . (($record==1) ? 'checked' : '') . $recordingDisabled . "> $langBBBRecordTrue </label> </div> <div class='radio'> <label> <input type='radio' id='group_button' name='record' value='0' " . (($record==0) ? 'checked' : '')."> $langBBBRecordFalse </label> </div> </div> </div>"; // <div class='form-group'> // <label for='public_button' class='col-sm-2 control-label'>$langNewBBBSessionType:</label> // <div class='col-sm-10'> // <div class='radio'> // <label> // <input type='radio' id='private_button' name='type' value='0' ".(($type==0) ? "checked" : "")."> // $langNewBBBSessionPrivate // </label> // </div> // <div class='radio'> // <label> // <input type='radio' id='public_button' name='type' value='1' ".(($type==1) ? "checked" : "")."> // $langNewBBBSessionPublic // </label> // </div> // </div> // </div> $tool_content .= "<div class='form-group'> <label for='active_button' class='col-sm-2 control-label'>$langNewBBBSessionStatus:</label> <div class='col-sm-10'> <div class='radio'> <label> <input type='radio' id='active_button' name='status' value='1' ".(($status==1) ? "checked" : "")."> $langNewBBBSessionActive </label> </div> <div class='radio'> <label> <input type='radio' id='inactive_button' name='status' value='0' ".(($status==0) ? "checked" : "")."> $langNewBBBSessionInActive </label> </div> </div> </div> <div class='form-group'> <label for='minutes_before' class='col-sm-2 control-label'>$langBBBSessionAvailable:</label> <div class='col-sm-10'> <select class='form-control' name='minutes_before' id='minutes_before'> <option value='15' ".(($row->unlock_interval=='15') ? "selected" : "").">15</option> <option value='30' ".(($row->unlock_interval=='30') ? "selected" : "").">30</option> <option value='10' ".(($row->unlock_interval=='10') ? "selected" : "").">10</option> </select> $langBBBMinutesBefore </div> </div> <div class='form-group'> <label for='sessionUsers' class='col-sm-2 control-label'>$langBBBSessionMaxUsers:</label> <div class='col-sm-10'> <input class='form-control' type='text' name='sessionUsers' id='sessionUsers' size='5' value='".$row->sessionUsers."'> $langBBBSessionSuggestedUsers: <strong>$c</strong> ($langBBBSessionSuggestedUsers2) </div> </div> <div class='form-group'> <label for='tags_1' class='col-sm-2 control-label'>$langBBBNotifyExternalUsers:</label> <div class='col-sm-10'> <input class='form-control tags' id='tags_1' name='external_users' type='text' value='".trim($row->external_users)."'> <span class='help-block'> <i class='fa fa-share fa-rotate-270'></i> $langBBBNotifyExternalUsersHelpBlock</span> </div> </div> <div class='form-group'> <div class='col-sm-10 col-sm-offset-2'> <div class='checkbox'> <label> <input type='checkbox' name='notifyUsers' value='1'>$langBBBNotifyUsers </label> </div> </div> </div> <div class='form-group'> <div class='col-sm-10 col-sm-offset-2'> <input class='btn btn-primary' type='submit' name='update_bbb_session' value='$langModify'> </div> </div> </fieldset> ". generate_csrf_token_form_field() ." </form></div>"; $tool_content .='<script language="javaScript" type="text/javascript"> //<![CDATA[ var chkValidator = new Validator("sessionForm"); chkValidator.addValidation("title","req","'.$langBBBAlertTitle.'"); chkValidator.addValidation("sessionUsers","req","'.$langBBBAlertMaxParticipants.'"); chkValidator.addValidation("sessionUsers","numeric","'.$langBBBAlertMaxParticipants.'"); //]]></script>'; }
/** * @param string $code * @param string $title * @param string $prof * @param string $lang * @param string $type - can be null * @param int $vis * @param string $desc * @param mixed $faculty - can be null */ function course_details_form($code, $title, $prof, $lang, $type, $vis, $desc, $faculty) { global $langInfo1, $langInfo2, $langCourseCode, $langLanguage, $langTitle, $langCourseDescription, $langFaculty, $langCourseVis, $langTeacher, $langUsersWillAdd, $langOk, $langAll, $langsTeachers, $langMultiRegType, $langNone, $langOldValue, $treeObj, $langBack, $course_code; list($tree_js, $tree_html) = $treeObj->buildCourseNodePicker(); if ($type) { if (isset($GLOBALS['lang' . $type])) { $type_label = ' (' . $GLOBALS['lang' . $type] . ')'; } else { $type_label = ' (' . $type . ')'; } } else { $type_label = ''; } if (is_array($faculty)) { foreach ($faculty as $entry) { $old_faculty_names[] = q(Hierarchy::unserializeLangField($entry['name'])); } $old_faculty = implode('<br>', $old_faculty_names); } else { $old_faculty = q(Hierarchy::unserializeLangField($faculty) . $type_label); } $formAction = $_SERVER['SCRIPT_NAME']; if (isset($GLOBALS['course_code'])) { $formAction .= '?course=' . $GLOBALS['course_code']; } return action_bar(array( array('title' => $langBack, 'url' => "index.php?course=$course_code", 'icon' => 'fa-reply', 'level' => 'primary-label'))) . " <div class='alert alert-info'>$langInfo1 <br> $langInfo2</div> <div class='row'> <div class='col-md-12'> <div class='form-wrapper' > <form class='form-horizontal' role='form' action='$formAction' method='post' onsubmit='return validateNodePickerForm();' > <div class='form-group'> <label for='course_code' class='col-sm-3 control-label'>$langCourseCode:</label> <div class='col-sm-9'> <input type='text' class='form-control' id='course_code' name='course_code' value='" . q($code) . "'> </div> </div> <div class='form-group'> <label for='course_code' class='col-sm-3 control-label'>$langLanguage:</label> <div class='col-sm-9'> " . lang_select_options('course_lang') . " </div> </div> <div class='form-group'> <label for='course_title' class='col-sm-3 control-label'>$langTitle:</label> <div class='col-sm-9'> <input class='form-control' type='text' id='course_title' name='course_title' value='" . q($title) . "' /> </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langCourseDescription:</label> <div class='col-sm-9'> " . rich_text_editor('course_desc', 10, 40, purify($desc)) . " </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langFaculty:</label> <div class='col-sm-9'> " . $tree_html . "<br>$langOldValue: <i>$old_faculty</i> </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langCourseVis:</label> <div class='col-sm-9'> " . visibility_select($vis) . " </div> </div> <div class='form-group'> <label for='course_prof' class='col-sm-3 control-label'>$langTeacher:</label> <div class='col-sm-9'> <input class='form-control' type='text' id='course_prof' name='course_prof' value='" . q($prof) . "' size='50' /> </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langUsersWillAdd:</label> <div class='col-sm-9'> <input type='radio' name='add_users' value='all' id='add_users_all' checked='checked'> $langAll<br> <input type='radio' name='add_users' value='prof' id='add_users_prof'> $langsTeachers<br> <input type='radio' name='add_users' value='none' id='add_users_none'> $langNone </div> </div> <div class='form-group'> <label class='col-sm-3 control-label'>$langMultiRegType:</label> <div class='col-sm-9'> <input type='checkbox' name='create_users' value='1' id='create_users' checked='checked'> </div> </div> <div class='form-group'> <div class='col-sm-offset-3 col-sm-9'> <input class='btn btn-primary' type='submit' name='create_restored_course' value='$langOk' /> <input type='hidden' name='restoreThis' value='" . q($_POST['restoreThis']) . "' /> </div> </div> " . generate_csrf_token_form_field() . " </form> </div> </div> </div> "; }
/** * @brief dislay form for adding other activity in gradebook * @global type $tool_content * @global type $course_code * @global type $visible * @global type $langTitle * @global type $langGradebookActivityDate2 * @global type $langGradebookActivityWeight * @global type $langGradeVisible * @global type $langComments * @global type $langGradebookInsAut * @global type $langAdd * @global type $langAdd * @global type $langType * @global type $langGradebookExams * @global type $langGradebookLabs * @global type $langGradebookOral * @global type $langGradebookProgress * @global type $langGradebookOtherType * @param type $gradebook_id */ function add_gradebook_other_activity($gradebook_id) { global $tool_content, $course_code, $visible, $langTitle, $langGradebookActivityDate2, $langGradebookActivityWeight, $langGradeVisible, $langComments, $langGradebookInsAut, $langAdd, $langAdd, $langType, $langGradebookExams, $langGradebookLabs, $langGradebookOral, $langGradebookProgress, $langGradebookOtherType, $langGradebookRemainingGrade, $langSave, $head_content, $language; load_js('bootstrap-datetimepicker'); $head_content .= " <script type='text/javascript'> $(function() { $('#date').datetimepicker({ format: 'dd-mm-yyyy hh:ii', pickerPosition: 'bottom-left', language: '".$language."', autoclose: true }); }); </script>"; $weight_error = Session::getError('weight'); $date_error = Session::getError('date'); $tool_content .= " <div class='row'> <div class='col-sm-12'> <div class='form-wrapper'> <form class='form-horizontal' role='form' method='post' action='$_SERVER[SCRIPT_NAME]?course=$course_code&gradebook_id=" . getIndirectReference($gradebook_id) . "'> <fieldset>"; if (isset($_GET['modify'])) { // modify an existing gradebook activity $id = filter_var(getDirectReference($_GET['modify']), FILTER_VALIDATE_INT); //All activity data (check if it's in this gradebook) $modifyActivity = Database::get()->querySingle("SELECT * FROM gradebook_activities WHERE id = ?d AND gradebook_id = ?d", $id, $gradebook_id); if ($modifyActivity) { $titleToModify = $modifyActivity->title; $contentToModify = $modifyActivity->description; $date = Session::has('date') ? Session::get('date') : $modifyActivity->date; $module_auto_id = $modifyActivity->module_auto_id; $auto = $modifyActivity->auto; $weight = Session::has('weight') ? Session::get('title') : $modifyActivity->weight; $activity_type = $modifyActivity->activity_type; $visible = $modifyActivity->visible; } else { $activity_type = ''; } $gradebookActivityToModify = $id; } else { //new activity $gradebookActivityToModify = ""; $activity_type = ""; $date = date("Y-n-j", time()); $visible = 1; } if (!isset($contentToModify)) $contentToModify = ""; @$tool_content .= " <div class='form-group'> <label for='activity_type' class='col-sm-2 control-label'>$langType:</label> <div class='col-sm-10'> <select name='activity_type' class='form-control'> <option value='' " . typeSelected($activity_type, '') . " >-</option> <option value='4' " . typeSelected($activity_type, 4) . " >" . $langGradebookExams . "</option> <option value='2' " . typeSelected($activity_type, 2) . " >" . $langGradebookLabs . "</option> <option value='1' " . typeSelected($activity_type, 1) . " >" . $langGradebookOral . "</option> <option value='3' " . typeSelected($activity_type, 3) . " >" . $langGradebookProgress . "</option> <option value='5' " . typeSelected($activity_type, 5) . " >" . $langGradebookOtherType . "</option> </select> </div> </div> <div class='form-group'> <label for='actTitle' class='col-sm-2 control-label'>$langTitle:</label> <div class='col-sm-10'> <input type='text' class='form-control' name='actTitle' value='".q($titleToModify)."'/> </div> </div> <div class='form-group".($date_error ? " has-error" : "")."'> <label for='date' class='col-sm-2 control-label'>$langGradebookActivityDate2:</label> <div class='col-sm-10'> <input type='text' class='form-control' name='date' id='date' value='" . datetime_remove_seconds($date) . "'/> <span class='help-block'>$date_error</span> </div> </div> <div class='form-group".($weight_error ? " has-error" : "")."'> <label for='weight' class='col-sm-2 control-label'>$langGradebookActivityWeight:</label> <div class='col-sm-10'> <input type='text' class='form-control' name='weight' value='$weight' size='5'> <span class='help-block'>". ($weight_error ? $weight_error : "($langGradebookRemainingGrade: " . weightleft($gradebook_id, '') . "%)")."</span> </div> </div> <div class='form-group'> <label for='visible' class='col-sm-2 control-label'>$langGradeVisible:</label> <div class='col-sm-10'> <input type='checkbox' id='visible' name='visible' value='1'"; if ($visible == 1) { $tool_content .= " checked"; } $tool_content .= " /></div> </div> <div class='form-group'> <label for='actDesc' class='col-sm-2 control-label'>$langComments:</label> <div class='col-sm-10'> " . rich_text_editor('actDesc', 4, 20, $contentToModify) . " </div> </div>"; if (isset($module_auto_id) && $module_auto_id != 0) { //accept the auto booking mechanism $tool_content .= "<div class='form-group'> <label for='weight' class='col-sm-2 control-label'>$langGradebookInsAut:</label> <div class='col-sm-10'><input type='checkbox' value='1' name='auto' "; if ($auto) { $tool_content .= " checked"; } $tool_content .= "/></div></div>"; } $tool_content .= "<div class='form-group'> <div class='col-sm-10 col-sm-offset-2'>".form_buttons(array( array( 'text' => $langSave, 'name' => 'submitGradebookActivity', 'value'=> $langAdd ), array( 'href' => "$_SERVER[SCRIPT_NAME]?course=$course_code" ) ))."</div></div>"; if (isset($_GET['modify'])) { $tool_content .= "<input type='hidden' name='id' value='" . getIndirectReference($gradebookActivityToModify) . "'>"; } else { $tool_content .= " <input type='hidden' name='id' value='' >"; } $tool_content .= "</fieldset> ". generate_csrf_token_form_field() ." </form> </div> </div> </div>"; }
} if (!get_user_email_notification_from_courses($uid)) { $head_content .= '<script type="text/javascript">$(control_deactivate);</script>'; $tool_content .= "<div class='alert alert-info'>$langEmailUnsubscribeWarning</div> <input type='checkbox' id='unsub' name='unsub' value='1'> $langEmailFromCourses"; } $tool_content .= "<div class='alert alert-info'>$langInfoUnsubscribe</div> <div id='unsubscontrols'>"; if (isset($_REQUEST['cid'])) { // one course only $cid = intval($_REQUEST['cid']); $course_title = course_id_to_title($cid); $selected = get_user_email_notification($uid, $cid) ? 'checked' : ''; $tool_content .= "<input type='checkbox' name='c_unsub' value='1' $selected> " . q($course_title) . "<br />"; $tool_content .= "<input type='hidden' name='cid' value='" . getIndirectReference($cid) . "'>"; } else { // displays all courses foreach ($_SESSION['courses'] as $code => $status) { $title = course_code_to_title($code); $cid = course_code_to_id($code); $selected = get_user_email_notification($uid, $cid) ? 'checked' : ''; $tool_content .= "<input type='checkbox' name='c_unsub[$code]' value='1' $selected> " . q($title) . "<br />"; } } $tool_content .= "</div> <br> <input class='btn btn-primary' type='submit' name='submit' value='$langSubmit'> <a class='btn btn-default' href='display_profile.php'>$langCancel<a>"; $tool_content .= generate_csrf_token_form_field() ."</form>"; } draw($tool_content, 1, null, $head_content);
/** * @brief display attendance users * @global type $tool_content * @global type $course_id * @global type $course_code * @global type $actID * @global type $langName * @global type $langSurname * @global type $langRegistrationDateShort * @global type $langAttendanceAbsences * @global type $langAm * @global type $langAttendanceEdit * @global type $langAttendanceBooking * @global type $langID * @param type $attendance_id */ function register_user_presences($attendance_id, $actID) { global $tool_content, $course_id, $course_code, $langAttendanceAutoBook, $langName, $langSurname, $langRegistrationDateShort, $langAttendanceAbsences, $langAm, $langAttendanceBooking, $langID, $langAttendanceEdit, $langCancel; $result = Database::get()->querySingle("SELECT * FROM attendance_activities WHERE id = ?d", $actID); $act_type = $result->auto; // type of activity $tool_content .= "<div class='alert alert-info'>" . $result->title . "</div>"; //record booking if(isset($_POST['bookUsersToAct'])) { if (!isset($_POST['token']) || !validate_csrf_token($_POST['token'])) csrf_token_error(); //get all the active users $activeUsers = Database::get()->queryArray("SELECT uid as userID FROM attendance_users WHERE attendance_id = ?d", $attendance_id); if ($activeUsers){ foreach ($activeUsers as $result) { $userInp = intval(@$_POST[$result->userID]); //get the record from the teacher (input name is the user id) // //check if there is record for the user for this activity $checkForBook = Database::get()->querySingle("SELECT COUNT(id) as count, id FROM attendance_book WHERE attendance_activity_id = ?d AND uid = ?d", $actID, $result->userID); if($checkForBook->count) { //update Database::get()->query("UPDATE attendance_book SET attend = ?d WHERE id = ?d ", $userInp, $checkForBook->id); } else { //insert Database::get()->query("INSERT INTO attendance_book SET uid = ?d, attendance_activity_id = ?d, attend = ?d, comments = ?s", $result->userID, $actID, $userInp, ''); } } Session::Messages($langAttendanceEdit,"alert-success"); redirect_to_home_page("modules/attendance/index.php"); } } //display users $resultUsers = Database::get()->queryArray("SELECT attendance_users.id AS recID, attendance_users.uid AS userID, user.surname AS surname, user.givenname AS name, user.am AS am, course_user.reg_date AS reg_date FROM attendance_users, user, course_user WHERE attendance_id = ?d AND attendance_users.uid = user.id AND `user`.id = `course_user`.`user_id` AND `course_user`.`course_id` = ?d ", $attendance_id, $course_id); if ($resultUsers) { //table to display the users $tool_content .= "<div class='form-wrapper'> <form class='form-horizontal' id='user_attendances_form' method='post' action='$_SERVER[SCRIPT_NAME]?course=$course_code&attendance_id=$attendance_id&ins=" . getIndirectReference($actID) . "'> <table id='users_table{$course_id}' class='table-default custom_list_order'> <thead> <tr> <th class='text-center' width='5%'>$langID</th> <th class='text-left'>$langName $langSurname</th> <th>$langAm</th> <th class='text-center'>$langRegistrationDateShort</th> <th class='text-center'>$langAttendanceAbsences</th> </tr> </thead> <tbody>"; $cnt = 0; foreach ($resultUsers as $resultUser) { $cnt++; $tool_content .= "<tr> <td class='text-center'>$cnt</td> <td> " . display_user($resultUser->userID). "</td> <td>$resultUser->am</td> <td class='text-center'>" . nice_format($resultUser->reg_date, true, true) . "</td> <td class='text-center'><input type='checkbox' value='1' name='userspresence[$resultUser->userID]'"; //check if the user has attendace for this activity already OR if it should be automatically inserted here $q = Database::get()->querySingle("SELECT attend FROM attendance_book WHERE attendance_activity_id = ?d AND uid = ?d", $actID, $resultUser->userID); if(isset($q->attend) && $q->attend == 1) { $tool_content .= " checked"; } $tool_content .= "><input type='hidden' value='" . getIndirectReference($actID) . "' name='actID'></td>"; $tool_content .= "</tr>"; } $tool_content .= "</tbody></table>"; $tool_content .= "<div class='form-group'>"; $tool_content .= "<div class='col-xs-12'>" . form_buttons(array( array( 'text' => $langAttendanceBooking, 'name' => 'bookUsersToAct', 'value'=> $langAttendanceBooking ))). "<a href='index.php?course=$course_code&attendance_id=" . $attendance_id . "' class='btn btn-default'>$langCancel</a>"; // if ($act_type == 1) { // $tool_content .= form_buttons(array( // array( // 'text' => $langAttendanceAutoBook, // 'name' => 'updateUsersToAct', // 'value'=> $langAttendanceAutoBook // ))); // } $tool_content .= "</div></div>"; $tool_content .= generate_csrf_token_form_field() ."</form></div>"; $tool_content .= "</tbody></table>"; } }
/** * @brief display administrator search form for grantint user administrator privileges * @global type $langAdd * @global type $langAdministrator * @global type $langPowerUser * @global type $langManageUser * @global type $langAddRole * @global type $langHelpAdministrator * @global type $langHelpPowerUser * @global type $langHelpManageUser * @global type $langUserFillData * @global type $langManageDepartment * @global type $langHelpManageDepartment * @param type $message * @return string */ function printform($message) { global $langAdd, $langAdministrator, $langPowerUser, $langManageUser, $langAddRole, $langHelpAdministrator, $langHelpPowerUser, $langHelpManageUser, $langUsername, $langManageDepartment, $langHelpManageDepartment; $ret = "<div class='form-wrapper'> <form class='form-horizontal' role='form' method='post' name='makeadmin' action='$_SERVER[SCRIPT_NAME]'>"; $ret .= "<fieldset> <div class='form-group'> <label for='username' class='col-sm-2 control-label'>" . $message . "</label> <div class='col-sm-10'><input type='text' name='username' size='30' maxlength='30' placeholder='$langUsername'></div> </div> <div class='form-group'> <label class='col-sm-2 control-label'>$langAddRole</label> <div class='col-sm-10'> <div class='radio'> <input type='radio' name='adminrights' value='admin' checked>$langAdministrator<span class='help-block'><small>$langHelpAdministrator</small></span> </div> <div class='radio'> <input type='radio' name='adminrights' value='poweruser'>$langPowerUser<span class='help-block'><small>$langHelpPowerUser </small></span> </div> <div class='radio'> <input type='radio' name='adminrights' value='manageuser'>$langManageUser<span class='help-block'><small>$langHelpManageUser</small></span> </div> <div class='radio'> <input type='radio' name='adminrights' value='managedepartment'>$langManageDepartment<span class='help-block'><small>$langHelpManageDepartment</small></span> </div> </div> </label> </div> <div class='form-group'> <div class='col-sm-10 col-sm-offset-2'> <input class='btn btn-primary' type='submit' name='submit' value='$langAdd'> </div> </div> </fieldset> ". generate_csrf_token_form_field() ." </form> </div>"; return $ret; }
/** * @brief display form * @global type $from_reg * @global type $course_id * @global type $langInfoAboutRegistration * @global type $langContactMessage * @global type $langMessage * @global type $langSendMessage * @global type $course_code * @return type */ function form() { global $course_id, $langInfoAboutRegistration, $langMessage, $langSendMessage, $course_code; $ret = "<div class='alert alert-info'>$langInfoAboutRegistration</div>"; $ret .= "<div class='form-wrapper'>"; $ret .= "<form class='form-horizontal' method='post' role='form' action='$_SERVER[SCRIPT_NAME]?course=$course_code'> <fieldset> <div class='col-sm-12'><label>$langMessage</label></div> <div class='form-group'> <div class='col-sm-12'> <textarea name='content' rows='10' cols='80'></textarea> </div> </div> <div class='form-group'> <div class='col-sm-offset-1 col-sm-11'> <input class='btn btn-primary' type='submit' name='submit' value='" . q($langSendMessage) . "' /> </div> </div> ". generate_csrf_token_form_field() ." <input type='hidden' name='course_id' value='$course_id'> </fieldset></form></div>"; return $ret; }
$tool_content .= "<div class='alert alert-success'>$langAuthChangeYes</div"; draw($tool_content, 3); } } $auth_methods = get_auth_active_methods(); foreach ($auth_methods as $key => $value) { // remove current auth method if ($auth == $value or $value == 1) { // cannot change to eclass native method unset($auth_methods[$key]); } } foreach ($auth_methods as $value) { $auth_methods_active[$value] = $auth_ids[$value]; } if (isset($auth_methods_active) == 0) { $tool_content .= "<div class='alert alert-warning'>$langAuthChangeno</div>"; } else { $tool_content .= "<div class='form-wrapper'><form class='form-horizontal' role='form' name='authchange' method='post' action='$_SERVER[SCRIPT_NAME]'>"; $tool_content .= "<fieldset><div class='form-group'><label class='col-sm-2 control-label'>$langAuthChangeto:</label>"; $tool_content .= "<div class='col-sm-10'>"; $tool_content .= selection($auth_methods_active, 'auth_change', '', "class='form-control'"); $tool_content .= "</div></div>"; $tool_content .= "<input type='hidden' name='auth' value='" . intval($auth) . "'>"; $tool_content .= "<div class='col-sm-offset-2 col-sm-10'><input class='btn btn-primary' type='submit' name='submit' value='$langModify'></div>"; $tool_content .= "</fieldset>". generate_csrf_token_form_field() ." </form></div>"; } draw($tool_content, 3);
<input class="btn btn-primary" type="button" onClick="move('inactive_box','active_box')" value=" >> " /><br><br> <input class="btn btn-primary" type="button" onClick="move('active_box','inactive_box')" value=" << " /> </td> <td class="text-center"> <select class="form-control" name="toolStatActive[]" id='active_box' size='17' multiple>$toolSelection[1]</select> </td> </tr> <tr> <td colspan="3" class="text-center"> <input type="submit" class="btn btn-primary" value="$langSubmitChanges" name="toolStatus" onClick="selectAll('active_box',true)" /> </td> </tr> </table> </div> tForm .generate_csrf_token_form_field() .<<<tForm </form> </div> tForm; // display table to edit/delete external links $tool_content .= "<table class='table-default'> <tr><th colspan='2'>$langOperations</th></tr> <tr> <th width='90%' class='text-left'>$langTitle</th> <th class='text-center'>".icon('fa-gears')."</th> </tr>"; $q = Database::get()->queryArray("SELECT id, title FROM link WHERE category = -1 AND course_id = ?d", $course_id); foreach ($q as $externalLinks) {