@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $list_sessions = SessionManager::get_sessions_by_user($user_id, true); |
16 | 16 | if (!empty($list_sessions)) { |
17 | 17 | foreach ($list_sessions as $session_item) { |
18 | - echo $session_item['session_name'] . '<br />'; |
|
18 | + echo $session_item['session_name'].'<br />'; |
|
19 | 19 | } |
20 | 20 | } else { |
21 | 21 | echo get_lang('NoSessionsForThisUser'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | [ |
30 | 30 | 's.name' => [ |
31 | 31 | 'operator' => 'LIKE', |
32 | - 'value' => "%" . $_REQUEST['q'] . "%" |
|
32 | + 'value' => "%".$_REQUEST['q']."%" |
|
33 | 33 | ] |
34 | 34 | ] |
35 | 35 | ); |
@@ -30,44 +30,44 @@ |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | switch ($action) { |
33 | - case 'get_file': |
|
34 | - if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) { |
|
35 | - $file_path = $nano->load_filename_if_exists(); |
|
36 | - //$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3'; |
|
37 | - if ($file_path) { |
|
38 | - $info = pathinfo($file_path); |
|
39 | - $user_info = api_get_user_info($nano->params['user_id']); |
|
40 | - $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension']; |
|
41 | - $download = true; |
|
42 | - if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { |
|
43 | - $download = false; |
|
44 | - } |
|
45 | - DocumentManager::file_send_for_download($file_path, $download); |
|
46 | - exit; |
|
47 | - } |
|
48 | - } |
|
49 | - break; |
|
50 | - case 'show_audio': |
|
51 | - if (!$is_nano) { |
|
52 | - echo $nano->return_js($_REQUEST); |
|
53 | - } |
|
54 | - echo $nano->show_audio_file($is_nano); |
|
55 | - break; |
|
56 | - case 'delete': |
|
57 | - $return = $nano->delete_files(); |
|
58 | - if ($return == 1) { |
|
59 | - //cant' do this because the post that nano send doesnt take into account the session |
|
60 | - Display::display_confirmation_message(get_lang('FileDeleted')); |
|
61 | - } else { |
|
62 | - Display::display_confirmation_message(get_lang('FileNotFound')); |
|
63 | - } |
|
64 | - break; |
|
65 | - case 'show_form': |
|
66 | - api_protect_course_script(true); |
|
67 | - Display::display_reduced_header(); |
|
68 | - echo $nano->return_js($_REQUEST); |
|
69 | - echo $nano->return_form(); |
|
70 | - break; |
|
33 | + case 'get_file': |
|
34 | + if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) { |
|
35 | + $file_path = $nano->load_filename_if_exists(); |
|
36 | + //$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3'; |
|
37 | + if ($file_path) { |
|
38 | + $info = pathinfo($file_path); |
|
39 | + $user_info = api_get_user_info($nano->params['user_id']); |
|
40 | + $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension']; |
|
41 | + $download = true; |
|
42 | + if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { |
|
43 | + $download = false; |
|
44 | + } |
|
45 | + DocumentManager::file_send_for_download($file_path, $download); |
|
46 | + exit; |
|
47 | + } |
|
48 | + } |
|
49 | + break; |
|
50 | + case 'show_audio': |
|
51 | + if (!$is_nano) { |
|
52 | + echo $nano->return_js($_REQUEST); |
|
53 | + } |
|
54 | + echo $nano->show_audio_file($is_nano); |
|
55 | + break; |
|
56 | + case 'delete': |
|
57 | + $return = $nano->delete_files(); |
|
58 | + if ($return == 1) { |
|
59 | + //cant' do this because the post that nano send doesnt take into account the session |
|
60 | + Display::display_confirmation_message(get_lang('FileDeleted')); |
|
61 | + } else { |
|
62 | + Display::display_confirmation_message(get_lang('FileNotFound')); |
|
63 | + } |
|
64 | + break; |
|
65 | + case 'show_form': |
|
66 | + api_protect_course_script(true); |
|
67 | + Display::display_reduced_header(); |
|
68 | + echo $nano->return_js($_REQUEST); |
|
69 | + echo $nano->return_form(); |
|
70 | + break; |
|
71 | 71 | case 'save_file': |
72 | 72 | //User access same as upload.php |
73 | 73 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $action = $_REQUEST['a']; |
12 | 12 | |
13 | 13 | unset($_REQUEST['a']); |
14 | -$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/'; |
|
14 | +$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/'; |
|
15 | 15 | |
16 | 16 | //Fix in order to add the exe_id |
17 | 17 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $user_info = api_get_user_info($nano->params['user_id']); |
40 | 40 | $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension']; |
41 | 41 | $download = true; |
42 | - if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { |
|
42 | + if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { |
|
43 | 43 | $download = false; |
44 | 44 | } |
45 | 45 | DocumentManager::file_send_for_download($file_path, $download); |
@@ -16,84 +16,84 @@ |
||
16 | 16 | //Fix in order to add the exe_id |
17 | 17 | |
18 | 18 | if (isset($_REQUEST['from_htaccess'])) { |
19 | - if (isset($_REQUEST['file'])) { |
|
20 | - $fileinfo = pathinfo($_REQUEST['file']); |
|
21 | - $items = explode('-', $fileinfo['filename']); |
|
22 | - $_REQUEST['exe_id'] = $items[5]; |
|
23 | - } |
|
19 | + if (isset($_REQUEST['file'])) { |
|
20 | + $fileinfo = pathinfo($_REQUEST['file']); |
|
21 | + $items = explode('-', $fileinfo['filename']); |
|
22 | + $_REQUEST['exe_id'] = $items[5]; |
|
23 | + } |
|
24 | 24 | } |
25 | 25 | $nano = new Nanogong($_REQUEST); |
26 | 26 | $is_nano = false; |
27 | 27 | |
28 | 28 | if (isset($_REQUEST['is_nano'])) { |
29 | - $is_nano = true; |
|
29 | + $is_nano = true; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | switch ($action) { |
33 | - case 'get_file': |
|
34 | - if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) { |
|
35 | - $file_path = $nano->load_filename_if_exists(); |
|
36 | - //$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3'; |
|
37 | - if ($file_path) { |
|
38 | - $info = pathinfo($file_path); |
|
39 | - $user_info = api_get_user_info($nano->params['user_id']); |
|
40 | - $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension']; |
|
41 | - $download = true; |
|
42 | - if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { |
|
43 | - $download = false; |
|
44 | - } |
|
45 | - DocumentManager::file_send_for_download($file_path, $download); |
|
46 | - exit; |
|
47 | - } |
|
48 | - } |
|
49 | - break; |
|
50 | - case 'show_audio': |
|
51 | - if (!$is_nano) { |
|
52 | - echo $nano->return_js($_REQUEST); |
|
53 | - } |
|
54 | - echo $nano->show_audio_file($is_nano); |
|
55 | - break; |
|
56 | - case 'delete': |
|
57 | - $return = $nano->delete_files(); |
|
58 | - if ($return == 1) { |
|
59 | - //cant' do this because the post that nano send doesnt take into account the session |
|
60 | - Display::display_confirmation_message(get_lang('FileDeleted')); |
|
61 | - } else { |
|
62 | - Display::display_confirmation_message(get_lang('FileNotFound')); |
|
63 | - } |
|
64 | - break; |
|
65 | - case 'show_form': |
|
66 | - api_protect_course_script(true); |
|
67 | - Display::display_reduced_header(); |
|
68 | - echo $nano->return_js($_REQUEST); |
|
69 | - echo $nano->return_form(); |
|
70 | - break; |
|
33 | + case 'get_file': |
|
34 | + if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) { |
|
35 | + $file_path = $nano->load_filename_if_exists(); |
|
36 | + //$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3'; |
|
37 | + if ($file_path) { |
|
38 | + $info = pathinfo($file_path); |
|
39 | + $user_info = api_get_user_info($nano->params['user_id']); |
|
40 | + $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension']; |
|
41 | + $download = true; |
|
42 | + if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { |
|
43 | + $download = false; |
|
44 | + } |
|
45 | + DocumentManager::file_send_for_download($file_path, $download); |
|
46 | + exit; |
|
47 | + } |
|
48 | + } |
|
49 | + break; |
|
50 | + case 'show_audio': |
|
51 | + if (!$is_nano) { |
|
52 | + echo $nano->return_js($_REQUEST); |
|
53 | + } |
|
54 | + echo $nano->show_audio_file($is_nano); |
|
55 | + break; |
|
56 | + case 'delete': |
|
57 | + $return = $nano->delete_files(); |
|
58 | + if ($return == 1) { |
|
59 | + //cant' do this because the post that nano send doesnt take into account the session |
|
60 | + Display::display_confirmation_message(get_lang('FileDeleted')); |
|
61 | + } else { |
|
62 | + Display::display_confirmation_message(get_lang('FileNotFound')); |
|
63 | + } |
|
64 | + break; |
|
65 | + case 'show_form': |
|
66 | + api_protect_course_script(true); |
|
67 | + Display::display_reduced_header(); |
|
68 | + echo $nano->return_js($_REQUEST); |
|
69 | + echo $nano->return_form(); |
|
70 | + break; |
|
71 | 71 | case 'save_file': |
72 | - //User access same as upload.php |
|
72 | + //User access same as upload.php |
|
73 | 73 | |
74 | - $return = $nano->upload_file($is_nano); |
|
74 | + $return = $nano->upload_file($is_nano); |
|
75 | 75 | |
76 | - if ($is_nano) { |
|
77 | - //nano looks for numbers |
|
78 | - if ($return == 1) { |
|
79 | - //cant' do this because the post that nano send doesnt take into account the session |
|
80 | - echo 1; //Display::display_confirmation_message(get_lang('UplUploadSucceeded')); |
|
81 | - } else { |
|
82 | - echo 0; |
|
83 | - //Display::display_warning_message(get_lang('UplUnableToSaveFileFilteredExtension')); |
|
84 | - } |
|
85 | - } else { |
|
86 | - Display::display_reduced_header(); |
|
87 | - echo $nano->return_js($_REQUEST); |
|
88 | - //normal form |
|
89 | - if ($return == 1) { |
|
90 | - //cant' do this because the post that nano send doesnt take into account the session |
|
91 | - $message = Display::return_message(get_lang('UplUploadSucceeded'), 'confirm'); |
|
92 | - } else { |
|
93 | - $message = Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'warning'); |
|
94 | - } |
|
95 | - echo $nano->return_form($message); |
|
96 | - } |
|
76 | + if ($is_nano) { |
|
77 | + //nano looks for numbers |
|
78 | + if ($return == 1) { |
|
79 | + //cant' do this because the post that nano send doesnt take into account the session |
|
80 | + echo 1; //Display::display_confirmation_message(get_lang('UplUploadSucceeded')); |
|
81 | + } else { |
|
82 | + echo 0; |
|
83 | + //Display::display_warning_message(get_lang('UplUnableToSaveFileFilteredExtension')); |
|
84 | + } |
|
85 | + } else { |
|
86 | + Display::display_reduced_header(); |
|
87 | + echo $nano->return_js($_REQUEST); |
|
88 | + //normal form |
|
89 | + if ($return == 1) { |
|
90 | + //cant' do this because the post that nano send doesnt take into account the session |
|
91 | + $message = Display::return_message(get_lang('UplUploadSucceeded'), 'confirm'); |
|
92 | + } else { |
|
93 | + $message = Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'warning'); |
|
94 | + } |
|
95 | + echo $nano->return_form($message); |
|
96 | + } |
|
97 | 97 | break; |
98 | 98 | default: |
99 | 99 | echo ''; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | $action = $_GET['a']; |
6 | 6 | |
7 | -switch($action) { |
|
7 | +switch ($action) { |
|
8 | 8 | case 'load_online_user': |
9 | 9 | if (isset($_SESSION['who_is_online_counter'])) { |
10 | 10 | $_SESSION['who_is_online_counter']++; |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | $images_to_show = 9; |
15 | 15 | |
16 | 16 | $page = intval($_REQUEST['online_page_nr']); |
17 | - $max_page = ceil(who_is_online_count()/$images_to_show); |
|
18 | - $page_rows = ($page-1)*9; |
|
17 | + $max_page = ceil(who_is_online_count() / $images_to_show); |
|
18 | + $page_rows = ($page - 1) * 9; |
|
19 | 19 | |
20 | 20 | if (!empty($max_page) && $page <= $max_page) { |
21 | 21 | if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) { |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | break; |
38 | 38 | } |
39 | 39 | $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
40 | - $tbl_my_user = Database::get_main_table(TABLE_MAIN_USER); |
|
40 | + $tbl_my_user = Database::get_main_table(TABLE_MAIN_USER); |
|
41 | 41 | $tbl_my_user_friend = Database::get_main_table(TABLE_MAIN_USER_REL_USER); |
42 | - $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
42 | + $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
43 | 43 | $tbl_access_url_rel_user = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
44 | - $search = Database::escape_string($_REQUEST['q']); |
|
44 | + $search = Database::escape_string($_REQUEST['q']); |
|
45 | 45 | |
46 | 46 | $access_url_id = api_get_multiple_access_url() == 'true' ? api_get_current_access_url_id() : 1; |
47 | 47 | $user_id = api_get_user_id(); |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | |
50 | 50 | $likeCondition = " AND (firstname LIKE '%$search%' OR lastname LIKE '%$search%' OR email LIKE '%$search%') "; |
51 | 51 | |
52 | - if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool') == 'true') { |
|
52 | + if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
53 | 53 | // All users |
54 | - if (api_get_setting('allow_send_message_to_all_platform_users') == 'true' || api_is_platform_admin() ) { |
|
54 | + if (api_get_setting('allow_send_message_to_all_platform_users') == 'true' || api_is_platform_admin()) { |
|
55 | 55 | if ($access_url_id != 0) { |
56 | 56 | $sql = "SELECT DISTINCT u.user_id as id, u.firstname, u.lastname, u.email |
57 | 57 | FROM $tbl_user u LEFT JOIN $tbl_access_url_rel_user r ON u.user_id = r.user_id |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $likeCondition"; |
98 | 98 | } |
99 | 99 | } |
100 | - } elseif (api_get_setting('allow_social_tool')=='false' && api_get_setting('allow_message_tool')=='true') { |
|
100 | + } elseif (api_get_setting('allow_social_tool') == 'false' && api_get_setting('allow_message_tool') == 'true') { |
|
101 | 101 | if (api_get_setting('allow_send_message_to_all_platform_users') == 'true') { |
102 | 102 | $sql = "SELECT DISTINCT u.user_id as id, u.firstname, u.lastname, u.email |
103 | 103 | FROM $tbl_user u LEFT JOIN $tbl_access_url_rel_user r ON u.user_id = r.user_id |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $likeCondition "; |
109 | 109 | } else { |
110 | 110 | $time_limit = api_get_setting('time_limit_whosonline'); |
111 | - $online_time = time() - $time_limit*60; |
|
111 | + $online_time = time() - $time_limit * 60; |
|
112 | 112 | $limit_date = api_get_utc_datetime($online_time); |
113 | 113 | $sql = "SELECT SELECT DISTINCT u.user_id as id, u.firstname, u.lastname, u.email |
114 | 114 | FROM $tbl_my_user u INNER JOIN $track_online_table t |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $likeCondition"; |
118 | 118 | } |
119 | 119 | } |
120 | - $sql .=' LIMIT 20'; |
|
120 | + $sql .= ' LIMIT 20'; |
|
121 | 121 | $result = Database::query($sql); |
122 | 122 | |
123 | 123 | $showEmail = api_get_setting('show_email_addresses'); |
@@ -83,11 +83,11 @@ |
||
83 | 83 | ); |
84 | 84 | } |
85 | 85 | |
86 | - $link = '<div class="parent" data-id="' . $id . '">'; |
|
86 | + $link = '<div class="parent" data-id="'.$id.'">'; |
|
87 | 87 | $link .= '<div class="big-icon">'; |
88 | 88 | $link .= $image; |
89 | - $link .= '<div class="sequence-course">' . $sessionInfo['name'] . '</div>'; |
|
90 | - $link .= '<a href="#" class="sequence-id">' . $id . '</a>'; |
|
89 | + $link .= '<div class="sequence-course">'.$sessionInfo['name'].'</div>'; |
|
90 | + $link .= '<a href="#" class="sequence-id">'.$id.'</a>'; |
|
91 | 91 | $link .= $linkDelete; |
92 | 92 | $link .= $linkUndo; |
93 | 93 | $link .= '</div></div>'; |
@@ -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 -- "); |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | $exercise_id = intval($_GET['exercise_id']); |
31 | 31 | $page = intval($_REQUEST['page']); //page |
32 | 32 | $limit = intval($_REQUEST['rows']); //quantity of rows |
33 | - $sidx = $_REQUEST['sidx']; //index to filter |
|
34 | - $sord = $_REQUEST['sord']; //asc or desc |
|
33 | + $sidx = $_REQUEST['sidx']; //index to filter |
|
34 | + $sord = $_REQUEST['sord']; //asc or desc |
|
35 | 35 | |
36 | - if (!in_array($sord, array('asc','desc'))) { |
|
36 | + if (!in_array($sord, array('asc', 'desc'))) { |
|
37 | 37 | $sord = 'desc'; |
38 | 38 | } |
39 | 39 | // get index row - i.e. user click to sort $sord = $_GET['sord']; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $total_pages = 0; |
63 | 63 | if ($count > 0) { |
64 | 64 | if (!empty($limit)) { |
65 | - $total_pages = ceil($count/$limit); |
|
65 | + $total_pages = ceil($count / $limit); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $response->page = $page; |
125 | 125 | $response->total = $total_pages; |
126 | 126 | $response->records = $count; |
127 | - $i=0; |
|
127 | + $i = 0; |
|
128 | 128 | |
129 | 129 | if (!empty($results)) { |
130 | 130 | foreach ($results as $row) { |
@@ -138,22 +138,22 @@ discard block |
||
138 | 138 | GROUP by question_id |
139 | 139 | ) as count_table"; |
140 | 140 | $result_count = Database::query($sql); |
141 | - $count_questions = Database::fetch_array($result_count,'ASSOC'); |
|
141 | + $count_questions = Database::fetch_array($result_count, 'ASSOC'); |
|
142 | 142 | $count_questions = $count_questions['count_question_id']; |
143 | 143 | |
144 | 144 | $row['count_questions'] = $count_questions; |
145 | 145 | |
146 | 146 | $response->rows[$i]['id'] = $row['exe_id']; |
147 | - $remaining = strtotime($row['start_date'])+($oExe->expired_time*60) - strtotime(api_get_utc_datetime(time())); |
|
148 | - $h = floor($remaining/3600); |
|
149 | - $m = floor(($remaining - ($h*3600))/60); |
|
150 | - $s = ($remaining - ($h*3600) - ($m*60)); |
|
147 | + $remaining = strtotime($row['start_date']) + ($oExe->expired_time * 60) - strtotime(api_get_utc_datetime(time())); |
|
148 | + $h = floor($remaining / 3600); |
|
149 | + $m = floor(($remaining - ($h * 3600)) / 60); |
|
150 | + $s = ($remaining - ($h * 3600) - ($m * 60)); |
|
151 | 151 | $array = array( |
152 | 152 | $row['firstname'], |
153 | 153 | $row['lastname'], |
154 | - api_format_date($row['start_date'], DATE_TIME_FORMAT_LONG).' ['.($h>0?$h.':':'').sprintf("%02d",$m).':'.sprintf("%02d",$s).']', |
|
154 | + api_format_date($row['start_date'], DATE_TIME_FORMAT_LONG).' ['.($h > 0 ? $h.':' : '').sprintf("%02d", $m).':'.sprintf("%02d", $s).']', |
|
155 | 155 | $row['count_questions'], |
156 | - round($row['score']*100).'%' |
|
156 | + round($row['score'] * 100).'%' |
|
157 | 157 | ); |
158 | 158 | $response->rows[$i]['cell'] = $array; |
159 | 159 | $i++; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | break; |
210 | 210 | case 'add_question_to_reminder': |
211 | 211 | /** @var Exercise $objExercise */ |
212 | - $objExercise = $_SESSION['objExercise']; |
|
212 | + $objExercise = $_SESSION['objExercise']; |
|
213 | 213 | if (empty($objExercise)) { |
214 | 214 | echo 0; |
215 | 215 | exit; |
@@ -362,8 +362,8 @@ discard block |
||
362 | 362 | $objQuestionTmp = Question::read($my_question_id, $course_id); |
363 | 363 | |
364 | 364 | // Getting free choice data. |
365 | - if ($objQuestionTmp->type == FREE_ANSWER && $type == 'all') { |
|
366 | - $my_choice = isset($_REQUEST['free_choice'][$my_question_id]) && !empty($_REQUEST['free_choice'][$my_question_id]) ? $_REQUEST['free_choice'][$my_question_id]: null; |
|
365 | + if ($objQuestionTmp->type == FREE_ANSWER && $type == 'all') { |
|
366 | + $my_choice = isset($_REQUEST['free_choice'][$my_question_id]) && !empty($_REQUEST['free_choice'][$my_question_id]) ? $_REQUEST['free_choice'][$my_question_id] : null; |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | if ($type == 'all') { |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $session_id, |
408 | 408 | $my_question_id |
409 | 409 | ); |
410 | - if ($objQuestionTmp->type == HOT_SPOT) { |
|
410 | + if ($objQuestionTmp->type == HOT_SPOT) { |
|
411 | 411 | Event::delete_attempt_hotspot( |
412 | 412 | $exe_id, |
413 | 413 | api_get_user_id(), |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | case 'update_lp_item_order': |
65 | 65 | if (api_is_allowed_to_edit(null, true)) { |
66 | 66 | |
67 | - $new_order = $_POST['new_order']; |
|
67 | + $new_order = $_POST['new_order']; |
|
68 | 68 | |
69 | - $sections = explode('^', $new_order); |
|
69 | + $sections = explode('^', $new_order); |
|
70 | 70 | $new_array = array(); |
71 | 71 | |
72 | 72 | // We have to update parent_item_id, previous_item_id, next_item_id, display_order in the database |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | foreach ($tab_parents_id as $parent_id) { |
85 | 85 | $Same_parent_LP_item_list = $LP_item_list->get_item_with_same_parent($parent_id); |
86 | 86 | $previous_item_id = 0; |
87 | - for ($i=0; $i < count($Same_parent_LP_item_list->list);$i++) { |
|
87 | + for ($i = 0; $i < count($Same_parent_LP_item_list->list); $i++) { |
|
88 | 88 | $item_id = $Same_parent_LP_item_list->list[$i]->id; |
89 | 89 | // display_order |
90 | 90 | $display_order = $i + 1; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // next_item_id |
96 | 96 | $next_item_id = 0; |
97 | 97 | if ($i < count($Same_parent_LP_item_list->list) - 1) { |
98 | - $next_item_id = $Same_parent_LP_item_list->list[$i+1]->id; |
|
98 | + $next_item_id = $Same_parent_LP_item_list->list[$i + 1]->id; |
|
99 | 99 | } |
100 | 100 | $LP_item_list->set_parameters_for_id($item_id, $next_item_id, "next_item_id"); |
101 | 101 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $params['display_order'] = $LP_item->display_order; |
107 | 107 | $params['previous_item_id'] = $LP_item->previous_item_id; |
108 | 108 | $params['next_item_id'] = $LP_item->next_item_id; |
109 | - $params['parent_item_id'] = $LP_item->parent_item_id; |
|
109 | + $params['parent_item_id'] = $LP_item->parent_item_id; |
|
110 | 110 | |
111 | 111 | Database::update( |
112 | 112 | $tbl_lp_item, |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | |
308 | 308 | public function get_item_with_same_parent($in_parent_id) { |
309 | 309 | $out_res = new LP_item_order_list(); |
310 | - for ($i=0; $i < count($this->list); $i++) { |
|
310 | + for ($i = 0; $i < count($this->list); $i++) { |
|
311 | 311 | if ($this->list[$i]->parent_item_id == $in_parent_id) { |
312 | 312 | $out_res->add($this->list[$i]); |
313 | 313 | } |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | } |
327 | 327 | |
328 | 328 | public function set_parameters_for_id($in_id, $in_value, $in_parameters) { |
329 | - for ($i=0; $i < count($this->list); $i++) { |
|
329 | + for ($i = 0; $i < count($this->list); $i++) { |
|
330 | 330 | if ($this->list[$i]->id == $in_id) { |
331 | 331 | $this->list[$i]->$in_parameters = $in_value; |
332 | 332 | break; |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | public $next_item_id = 0; |
344 | 344 | public $display_order = 0; |
345 | 345 | |
346 | - public function __construct($in_id=0, $in_parent_id=0) { |
|
346 | + public function __construct($in_id = 0, $in_parent_id = 0) { |
|
347 | 347 | $this->id = $in_id; |
348 | 348 | $this->parent_item_id = $in_parent_id; |
349 | 349 | } |
@@ -258,13 +258,13 @@ |
||
258 | 258 | ), 'first'); |
259 | 259 | |
260 | 260 | $coachName = api_get_person_name($userResult['firstname'], $userResult['lastname']); |
261 | - } |
|
261 | + } |
|
262 | 262 | |
263 | - $courses[] = array( |
|
264 | - 'id' => $courseId, |
|
265 | - 'name' => $course['title'], |
|
266 | - 'coachName' => $coachName, |
|
267 | - ); |
|
263 | + $courses[] = array( |
|
264 | + 'id' => $courseId, |
|
265 | + 'name' => $course['title'], |
|
266 | + 'coachName' => $coachName, |
|
267 | + ); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | echo json_encode($courses); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 0, //howMany |
74 | 74 | 1, //$orderby = 1 |
75 | 75 | 'ASC', |
76 | - -1, //visibility |
|
76 | + -1, //visibility |
|
77 | 77 | $_GET['q'], |
78 | 78 | null, //$urlId |
79 | 79 | true //AlsoSearchCode |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | if (!empty($course['category_code'])) { |
94 | 94 | $parents = getParentsToString($course['category_code']); |
95 | - $title = $parents . $course['title']; |
|
95 | + $title = $parents.$course['title']; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | $results['items'][] = array( |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | INNER JOIN $session_course_user r ON u.user_id = r.user_id |
173 | 173 | WHERE session_id = %d AND c_id = '%s' |
174 | 174 | AND (u.firstname LIKE '%s' OR u.username LIKE '%s' OR u.lastname LIKE '%s')"; |
175 | - $needle = '%' . $_GET['q'] . '%'; |
|
175 | + $needle = '%'.$_GET['q'].'%'; |
|
176 | 176 | $sql_query = sprintf($sql, $_GET['session_id'], $course['real_id'], $needle, $needle, $needle); |
177 | 177 | |
178 | 178 | $result = Database::query($sql_query); |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | case 'search_exercise_by_course': |
192 | 192 | if (api_is_platform_admin()) { |
193 | 193 | $course = api_get_course_info_by_id($_GET['course_id']); |
194 | - $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0 ; |
|
194 | + $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0; |
|
195 | 195 | $exercises = ExerciseLib::get_all_exercises($course, $session_id, false, $_GET['q'], true, 3); |
196 | 196 | |
197 | 197 | foreach ($exercises as $exercise) { |
198 | - $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title']) ); |
|
198 | + $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title'])); |
|
199 | 199 | } |
200 | 200 | if (!empty($data)) { |
201 | 201 | $data[] = array('id' => 'T', 'text' => 'TODOS'); |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | $sql, |
221 | 221 | intval($_GET['course_id']), |
222 | 222 | intval($_GET['session_id']), |
223 | - '%' . Database::escape_string($_GET['q']).'%' |
|
223 | + '%'.Database::escape_string($_GET['q']).'%' |
|
224 | 224 | ); |
225 | 225 | $result = Database::query($sql_query); |
226 | 226 | while ($survey = Database::fetch_assoc($result)) { |
227 | - $survey['title'] .= ($survey['anonymous'] == 1) ? ' (' . get_lang('Anonymous') . ')' : ''; |
|
227 | + $survey['title'] .= ($survey['anonymous'] == 1) ? ' ('.get_lang('Anonymous').')' : ''; |
|
228 | 228 | $data[] = array( |
229 | 229 | 'id' => $survey['id'], |
230 | 230 | 'text' => strip_tags(html_entity_decode($survey['title'])) |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | null, |
31 | 31 | true |
32 | 32 | ); |
33 | - $na_image = str_replace('.png', '_na.png', $tool_image); |
|
33 | + $na_image = str_replace('.png', '_na.png', $tool_image); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | if (isset($tool_info['custom_icon']) && !empty($tool_info['custom_icon'])) { |
@@ -38,20 +38,20 @@ discard block |
||
38 | 38 | $na_image = CourseHome::getCustomWebIconPath().CourseHome::getDisableIcon($tool_info['custom_icon']); |
39 | 39 | } |
40 | 40 | |
41 | - $requested_image = ($tool_visibility == 0 ) ? $tool_image : $na_image; |
|
42 | - $requested_class = ($tool_visibility == 0 ) ? 'visible' : 'invisible'; |
|
43 | - $requested_message = ($tool_visibility == 0 ) ? 'is_active' : 'is_inactive'; |
|
44 | - $requested_view = ($tool_visibility == 0 ) ? 'visible.png' : 'invisible.png'; |
|
45 | - $requested_visible = ($tool_visibility == 0 ) ? 1 : 0; |
|
41 | + $requested_image = ($tool_visibility == 0) ? $tool_image : $na_image; |
|
42 | + $requested_class = ($tool_visibility == 0) ? 'visible' : 'invisible'; |
|
43 | + $requested_message = ($tool_visibility == 0) ? 'is_active' : 'is_inactive'; |
|
44 | + $requested_view = ($tool_visibility == 0) ? 'visible.png' : 'invisible.png'; |
|
45 | + $requested_visible = ($tool_visibility == 0) ? 1 : 0; |
|
46 | 46 | |
47 | - $requested_view = ($tool_visibility == 0 ) ? 'visible.png' : 'invisible.png'; |
|
48 | - $requested_visible = ($tool_visibility == 0 ) ? 1 : 0; |
|
47 | + $requested_view = ($tool_visibility == 0) ? 'visible.png' : 'invisible.png'; |
|
48 | + $requested_visible = ($tool_visibility == 0) ? 1 : 0; |
|
49 | 49 | |
50 | 50 | // HIDE AND REACTIVATE TOOL |
51 | 51 | if ($_GET["id"] == strval(intval($_GET["id"]))) { |
52 | 52 | $sql = "UPDATE $tool_table SET |
53 | 53 | visibility = $requested_visible |
54 | - WHERE c_id = $course_id AND id='" . intval($_GET['id']) . "'"; |
|
54 | + WHERE c_id = $course_id AND id='".intval($_GET['id'])."'"; |
|
55 | 55 | Database::query($sql); |
56 | 56 | } |
57 | 57 | $response_data = array( |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | WHERE c_id = ".$course_info['real_id']." AND session_id = 0 |
83 | 83 | ORDER BY id"; |
84 | 84 | $result = Database::query($sql); |
85 | - if (Database::num_rows($result) > 0 ) { |
|
85 | + if (Database::num_rows($result) > 0) { |
|
86 | 86 | while ($description = Database::fetch_object($result)) { |
87 | 87 | $descriptions[$description->id] = $description; |
88 | 88 | } |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | |
105 | 105 | require_once '../global.inc.php'; |
106 | 106 | $now = time(); |
107 | - $page = intval($_REQUEST['page']); //page |
|
108 | - $limit = intval($_REQUEST['rows']); // quantity of rows |
|
107 | + $page = intval($_REQUEST['page']); //page |
|
108 | + $limit = intval($_REQUEST['rows']); // quantity of rows |
|
109 | 109 | //index to filter |
110 | 110 | $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id'; |
111 | - $sord = $_REQUEST['sord']; //asc or desc |
|
112 | - if (!in_array($sord, array('asc','desc'))) { |
|
111 | + $sord = $_REQUEST['sord']; //asc or desc |
|
112 | + if (!in_array($sord, array('asc', 'desc'))) { |
|
113 | 113 | $sord = 'desc'; |
114 | 114 | } |
115 | 115 | $session_id = intval($_REQUEST['session_id']); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | if (!api_is_platform_admin()) { |
121 | 121 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
122 | 122 | $my_session_list = array(); |
123 | - foreach($new_session_list as $item) { |
|
123 | + foreach ($new_session_list as $item) { |
|
124 | 124 | if (!empty($item['id_session'])) |
125 | 125 | $my_session_list[] = $item['id_session']; |
126 | 126 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
132 | - $start = $limit*$page - $limit; |
|
132 | + $start = $limit * $page - $limit; |
|
133 | 133 | $course_list = SessionManager::get_course_list_by_session_id($session_id); |
134 | 134 | $count = 0; |
135 | 135 | $temp = array(); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $item['title'] = Display::url($item['title'], $course_url, array('target' => SESSION_LINK_TARGET)); |
142 | 142 | |
143 | 143 | foreach ($flat_list as $lp_id => $lp_item) { |
144 | - $temp[$count]['id']= $lp_id; |
|
144 | + $temp[$count]['id'] = $lp_id; |
|
145 | 145 | |
146 | 146 | $lp = new learnpath($item['code'], $lp_id, api_get_user_id()); |
147 | 147 | if ($lp->progress_db == 100) { |
@@ -205,27 +205,27 @@ discard block |
||
205 | 205 | |
206 | 206 | $temp = msort($temp, $sidx, $sord); |
207 | 207 | |
208 | - $i =0; |
|
208 | + $i = 0; |
|
209 | 209 | $response = new stdClass(); |
210 | - foreach($temp as $key=>$row) { |
|
210 | + foreach ($temp as $key=>$row) { |
|
211 | 211 | $row = $row['cell']; |
212 | 212 | if (!empty($row)) { |
213 | - if ($key >= $start && $key < ($start + $limit)) { |
|
214 | - $response->rows[$i]['id']= $key; |
|
215 | - $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]); |
|
213 | + if ($key >= $start && $key < ($start + $limit)) { |
|
214 | + $response->rows[$i]['id'] = $key; |
|
215 | + $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]); |
|
216 | 216 | $i++; |
217 | 217 | } |
218 | 218 | } |
219 | 219 | } |
220 | 220 | |
221 | - if($count > 0 && $limit > 0) { |
|
222 | - $total_pages = ceil($count/$limit); |
|
221 | + if ($count > 0 && $limit > 0) { |
|
222 | + $total_pages = ceil($count / $limit); |
|
223 | 223 | } else { |
224 | 224 | $total_pages = 0; |
225 | 225 | } |
226 | - $response->total = $total_pages; |
|
226 | + $response->total = $total_pages; |
|
227 | 227 | if ($page > $total_pages) { |
228 | - $response->page= $total_pages; |
|
228 | + $response->page = $total_pages; |
|
229 | 229 | } else { |
230 | 230 | $response->page = $page; |
231 | 231 | } |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | require_once '../global.inc.php'; |
237 | 237 | $now = time(); |
238 | 238 | |
239 | - $page = intval($_REQUEST['page']); //page |
|
240 | - $limit = intval($_REQUEST['rows']); // quantity of rows |
|
239 | + $page = intval($_REQUEST['page']); //page |
|
240 | + $limit = intval($_REQUEST['rows']); // quantity of rows |
|
241 | 241 | $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'course'; |
242 | 242 | $sidx = str_replace(array('week desc,', ' '), '', $sidx); |
243 | 243 | |
244 | - $sord = $_REQUEST['sord']; //asc or desc |
|
245 | - if (!in_array($sord, array('asc','desc'))) { |
|
244 | + $sord = $_REQUEST['sord']; //asc or desc |
|
245 | + if (!in_array($sord, array('asc', 'desc'))) { |
|
246 | 246 | $sord = 'desc'; |
247 | 247 | } |
248 | 248 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | if (!api_is_platform_admin()) { |
254 | 254 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
255 | 255 | $my_session_list = array(); |
256 | - foreach($new_session_list as $item) { |
|
256 | + foreach ($new_session_list as $item) { |
|
257 | 257 | if (!empty($item['id_session'])) |
258 | 258 | $my_session_list[] = $item['id_session']; |
259 | 259 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } |
263 | 263 | } |
264 | 264 | |
265 | - $start = $limit*$page - $limit; |
|
265 | + $start = $limit * $page - $limit; |
|
266 | 266 | $course_list = SessionManager::get_course_list_by_session_id($session_id); |
267 | 267 | |
268 | 268 | $count = 0; |
@@ -274,13 +274,13 @@ discard block |
||
274 | 274 | } |
275 | 275 | } |
276 | 276 | |
277 | - $list = new LearnpathList(api_get_user_id(),$item['code'], $session_id, 'publicated_on DESC'); |
|
277 | + $list = new LearnpathList(api_get_user_id(), $item['code'], $session_id, 'publicated_on DESC'); |
|
278 | 278 | $flat_list = $list->get_flat_list(); |
279 | 279 | $lps[$item['code']] = $flat_list; |
280 | - $item['title'] = Display::url($item['title'],api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id,array('target'=>SESSION_LINK_TARGET)); |
|
280 | + $item['title'] = Display::url($item['title'], api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id, array('target'=>SESSION_LINK_TARGET)); |
|
281 | 281 | |
282 | 282 | foreach ($flat_list as $lp_id => $lp_item) { |
283 | - $temp[$count]['id']= $lp_id; |
|
283 | + $temp[$count]['id'] = $lp_id; |
|
284 | 284 | $lp_url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view'; |
285 | 285 | |
286 | 286 | $last_date = Tracking::get_last_connection_date_on_the_course( |
@@ -338,20 +338,20 @@ discard block |
||
338 | 338 | } |
339 | 339 | |
340 | 340 | $response = new stdClass(); |
341 | - $i =0; |
|
342 | - foreach($temp as $key=>$row) { |
|
341 | + $i = 0; |
|
342 | + foreach ($temp as $key=>$row) { |
|
343 | 343 | $row = $row['cell']; |
344 | 344 | if (!empty($row)) { |
345 | - if ($key >= $start && $key < ($start + $limit)) { |
|
346 | - $response->rows[$i]['id']= $key; |
|
347 | - $response->rows[$i]['cell']=array($row[0], $row[1], $row[2],$row[3]); |
|
345 | + if ($key >= $start && $key < ($start + $limit)) { |
|
346 | + $response->rows[$i]['id'] = $key; |
|
347 | + $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2], $row[3]); |
|
348 | 348 | $i++; |
349 | 349 | } |
350 | 350 | } |
351 | 351 | } |
352 | 352 | |
353 | 353 | if ($count > 0 && $limit > 0) { |
354 | - $total_pages = ceil($count/$limit); |
|
354 | + $total_pages = ceil($count / $limit); |
|
355 | 355 | } else { |
356 | 356 | $total_pages = 0; |
357 | 357 | } |
@@ -367,13 +367,13 @@ discard block |
||
367 | 367 | case 'session_courses_lp_by_course': |
368 | 368 | require_once '../global.inc.php'; |
369 | 369 | $now = time(); |
370 | - $page = intval($_REQUEST['page']); //page |
|
371 | - $limit = intval($_REQUEST['rows']); // quantity of rows |
|
370 | + $page = intval($_REQUEST['page']); //page |
|
371 | + $limit = intval($_REQUEST['rows']); // quantity of rows |
|
372 | 372 | $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id'; |
373 | 373 | $sidx = str_replace(array('course asc,', ' '), '', $sidx); |
374 | 374 | |
375 | - $sord = $_REQUEST['sord']; //asc or desc |
|
376 | - if (!in_array($sord, array('asc','desc'))) { |
|
375 | + $sord = $_REQUEST['sord']; //asc or desc |
|
376 | + if (!in_array($sord, array('asc', 'desc'))) { |
|
377 | 377 | $sord = 'desc'; |
378 | 378 | } |
379 | 379 | $session_id = intval($_REQUEST['session_id']); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | if (!api_is_platform_admin()) { |
384 | 384 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
385 | 385 | $my_session_list = array(); |
386 | - foreach($new_session_list as $item) { |
|
386 | + foreach ($new_session_list as $item) { |
|
387 | 387 | if (!empty($item['id_session'])) |
388 | 388 | $my_session_list[] = $item['id_session']; |
389 | 389 | } |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | } |
393 | 393 | } |
394 | 394 | |
395 | - $start = $limit*$page - $limit; |
|
395 | + $start = $limit * $page - $limit; |
|
396 | 396 | $course_list = SessionManager::get_course_list_by_session_id($session_id); |
397 | 397 | $count = 0; |
398 | 398 | |
@@ -403,15 +403,15 @@ discard block |
||
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
406 | - $list = new LearnpathList(api_get_user_id(),$item['code'],$session_id); |
|
406 | + $list = new LearnpathList(api_get_user_id(), $item['code'], $session_id); |
|
407 | 407 | $flat_list = $list->get_flat_list(); |
408 | 408 | $lps[$item['code']] = $flat_list; |
409 | 409 | $item['title'] = Display::url( |
410 | 410 | $item['title'], |
411 | 411 | api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id, array('target'=>SESSION_LINK_TARGET) |
412 | 412 | ); |
413 | - foreach($flat_list as $lp_id => $lp_item) { |
|
414 | - $temp[$count]['id']= $lp_id; |
|
413 | + foreach ($flat_list as $lp_id => $lp_item) { |
|
414 | + $temp[$count]['id'] = $lp_id; |
|
415 | 415 | $lp_url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view'; |
416 | 416 | $last_date = Tracking::get_last_connection_date_on_the_course( |
417 | 417 | api_get_user_id(), |
@@ -465,13 +465,13 @@ discard block |
||
465 | 465 | $temp = msort($temp, $sidx, $sord); |
466 | 466 | |
467 | 467 | $response = new stdClass(); |
468 | - $i =0; |
|
468 | + $i = 0; |
|
469 | 469 | foreach ($temp as $key=>$row) { |
470 | 470 | $row = $row['cell']; |
471 | 471 | if (!empty($row)) { |
472 | - if ($key >= $start && $key < ($start + $limit)) { |
|
473 | - $response->rows[$i]['id']= $key; |
|
474 | - $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]); |
|
472 | + if ($key >= $start && $key < ($start + $limit)) { |
|
473 | + $response->rows[$i]['id'] = $key; |
|
474 | + $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]); |
|
475 | 475 | $i++; |
476 | 476 | } |
477 | 477 | } |
@@ -121,8 +121,9 @@ discard block |
||
121 | 121 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
122 | 122 | $my_session_list = array(); |
123 | 123 | foreach($new_session_list as $item) { |
124 | - if (!empty($item['id_session'])) |
|
125 | - $my_session_list[] = $item['id_session']; |
|
124 | + if (!empty($item['id_session'])) { |
|
125 | + $my_session_list[] = $item['id_session']; |
|
126 | + } |
|
126 | 127 | } |
127 | 128 | if (!in_array($session_id, $my_session_list)) { |
128 | 129 | break; |
@@ -254,8 +255,9 @@ discard block |
||
254 | 255 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
255 | 256 | $my_session_list = array(); |
256 | 257 | foreach($new_session_list as $item) { |
257 | - if (!empty($item['id_session'])) |
|
258 | - $my_session_list[] = $item['id_session']; |
|
258 | + if (!empty($item['id_session'])) { |
|
259 | + $my_session_list[] = $item['id_session']; |
|
260 | + } |
|
259 | 261 | } |
260 | 262 | if (!in_array($session_id, $my_session_list)) { |
261 | 263 | break; |
@@ -384,8 +386,9 @@ discard block |
||
384 | 386 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
385 | 387 | $my_session_list = array(); |
386 | 388 | foreach($new_session_list as $item) { |
387 | - if (!empty($item['id_session'])) |
|
388 | - $my_session_list[] = $item['id_session']; |
|
389 | + if (!empty($item['id_session'])) { |
|
390 | + $my_session_list[] = $item['id_session']; |
|
391 | + } |
|
389 | 392 | } |
390 | 393 | if (!in_array($session_id, $my_session_list)) { |
391 | 394 | break; |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | echo json_encode($response_data); |
64 | 64 | } |
65 | 65 | break; |
66 | - case 'show_course_information' : |
|
67 | - require_once '../global.inc.php'; |
|
66 | + case 'show_course_information' : |
|
67 | + require_once '../global.inc.php'; |
|
68 | 68 | |
69 | - // Get the name of the database course. |
|
70 | - $tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION); |
|
71 | - $course_info = api_get_course_info($_GET['code']); |
|
69 | + // Get the name of the database course. |
|
70 | + $tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION); |
|
71 | + $course_info = api_get_course_info($_GET['code']); |
|
72 | 72 | |
73 | 73 | if ( |
74 | 74 | api_get_setting('course_catalog_hide_private') === 'true' && |
@@ -77,27 +77,27 @@ discard block |
||
77 | 77 | echo get_lang('PrivateAccess'); |
78 | 78 | break; |
79 | 79 | } |
80 | - //echo Display::tag('h2', $course_info['name']); |
|
81 | - //echo '<br />'; |
|
80 | + //echo Display::tag('h2', $course_info['name']); |
|
81 | + //echo '<br />'; |
|
82 | 82 | |
83 | - $sql = "SELECT * FROM $tbl_course_description |
|
83 | + $sql = "SELECT * FROM $tbl_course_description |
|
84 | 84 | WHERE c_id = ".$course_info['real_id']." AND session_id = 0 |
85 | 85 | ORDER BY id"; |
86 | - $result = Database::query($sql); |
|
87 | - if (Database::num_rows($result) > 0 ) { |
|
88 | - while ($description = Database::fetch_object($result)) { |
|
89 | - $descriptions[$description->id] = $description; |
|
90 | - } |
|
86 | + $result = Database::query($sql); |
|
87 | + if (Database::num_rows($result) > 0 ) { |
|
88 | + while ($description = Database::fetch_object($result)) { |
|
89 | + $descriptions[$description->id] = $description; |
|
90 | + } |
|
91 | 91 | // Function that displays the details of the course description in html. |
92 | - echo CourseManager::get_details_course_description_html( |
|
92 | + echo CourseManager::get_details_course_description_html( |
|
93 | 93 | $descriptions, |
94 | 94 | api_get_system_encoding(), |
95 | 95 | false |
96 | 96 | ); |
97 | - } else { |
|
98 | - echo get_lang('NoDescription'); |
|
99 | - } |
|
100 | - break; |
|
97 | + } else { |
|
98 | + echo get_lang('NoDescription'); |
|
99 | + } |
|
100 | + break; |
|
101 | 101 | case 'session_courses_lp_default': |
102 | 102 | /** |
103 | 103 | * @todo this functions need to belong to a class or a special |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id'; |
113 | 113 | $sord = $_REQUEST['sord']; //asc or desc |
114 | 114 | if (!in_array($sord, array('asc','desc'))) { |
115 | - $sord = 'desc'; |
|
115 | + $sord = 'desc'; |
|
116 | 116 | } |
117 | 117 | $session_id = intval($_REQUEST['session_id']); |
118 | 118 | $course_id = intval($_REQUEST['course_id']); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $my_session_list[] = $item['id_session']; |
128 | 128 | } |
129 | 129 | if (!in_array($session_id, $my_session_list)) { |
130 | - break; |
|
130 | + break; |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $date = '-'; |
313 | 313 | } |
314 | 314 | |
315 | - //Checking LP publicated and expired_on dates |
|
315 | + //Checking LP publicated and expired_on dates |
|
316 | 316 | |
317 | 317 | if (!empty($lp_item['publicated_on']) && $lp_item['publicated_on'] != '0000-00-00 00:00:00') { |
318 | 318 | $week_data = date('Y', api_strtotime($lp_item['publicated_on'], 'UTC')).' - '.get_week_from_day($lp_item['publicated_on']); |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | $date = '-'; |
441 | 441 | } |
442 | 442 | |
443 | - //Checking LP publicated and expired_on dates |
|
443 | + //Checking LP publicated and expired_on dates |
|
444 | 444 | if (!empty($lp_item['publicated_on']) && $lp_item['publicated_on'] != '0000-00-00 00:00:00') { |
445 | 445 | if ($now < api_strtotime($lp_item['publicated_on'], 'UTC')) { |
446 | 446 | continue; |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | |
495 | 495 | echo json_encode($response); |
496 | 496 | break; |
497 | - default: |
|
498 | - echo ''; |
|
497 | + default: |
|
498 | + echo ''; |
|
499 | 499 | } |
500 | 500 | exit; |