13
13
$ this_section = SECTION_PLATFORM_ADMIN ;
14
14
15
15
SessionManager::protectSession (null , false );
16
-
17
16
api_protect_limit_for_session_admin ();
18
17
19
18
$ formSent = 0 ;
@@ -35,6 +34,7 @@ function search_coachs($needle)
35
34
$ return = '' ;
36
35
37
36
if (!empty ($ needle )) {
37
+ $ needle = Database::escape_string ($ needle );
38
38
$ order_clause = api_sort_by_first_name () ? ' ORDER BY firstname, lastname, username ' : ' ORDER BY lastname, firstname, username ' ;
39
39
40
40
// search users where username or firstname or lastname begins likes $needle
@@ -166,44 +166,44 @@ function check_session_name($name)
166
166
$('#access').val(0);
167
167
$('#access').selectpicker('render');
168
168
accessSwitcher(0);
169
- $('#duration').val(parseInt(data.duration));
170
- } else {
169
+ $('#duration').val(parseInt(data.duration));
170
+ } else {
171
171
$('#access').val(1);
172
172
$('#access').selectpicker('render');
173
173
accessSwitcher(1);
174
-
174
+
175
175
var variables = [
176
176
'display_start_date',
177
177
'access_start_date',
178
178
'coach_access_start_date',
179
179
'display_end_date',
180
180
'access_end_date',
181
- 'coach_access_end_date'
182
- ];
181
+ 'coach_access_end_date'
182
+ ];
183
183
variables.forEach(function(variable) {
184
- var variableName = variable + '_to_local_time';
185
- if (data[variableName]) {
184
+ var variableName = variable + '_to_local_time';
185
+ if (data[variableName]) {
186
186
var parsedDate = $.datepicker.parseDateTime(
187
- 'yy-mm-dd',
188
- 'hh:mm:ss',
187
+ 'yy-mm-dd',
188
+ 'hh:mm:ss',
189
189
data[variableName]
190
- );
190
+ );
191
191
if (parsedDate) {
192
192
$('#'+variable).datetimepicker('setDate', parsedDate);
193
- }
193
+ }
194
194
}
195
195
});
196
196
}
197
-
197
+
198
198
$('[name=\'show_description\']').prop('checked', false);
199
199
if (data.show_description) {
200
200
$('[name=\'show_description\']').prop('checked', true);
201
201
}
202
-
202
+
203
203
$('[name=\'send_subscription_notification\']').prop('checked', false);
204
204
if (data.send_subscription_notification) {
205
205
$('[name=\'send_subscription_notification\']').prop('checked', true);
206
- }
206
+ }
207
207
208
208
$.each(data.extra_fields, function(i, item) {
209
209
var fieldName = 'extra_'+item.variable;
@@ -250,7 +250,7 @@ function check_session_name($name)
250
250
break;
251
251
case '4': // simple select
252
252
case '5': // multiple select
253
- var options = item.value.split(';');
253
+ var options = item.value.split(';');
254
254
$('#'+fieldName+'').val(options);
255
255
$('#'+fieldName+'').selectpicker('render');
256
256
break;
@@ -328,20 +328,20 @@ function check_session_name($name)
328
328
if (item.value) {
329
329
// $('input[name='+fieldName+']').val(item.value);
330
330
var url = ' " .$ urlUpload ."';
331
-
331
+
332
332
url = url + item.value;
333
-
333
+
334
334
var divFormGroup = fieldName + '-form-group';
335
335
var divWrapper = fieldName + '_crop_image';
336
336
var divPreview = fieldName + '_preview_image';
337
337
var divCropButton = fieldName + '_crop_button';
338
338
var cropResult = fieldName + '_crop_result';
339
-
339
+
340
340
$('[name=\''+cropResult+'\']').val('import_file_from_session::' + sessionId);
341
341
$('#' + divFormGroup).show();
342
342
$('#' + divWrapper).show();
343
343
$('#' + divCropButton).hide();
344
- $('#' + divPreview).attr('src', url);
344
+ $('#' + divPreview).attr('src', url);
345
345
//$('[name=\''+fieldName+'\']')
346
346
}
347
347
break;
0 commit comments