@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | $sql = "SELECT * FROM $tbl_session_category WHERE id='".$id."' ORDER BY name"; |
| 30 | 30 | $result = Database::query($sql); |
| 31 | 31 | if (!$infos = Database::fetch_array($result)) { |
| 32 | - header('Location: session_list.php'); |
|
| 33 | - exit(); |
|
| 32 | + header('Location: session_list.php'); |
|
| 33 | + exit(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | list($year_start,$month_start,$day_start)=explode('-',$infos['date_start']); |
| 37 | 37 | list($year_end,$month_end,$day_end)=explode('-',$infos['date_end']); |
| 38 | 38 | |
| 39 | 39 | if (!api_is_platform_admin() && $infos['session_admin_id']!=$_user['user_id'] && !api_is_session_admin()) { |
| 40 | - api_not_allowed(true); |
|
| 40 | + api_not_allowed(true); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $day_end |
| 61 | 61 | ); |
| 62 | 62 | if ($return == strval(intval($return))) { |
| 63 | - Display::addFlash(Display::return_message(get_lang('SessionCategoryUpdate'))); |
|
| 63 | + Display::addFlash(Display::return_message(get_lang('SessionCategoryUpdate'))); |
|
| 64 | 64 | header('Location: session_category_list.php'); |
| 65 | 65 | exit(); |
| 66 | 66 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // display the header |
| 74 | 74 | Display::display_header($tool_name); |
| 75 | 75 | if (!empty($return)) { |
| 76 | - Display::display_error_message($return,false); |
|
| 76 | + Display::display_error_message($return,false); |
|
| 77 | 77 | } |
| 78 | 78 | ?> |
| 79 | 79 | <div class="row"> |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | $result = Database::query($sql); |
| 38 | 38 | |
| 39 | 39 | if (!list($session_name,$course_title) = Database::fetch_row($result)) { |
| 40 | - header('Location: session_course_list.php?id_session='.$id_session); |
|
| 41 | - exit(); |
|
| 40 | + header('Location: session_course_list.php?id_session='.$id_session); |
|
| 41 | + exit(); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
@@ -48,63 +48,63 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $arr_infos = array(); |
| 50 | 50 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
| 51 | - $formSent = 1; |
|
| 51 | + $formSent = 1; |
|
| 52 | 52 | |
| 53 | - // get all tutor by course_code in the session |
|
| 54 | - $sql = "SELECT user_id |
|
| 53 | + // get all tutor by course_code in the session |
|
| 54 | + $sql = "SELECT user_id |
|
| 55 | 55 | FROM $tbl_session_rel_course_rel_user |
| 56 | 56 | WHERE session_id = '$id_session' AND c_id = '".$courseId."' AND status = 2"; |
| 57 | - $rs_coaches = Database::query($sql); |
|
| 57 | + $rs_coaches = Database::query($sql); |
|
| 58 | 58 | |
| 59 | - $coaches_course_session = array(); |
|
| 60 | - if (Database::num_rows($rs_coaches) > 0){ |
|
| 61 | - while ($row_coaches = Database::fetch_row($rs_coaches)) { |
|
| 62 | - $coaches_course_session[] = $row_coaches[0]; |
|
| 63 | - } |
|
| 64 | - } |
|
| 59 | + $coaches_course_session = array(); |
|
| 60 | + if (Database::num_rows($rs_coaches) > 0){ |
|
| 61 | + while ($row_coaches = Database::fetch_row($rs_coaches)) { |
|
| 62 | + $coaches_course_session[] = $row_coaches[0]; |
|
| 63 | + } |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - $id_coaches= $_POST['id_coach']; |
|
| 66 | + $id_coaches= $_POST['id_coach']; |
|
| 67 | 67 | |
| 68 | - if (is_array($id_coaches) && count($id_coaches) > 0) { |
|
| 68 | + if (is_array($id_coaches) && count($id_coaches) > 0) { |
|
| 69 | 69 | |
| 70 | - foreach ($id_coaches as $id_coach) { |
|
| 71 | - $id_coach = intval($id_coach); |
|
| 70 | + foreach ($id_coaches as $id_coach) { |
|
| 71 | + $id_coach = intval($id_coach); |
|
| 72 | 72 | $rs1 = SessionManager::set_coach_to_course_session( |
| 73 | 73 | $id_coach, |
| 74 | 74 | $id_session, |
| 75 | 75 | $courseId |
| 76 | 76 | ); |
| 77 | - } |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - // set status to 0 other tutors from multiple list |
|
| 80 | - $array_intersect = array_diff($coaches_course_session,$id_coaches); |
|
| 79 | + // set status to 0 other tutors from multiple list |
|
| 80 | + $array_intersect = array_diff($coaches_course_session,$id_coaches); |
|
| 81 | 81 | |
| 82 | - foreach ($array_intersect as $no_coach_user_id) { |
|
| 83 | - $rs2 = SessionManager::set_coach_to_course_session( |
|
| 84 | - $no_coach_user_id, |
|
| 85 | - $id_session, |
|
| 82 | + foreach ($array_intersect as $no_coach_user_id) { |
|
| 83 | + $rs2 = SessionManager::set_coach_to_course_session( |
|
| 84 | + $no_coach_user_id, |
|
| 85 | + $id_session, |
|
| 86 | 86 | $courseId, |
| 87 | - true |
|
| 88 | - ); |
|
| 89 | - } |
|
| 87 | + true |
|
| 88 | + ); |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - header('Location: '.Security::remove_XSS($_GET['page']).'?id_session='.$id_session); |
|
| 92 | - exit(); |
|
| 93 | - } |
|
| 91 | + header('Location: '.Security::remove_XSS($_GET['page']).'?id_session='.$id_session); |
|
| 92 | + exit(); |
|
| 93 | + } |
|
| 94 | 94 | } else { |
| 95 | - $sql = "SELECT user_id |
|
| 95 | + $sql = "SELECT user_id |
|
| 96 | 96 | FROM $tbl_session_rel_course_rel_user |
| 97 | 97 | WHERE |
| 98 | 98 | session_id = '$id_session' AND |
| 99 | 99 | c_id = '".$courseId."' AND |
| 100 | 100 | status = 2 "; |
| 101 | - $rs = Database::query($sql); |
|
| 101 | + $rs = Database::query($sql); |
|
| 102 | 102 | |
| 103 | - if (Database::num_rows($rs) > 0) { |
|
| 104 | - while ($infos = Database::fetch_array($rs)) { |
|
| 105 | - $arr_infos[] = $infos['user_id']; |
|
| 106 | - } |
|
| 107 | - } |
|
| 103 | + if (Database::num_rows($rs) > 0) { |
|
| 104 | + while ($infos = Database::fetch_array($rs)) { |
|
| 105 | + $arr_infos[] = $infos['user_id']; |
|
| 106 | + } |
|
| 107 | + } |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; |
@@ -197,12 +197,12 @@ |
||
| 197 | 197 | if (!empty($rows_session_category)) { |
| 198 | 198 | foreach($rows_session_category as $category) { |
| 199 | 199 | if($category['id'] == $categoryId) |
| 200 | - echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
|
| 201 | - else |
|
| 202 | - echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
|
| 200 | + echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
|
| 201 | + else |
|
| 202 | + echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | - ?> |
|
| 205 | + ?> |
|
| 206 | 206 | </select> |
| 207 | 207 | </td> |
| 208 | 208 | </tr> |
@@ -636,11 +636,11 @@ |
||
| 636 | 636 | } |
| 637 | 637 | $formToDisplay = $form->returnForm(); |
| 638 | 638 | } else { |
| 639 | - if (!empty($sessionId)) { |
|
| 640 | - $sessionInfo = api_get_session_info($sessionId); |
|
| 641 | - $startDate = $sessionInfo['access_start_date']; |
|
| 642 | - $endDate = $sessionInfo['access_end_date']; |
|
| 643 | - } |
|
| 639 | + if (!empty($sessionId)) { |
|
| 640 | + $sessionInfo = api_get_session_info($sessionId); |
|
| 641 | + $startDate = $sessionInfo['access_start_date']; |
|
| 642 | + $endDate = $sessionInfo['access_end_date']; |
|
| 643 | + } |
|
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | $attendance = new Attendance(); |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | $content .= '<div class="courseadminview-activity-3col"><span class="viewcaption">'.get_lang('SessionData').'</span> |
| 92 | 92 | <table width="100%">'; |
| 93 | 93 | $content .= CourseHome::show_session_data($session_id); |
| 94 | - $content .= '</table></div>'; |
|
| 94 | + $content .= '</table></div>'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | $content .= '<div class="Authoringview">'; |
@@ -488,7 +488,7 @@ |
||
| 488 | 488 | $remind_list |
| 489 | 489 | ); |
| 490 | 490 | |
| 491 | - // Destruction of the Question object |
|
| 491 | + // Destruction of the Question object |
|
| 492 | 492 | unset($objQuestionTmp); |
| 493 | 493 | if ($debug) { |
| 494 | 494 | error_log(" -- end question -- "); |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | } |
| 732 | 732 | |
| 733 | 733 | break; |
| 734 | - case 'get_user_skill_ranking': |
|
| 734 | + case 'get_user_skill_ranking': |
|
| 735 | 735 | $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank'); |
| 736 | 736 | $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition); |
| 737 | 737 | $result = msort($result, 'skills_acquired', 'asc'); |
@@ -1281,7 +1281,7 @@ discard block |
||
| 1281 | 1281 | |
| 1282 | 1282 | if (!empty($item['certif_min_score']) && !empty($item['document_id'])) { |
| 1283 | 1283 | $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL); |
| 1284 | - $item['has_certificates'] = '1'; |
|
| 1284 | + $item['has_certificates'] = '1'; |
|
| 1285 | 1285 | } else { |
| 1286 | 1286 | $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL); |
| 1287 | 1287 | $item['has_certificates'] = '0'; |
@@ -758,7 +758,7 @@ |
||
| 758 | 758 | // $gidReset = true; |
| 759 | 759 | } // end else |
| 760 | 760 | |
| 761 | - // Now check for anonymous user mode |
|
| 761 | + // Now check for anonymous user mode |
|
| 762 | 762 | if (isset($use_anonymous) && $use_anonymous) { |
| 763 | 763 | //if anonymous mode is set, then try to set the current user as anonymous |
| 764 | 764 | //if he doesn't have a login yet |
@@ -401,19 +401,19 @@ |
||
| 401 | 401 | |
| 402 | 402 | public function format_yes_no_optional($value) |
| 403 | 403 | { |
| 404 | - $return = ''; |
|
| 405 | - switch($value) { |
|
| 406 | - case 0: |
|
| 407 | - $return = get_lang('No'); |
|
| 408 | - break; |
|
| 409 | - case 1: |
|
| 410 | - $return = get_lang('Yes'); |
|
| 411 | - break; |
|
| 412 | - case 2: |
|
| 413 | - $return = get_lang('Optional'); |
|
| 414 | - break; |
|
| 415 | - } |
|
| 416 | - return $return; |
|
| 404 | + $return = ''; |
|
| 405 | + switch($value) { |
|
| 406 | + case 0: |
|
| 407 | + $return = get_lang('No'); |
|
| 408 | + break; |
|
| 409 | + case 1: |
|
| 410 | + $return = get_lang('Yes'); |
|
| 411 | + break; |
|
| 412 | + case 2: |
|
| 413 | + $return = get_lang('Optional'); |
|
| 414 | + break; |
|
| 415 | + } |
|
| 416 | + return $return; |
|
| 417 | 417 | |
| 418 | 418 | } |
| 419 | 419 | |