Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16845 | Rev 16906 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
2
use LeadersLinked\Model\CompanyMicrolearningUserLog;
3
 
4
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
5
$currentUser    = $this->currentUserHelper();
6
$roleName       = $currentUser->getUserTypeId();
7
 
8
$routeDatatable = $this->url('microlearning/students');
9
 
10
$allowEdit = $acl->isAllowed($roleName, 'microlearning/students/edit') ? 1 : 0;
11
$allowTimeline = $acl->isAllowed($roleName, 'microlearning/students/timeline') ? 1 : 0;
12
$allowChangePassword    = $acl->isAllowed($roleName, 'microlearning/students/change-password') ? 1 : 0;
13
$allowUnblock           = $acl->isAllowed($roleName, 'microlearning/students/unblock') ? 1 : 0;
14
 
16822 efrain 15
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
16
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
1 www 17
 
18
 
19
 
20
 
21
 
16822 efrain 22
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
23
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
24
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
1 www 25
 
16822 efrain 26
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
27
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
1 www 28
 
16822 efrain 29
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
30
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
31
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
32
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
1 www 33
 
34
 
35
 
36
 
16822 efrain 37
 
38
 
39
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
40
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
41
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
42
 
1 www 43
$activityApprovedTest = CompanyMicrolearningUserLog::ACTIVITY_APPROVED_TEST;
44
$activityCompletedCapsule = CompanyMicrolearningUserLog::ACTIVITY_COMPLETED_CAPSULE;
45
$activityCompletedTopic = CompanyMicrolearningUserLog::ACTIVITY_COMPLETED_TOPIC;
46
$activityRetakeATest = CompanyMicrolearningUserLog::ACTIVITY_RETAKE_A_TEST;
47
$activitySignin = CompanyMicrolearningUserLog::ACTIVITY_SIGNIN;
48
$activitySignout = CompanyMicrolearningUserLog::ACTIVITY_SIGNOUT;
49
$activityStartCapsule = CompanyMicrolearningUserLog::ACTIVITY_START_CAPSULE;
50
$activityStartTopic = CompanyMicrolearningUserLog::ACTIVITY_START_TOPIC;
51
$activityTakeATest = CompanyMicrolearningUserLog::ACTIVITY_TAKE_A_TEST;
52
$activityViewSlide = CompanyMicrolearningUserLog::ACTIVITY_VIEW_SLIDE;
53
 
16798 efrain 54
$this->headStyle()->captureStart();
55
echo <<<CSS
56
thead, tbody { display: block; }
1 www 57
 
16798 efrain 58
tbody {
59
    height: 200px;       /* Just for the demo          */
60
    overflow-y: auto;    /* Trigger vertical scroll    */
61
    overflow-x: hidden;  /* Hide the horizontal scroll */
62
}
1 www 63
 
16798 efrain 64
CSS;
65
$this->headStyle()->captureEnd();
66
 
67
 
1 www 68
$this->inlineScript()->captureStart();
69
echo <<<JS
70
 
71
 
72
jQuery( document ).ready(function( $ ) {
73
 
74
        var routeUpload = '';
75
        var routeNotification = '';
76
 
77
        $.validator.addMethod('passwordStrengthCheck', function(value) {
78
            return /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$^x%x*-]).{6,16}$/.test(value)
79
        }, 'ERROR_PASSWORD_STRENGTH');
80
 
81
 
82
        $.validator.setDefaults({
83
            debug: true,
84
            highlight: function(element) {
85
                $(element).addClass('is-invalid');
86
            },
87
            unhighlight: function(element) {
88
                $(element).removeClass('is-invalid');
89
            },
90
            errorElement: 'span',
91
            errorClass: 'error invalid-feedback',
92
            errorPlacement: function(error, element) {
93
                if(element.parent('.btn-file').length) {
94
                    error.insertAfter(element.parent().parent());
95
                } else if(element.parent('.toggle').length) {
96
                    error.insertAfter(element.parent().parent());
97
                } else {
98
                    error.insertAfter(element.parent());
99
                }
100
            }
101
        });
102
 
103
 
104
        $.fn.showFormErrorValidator = function(fieldname, errors) {
105
            var field = $(fieldname);
106
            if(field) {
107
                $(field).addClass('is-invalid');
108
 
109
 
110
                var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
111
                if(element.parent('.btn-file').length) {
112
                    error.insertAfter(element.parent().parent());
113
                } else if(element.parent('.toggle').length) {
114
                    error.insertAfter(element.parent().parent());
115
                } else {
116
                    error.insertAfter(element.parent());
117
                }
118
            }
119
        };
120
 
121
        var allowEdit       = $allowEdit;
122
        var allowTimeline   = $allowTimeline;
123
        var allowChangePassword = $allowChangePassword;
124
        var allowUnblock = $allowUnblock;
125
 
126
 
127
        var gridTable = $('#gridTable').dataTable( {
128
            'processing': true,
129
            'serverSide': true,
130
            'searching': true,
131
            'order': [[ 0, 'asc' ]],
132
            'ordering':  true,
133
            'ordenable' : true,
134
            'responsive': true,
135
            'select' : false,
136
        	'paging': true,
137
            'pagingType': 'simple_numbers',
138
 
139
 
140
    		'ajax': {
141
    			'url' : '$routeDatatable',
142
    			'type' : 'get',
143
 
144
                'beforeSend': function (request) {
145
                  NProgress.start();
146
                },
147
                'dataFilter': function(response) {
148
                    var response = jQuery.parseJSON( response );
149
 
150
                    var json                = {};
151
                    json.recordsTotal       = 0;
152
                    json.recordsFiltered    = 0;
153
                    json.data               = [];
154
 
155
                    if(response.success) {
156
 
157
 
158
                        json.recordsTotal       = response.data.total;
159
                        json.recordsFiltered    = response.data.total;
160
                        json.data               = response.data.items;
161
                    } else {
162
                        $.fn.showError(response.data)
163
                    }
164
 
165
                    return JSON.stringify( json );
166
                }
167
    		},
168
            'language' : {
169
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
170
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
171
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
172
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
173
                'sInfo':           'LABEL_DATATABLE_SINFO',
174
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
175
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
176
                'sInfoPostFix':    '',
177
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
178
                'sUrl':            '',
179
                'sInfoThousands':  ',',
180
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
181
                'oPaginate': {
182
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
183
                    'sLast':     'LABEL_DATATABLE_SLAST',
184
                    'sNext':     'LABEL_DATATABLE_SNEXT',
185
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
186
                },
187
                'oAria': {
188
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
189
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
190
                },
191
            },
192
            'drawCallback': function( settings ) {
193
                NProgress.done();
16822 efrain 194
 
1 www 195
            },
196
            'aoColumns': [
197
                { 'mDataProp': 'first_name' },
198
                { 'mDataProp': 'last_name' },
199
                { 'mDataProp': 'email' },
200
                { 'mDataProp': 'details' },
201
                { 'mDataProp': 'actions' },
202
    	    ],
203
            'columnDefs': [
204
                {
205
                    'targets': -2,
206
                    'orderable': false,
207
                    'render' : function ( data, type, row ) {
208
                        s = '';
209
                        s = s + 'LABEL_TOTAL_ASIGNED : ' + data['total_asigned'] + '<br>';
210
                        s = s + 'LABEL_TOTAL_WITHOUT_STARTING : ' + data['total_without_starting'] + '<br>';
211
                        s = s + 'LABEL_TOTAL_STARTED : ' + data['total_started'] + '<br>';
212
                        s = s + 'LABEL_TOTAL_COMPLETED : ' + data['total_completed'] + '<br>';
213
 
214
                        return s;
215
                    }
216
                },
217
 
218
 
219
                {
220
                    'targets': -1,
221
                    'orderable': false,
222
                    'render' : function ( data, type, row ) {
223
                        s = '';
224
 
225
                        if(allowEdit && data['link_edit']  ) {
226
                            s = s + '<button class="btn btn-primary btn-sm btn-edit" style="margin-top: 5px" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button><br>';
227
                        }
228
                        if(allowTimeline && data['link_timeline']  ) {
229
                            s = s + '<button class="btn btn-info btn-sm btn-timeline" style="margin-top: 5px" data-href="' + data['link_timeline']+ '" data-toggle="tooltip" title="LABEL_TIMELINE"><i class="fa fa-th-list"></i> LABEL_ACTIVITIES</button><br>';
230
                        }
231
                        if(allowChangePassword && data['link_change_password']) {
232
                            s = s + '<button class="btn btn-success btn-sm btn-change-password" style="margin-top: 5px" data-href="' + data['link_change_password']+ '" data-toggle="tooltip" title="LABEL_CHANGE_PASSWORD"><i class="fa fa-key"></i> LABEL_PASSWORD </button><br>';
233
                        }
234
                        if(allowUnblock && data['link_unblock']) {
235
                            s = s + '<button class="btn btn-info btn-sm  btn-unblock" style="margin-top: 5px" data-href="' + data['link_unblock']+ '" data-toggle="tooltip" title="LABEL_UNBLOCK"><i class="fa fa-unlock"></i> LABEL_UNBLOCK </button><br>';
236
                        }
237
 
238
 
239
 
240
                        return s;
241
                    }
242
                }
243
              ],
244
        });
245
 
246
    var validatorEdit  = $('#form-extend-user').validate({
247
        debug: true,
248
        onclick: false,
249
        onkeyup: false,
250
        ignore: [],
251
        rules: {
252
            'company_id': {
253
                required: false,
254
            },
255
            'function_id': {
256
                required: false,
257
            },
258
            'group_id': {
259
                required: false,
260
            },
261
            'institution_id': {
262
                required: false,
263
            },
264
            'program_id': {
265
                required: false,
266
            },
267
            'partner_id': {
268
                required: false,
269
            },
270
            'sector_id': {
271
                required: false,
272
            },
273
            'student_type_id': {
274
                required: false,
275
            },
276
        },
277
        submitHandler: function(form)
278
        {
279
 
280
            $('input[type="submit"]').prop('disabled', true);
281
 
282
            $.ajax({
283
                'dataType'  : 'json',
284
                'accept'    : 'application/json',
285
                'method'    : 'post',
286
                'url'       :  $('#form-extend-user').attr('action'),
287
                'data'      :  $('#form-extend-user').serialize(),
288
            }).done(function(response) {
289
                if(response['success']) {
290
                    $.fn.showSuccess(response['data']);
291
 
292
 
293
                    $('#modalExtendUser').modal('hide');
294
                    gridTable.api().ajax.reload(null, false);
295
                } else {
296
                    validatorEdit.resetForm();
297
                    if(jQuery.type(response['data']) == 'string') {
298
                        $.fn.showError(response['data']);
299
                    } else  {
300
                        $.each(response['data'], function( fieldname, errors ) {
301
                            $.fn.showFormErrorValidator('#form-extend-user #' + fieldname, errors);
302
                        });
303
                    }
304
                }
305
            }).fail(function( jqXHR, textStatus, errorThrown) {
306
                $.fn.showError(textStatus);
307
            }).always(function() {
308
                NProgress.done();
309
            });
310
            return false;
311
        },
312
        invalidHandler: function(form, validator) {
313
 
314
        }
315
    });
316
 
317
 
318
        $('body').on('click', 'button.btn-edit', function(e) {
319
            e.preventDefault();
320
 
321
            var url = $(this).data('href');
322
            $.ajax({
323
                'dataType'  : 'json',
324
                'accept'    : 'application/json',
325
                'method'    : 'get',
326
                'url'       :  url,
327
            }).done(function(response) {
328
                if(response['success']) {
329
                    $('#form-extend-user').attr('action',url);
330
                    $('#form-extend-user #first_name').val(response['data']['first_name']);
331
                    $('#form-extend-user #last_name').val(response['data']['last_name']);
332
                    $('#form-extend-user #email').val(response['data']['email']);
333
                    $('#form-extend-user #company_id').val(response['data']['company_id']);
334
                    $('#form-extend-user #function_id').val(response['data']['function_id']);
335
                    $('#form-extend-user #group_id').val(response['data']['group_id']);
336
                    $('#form-extend-user #institution_id').val(response['data']['institution_id']);
337
                    $('#form-extend-user #program_id').val(response['data']['program_id']);
338
                    $('#form-extend-user #partner_id').val(response['data']['partner_id']);
339
                    $('#form-extend-user #sector_id').val(response['data']['sector_id']);
340
                    $('#form-extend-user #student_type_id').val(response['data']['student_type_id']);
341
 
342
 
343
 
344
                    $('#modalExtendUser').modal('show');
345
                } else {
346
                    validatorEdit.resetForm();
347
                    if(jQuery.type(response['data']) == 'string') {
348
                        $.fn.showError(response['data']);
349
                    } else  {
350
                        $.each(response['data'], function( fieldname, errors ) {
351
                            $.fn.showFormErrorValidator('#form-extend-user #' + fieldname, errors);
352
                        });
353
                    }
354
                }
355
            }).fail(function( jqXHR, textStatus, errorThrown) {
356
                $.fn.showError(textStatus);
357
            }).always(function() {
358
                NProgress.done();
359
            });
360
        });
361
 
362
        $('body').on('click', 'button.btn-timeline', function(e) {
363
            e.preventDefault();
364
 
365
            var url = $(this).data('href');
366
            $.ajax({
367
                'dataType'  : 'json',
368
                'accept'    : 'application/json',
369
                'method'    : 'get',
370
                'url'       :  url,
371
            }).done(function(response) {
372
                if(response['success']) {
373
 
374
                    $('div.timeline').empty();
375
 
376
                    $.fn.renderTimeLine(response['data']);
377
 
378
                    $('#modalTimeline').modal('show');
379
                } else {
380
                    $.fn.showError(response['data']);
381
                }
382
            }).fail(function( jqXHR, textStatus, errorThrown) {
383
                $.fn.showError(textStatus);
384
            }).always(function() {
385
                NProgress.done();
386
            });
387
        });
388
 
389
 
390
        $('body').on('click', 'button.btn-cancel', function(e) {
391
            e.preventDefault();
392
            $('#modalExtendUser').modal('hide');
393
            $('#modalTimeline').modal('hide');
394
            $('#modalChangePassword').modal('hide');
395
        });
396
 
16822 efrain 397
    $('body').on('click', 'button.btn-unblock', function(e) {
398
        e.preventDefault();
399
        var action = $(this).data('href');
400
 
401
 
402
          swal.fire({
403
            title: 'LABEL_ARE_YOU_SURE',
404
            icon: 'question',
405
            cancelButtonText: 'LABEL_NO',
406
            showCancelButton: true,
407
            confirmButtonText: 'LABEL_YES'
408
          }).then((result) => {
409
            if (result.isConfirmed) {
410
 
411
                    NProgress.start();
412
                    $.ajax({
413
                        'dataType'  : 'json',
414
                        'accept'    : 'application/json',
415
                        'method'    : 'post',
416
                        'url'       :  action,
417
                    }).done(function(response) {
418
                        if(response['success']) {
419
                            $.fn.showSuccess(response['data']);
420
                            gridTable.api().ajax.reload(null, false);
421
                        } else {
422
                            $.fn.showError(response['data']);
423
                        }
424
                    }).fail(function( jqXHR, textStatus, errorThrown) {
425
                        $.fn.showError(textStatus);
426
                    }).always(function() {
427
                        NProgress.done();
428
                    });
429
            }
430
       });
431
    });
1 www 432
 
433
 
434
 
435
        $('body').on('click', 'button.btn-refresh', function(e) {
436
            e.preventDefault();
437
            gridTable.api().ajax.reload(null, false);
438
        });
439
 
440
        $.fn.renderTimeLine = function(data) {
441
 
442
            $.each(data['current']['items'],function(index, record) {
443
 
444
                switch(record['activity'])
445
                {
446
                    case '$activityApprovedTest' :
447
                        activity = 'LABEL_TIMELINE_ACTIVITY_APPROVED_TEST';
448
                        image = '/img/microlearning/approved-test.svg';
449
                        break;
450
 
451
                    case '$activityCompletedCapsule' :
452
                        activity = 'LABEL_TIMELINE_ACTIVITY_COMPLETED_CAPSULE';
453
                        image = '/img/microlearning/completed-capsule.svg';
454
                        break;
455
 
456
                    case '$activityCompletedTopic' :
457
                        activity = 'LABEL_TIMELINE_ACTIVITY_COMPLETED_TOPIC';
458
                        image = '/img/microlearning/completed-topic.svg';
459
                        break;
460
 
461
                    case '$activityRetakeATest' :
462
                        activity = 'LABEL_TIMELINE_ACTIVITY_RETAKE_A_TEST';
463
                        image = '/img/microlearning/retake-a-test.svg';
464
                        break;
465
 
466
                    case '$activitySignin' :
467
                        activity = 'LABEL_TIMELINE_ACTIVITY_SIGNIN';
468
                        image = '/img/microlearning/sign-in.svg';
469
                        break;
470
 
471
                    case '$activitySignout' :
472
                        activity = 'LABEL_TIMELINE_ACTIVITY_SIGNOUT';
473
                        image = '/img/microlearning/sign-out.svg';
474
                        break;
475
 
476
                    case '$activityStartCapsule' :
477
                        activity = 'LABEL_TIMELINE_ACTIVITY_START_CAPSULE';
478
                        image = '/img/microlearning/start-capsule.svg';
479
                        break;
480
 
481
                    case '$activityStartTopic' :
482
                        activity = 'LABEL_TIMELINE_ACTIVITY_START_TOPIC';
483
                        image = '/img/microlearning/start-topic.svg';
484
                        break;
485
 
486
                    case '$activityTakeATest' :
487
                        activity = 'LABEL_TIMELINE_ACTIVITY_TAKE_A_TEST';
488
                        image = '/img/microlearning/take-a-test.svg';
489
                        break;
490
 
491
                    case '$activityViewSlide' :
492
                        activity = 'LABEL_TIMELINE_ACTIVITY_VIEW_SLIDE';
493
                        image = '/img/microlearning/view-slide.svg';
494
                        break;
495
 
496
                    default :
497
                        activity = '';
498
                        break;
499
                }
500
 
501
                if(activity) {
502
 
503
 
504
                    var s = '<div>';
505
                    s = s + '<img src="' + image + '" style="width: 32px; height: auto" />';
506
                    s = s + '<div class="timeline-item">';
507
                    s = s + '<span class="time"><i class="fas fa-clock"></i> ' + record['added_on'] +'</span>';
508
                    s = s + '<h3 class="timeline-header">' + activity + '</h3>';
509
 
510
                    if(record['topic'] || record['capsule'] || record['slide']) {
511
                        s = s + '<div class="timeline-body">';
512
 
513
                        if(record['topic']) {
514
                            s = s + 'LABEL_TOPIC : ' + record['topic'] + '<br>';
515
                        }
516
                        if(record['capsule']) {
517
                            s = s + ' LABEL_CAPSULE : ' + record['capsule'] + '<br>';
518
                        }
519
                        if(record['slide']) {
520
                            s = s + ' LABEL_SLIDE : ' + record['slide'] + '<br>';
521
                        }
522
                        s = s + '</div>';
523
                    }
524
 
525
                    s = s + '</div>';
526
                    s = s + '</div>';
527
 
528
                    $('div.timeline').append(s);
529
                }
530
 
531
            });
532
        }
533
 
534
 
535
 var validatorChangePassword = $('#form-change-password').validate({
536
        debug: true,
537
        onclick: false,
538
        onkeyup: false,
539
        ignore: [':hidden'],
540
            rules: {
541
 
542
                'password': {
543
                    required: true,
544
                    minlength: 6,
545
                    maxlength: 16,
546
                    passwordStrengthCheck: true,
547
                },
548
                'confirmation' : {
549
                    required: true,
550
                    minlength: 6,
551
                    maxlength: 16,
552
                    equalTo: '#form-change-password #password'
553
                },
554
            },
555
            submitHandler: function(form)
556
            {
557
                NProgress.start();
558
                $.ajax({
559
                    'dataType'  : 'json',
560
                    'accept'    : 'application/json',
561
                    'method'    : 'post',
562
                    'url'       : $('#form-change-password').attr('action'),
563
                    'data'      : $('#form-change-password').serialize()
564
                 }).done(function(response) {
565
                    if(response.success) {
566
                        $.fn.showSuccess(response.data);
567
 
568
                        $('#modalChangePassword').modal('hide');
569
                         gridTable.api().ajax.reload(null, false);
570
                    } else {
571
                        if(jQuery.type(response.data) == 'string') {
572
                            $.fn.showError(response.data)
573
                        } else  {
574
                            $.each(response.data, function( fieldname, errors ) {
575
                                $.fn.showFormErrorValidator('#form-change-password #' + fieldname, errors);
576
                            });
577
                        }
578
                    }
579
                }).fail(function( jqXHR, textStatus, errorThrown) {
580
                    $.fn.showError(textStatus)
581
 
582
                }).always(function() {
583
                    NProgress.done();
584
                })
585
            },
586
            invalidHandler: function(form, validator) {
587
            }
588
        });
589
 
590
        $('body').on('click', 'button.btn-change-password', function(e) {
591
            e.preventDefault();
592
 
593
            NProgress.start();
594
            var action = $(this).data('href');
595
 
596
            $.ajax({
597
                'dataType'  : 'json',
598
                'accept'    : 'application/json',
599
                'method'    : 'get',
600
                'url'       :  action,
601
            }).done(function(response) {
602
                if(response['success']) {
603
 
604
                    $('#form-change-password').attr('action', action);
605
                    $('#form-change-password #first_name').val(response['data']['first_name']);
606
                    $('#form-change-password #last_name').val(response['data']['last_name']);
607
                    $('#form-change-password #email').val(response['data']['email']);
608
                    $('#form-change-password #password').val('');
609
                    $('#form-change-password #confirmation').val('');
610
                    validatorChangePassword.resetForm();
611
 
612
                    $('#modalChangePassword').modal('show');
613
                } else {
614
                    $.fn.showError(response['data']);
615
                }
616
            }).fail(function( jqXHR, textStatus, errorThrown) {
617
                $.fn.showError(textStatus);
618
            }).always(function() {
619
                NProgress.done();
620
            });
621
 
622
        });
623
 
624
 
625
 
626
    });
627
JS;
628
$this->inlineScript()->captureEnd();
629
?>
630
 
16891 efrain 631
<div class="container">
632
	<div class="card" id="">
633
	 	<div class="card-header">
634
	 		<h6 class="card-title">LABEL_STUDENTS</h6>
635
	 	</div>
636
	 	<div class="card-body">
637
	 		<div class="row">
638
	 	         <div class="col-12 mt-3">
639
 
640
	 	         <table id="gridTable" class="table   table-bordered">
1 www 641
                      		<thead>
642
        						<tr>
643
                                	<th>LABEL_FIRST_NAME</th>
644
                                	<th>LABEL_LAST_NAME</th>
645
                                	<th>LABEL_EMAIL</th>
646
                                  	<th>LABEL_CAPSULES</th>
647
                                  	<th>LABEL_ACTIONS</th>
648
                                </tr>
649
                       		</thead>
650
                         	<tbody>
651
                         	</tbody>
652
                    	</table>
16891 efrain 653
 
654
 
655
	 	         </div>
656
	 	     </div>
657
	 	</div>
1 www 658
 
16891 efrain 659
	</div>
660
</div>
1 www 661
 
16891 efrain 662
 
663
 
664
 
1 www 665
<!-- The Modal -->
666
<div class="modal" id="modalExtendUser">
667
	<div class="modal-dialog  modal-xl">
668
    	<div class="modal-content">
669
 
670
            <!-- Modal Header -->
671
      		<div class="modal-header">
16845 efrain 672
        		<h6 class="modal-title">LABEL_EDIT</h6>
16822 efrain 673
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 674
      		</div>
675
 
16891 efrain 676
 <?php
1 www 677
                    $form = $this->formExtendUser;
678
            		$form->setAttributes([
679
                        'method'    => 'post',
680
                        'name'      => 'form-extend-user',
681
                        'id'        => 'form-extend-user'
682
                    ]);
683
 
684
                    $form->prepare();
685
                    echo $this->form()->openTag($form);
686
 
687
                    ?>
16891 efrain 688
      		<div class="modal-body">
689
 
1 www 690
 
16891 efrain 691
                   	<div class="row">
692
                   		<div class="col-12 mt-3">
1 www 693
      					<label>LABEL_FIRST_NAME</label>
694
      					<input type="text" readonly="readonly" name="first_name" id="first_name" class="form-control" >
16891 efrain 695
      					</div>
696
      			 	</div>
697
      			 	<div class="row">
698
                   		<div class="col-12 mt-3">
1 www 699
      					<label>LABEL_LAST_NAME</label>
700
      					<input type="text" readonly="readonly" name="last_name" id="last_name" class="form-control" >
16891 efrain 701
      					</div>
702
      				</div>
703
      				<div class="row">
704
                   		<div class="col-12 mt-3">
1 www 705
      					<label>LABEL_EMAIL</label>
706
      					<input type="text" readonly="readonly" name="email" id="email" class="form-control" >
16891 efrain 707
      					</div>
708
                    </div>
1 www 709
                    <?php
710
                    $fields = [
711
                        [
712
                            'label' => 'LABEL_COMPANIES',
713
                            'name' => 'company_id',
714
                        ],
715
                        [
716
                            'label' => 'LABEL_FUNCTIONS',
717
                            'name' => 'function_id',
718
                        ],
719
                        [
720
                            'label' => 'LABEL_GROUPS',
721
                            'name' => 'group_id',
722
                        ],
723
                        [
724
                            'label' => 'LABEL_INSTITUTIONS',
725
                            'name' => 'institution_id',
726
                        ],
727
                        [
728
                            'label' => 'LABEL_PROGRAMS',
729
                            'name' => 'program_id',
730
                        ],
731
                        [
732
                            'label' => 'LABEL_PARTNERS',
733
                            'name' => 'partner_id',
734
                        ],
735
                        [
736
                            'label' => 'LABEL_SECTORS',
737
                            'name' => 'sector_id',
738
                        ],
739
                        [
740
                            'label' => 'LABEL_STUDENT_TYPES',
741
                            'name' => 'student_type_id',
742
                        ],
743
                    ];
744
 
745
                    $column = 0;
746
                    foreach($fields as $field) :
747
                        if($column == 0) {
748
                            echo '<div class="row">';
749
 
750
                        }
751
                        $column++;
752
 
753
                    ?>
754
 
755
 
16891 efrain 756
                             <div class="col-6 mt-3">
757
 
1 www 758
        					<?php
759
                            $element = $form->get( $field['name'] );
760
                            $element->setOptions(['label' => $field['label'] ]);
761
                            $element->setAttributes(['class' => 'form-control']);
762
 
763
                            echo $this->formLabel($element);
764
                            echo $this->formSelect($element);
765
                            ?>
16891 efrain 766
 
767
							</div>
1 www 768
						<?php
769
						if($column == 2) {
770
						    $column = 0;
771
						    echo '</div>';
772
						}
773
						?>
774
					<?php endforeach; ?>
775
						<?php if($column) {
776
						    echo '</div>';
777
						}
778
						?>
779
 
16891 efrain 780
 
781
 
1 www 782
      		</div>
783
 
784
            <!-- Modal footer -->
16891 efrain 785
      		<div class="modal-footer text-right">
786
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
16822 efrain 787
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 788
      		</div>
16891 efrain 789
      		<?php echo $this->form()->closeTag($form); ?>
1 www 790
 
791
    	</div>
792
	</div>
793
</div>
794
 
795
<!-- The Modal -->
796
<div class="modal" id="modalTimeline">
797
	<div class="modal-dialog  modal-xl">
798
    	<div class="modal-content">
799
 
800
            <!-- Modal Header -->
801
      		<div class="modal-header">
16845 efrain 802
        		<h6 class="modal-title">LABEL_TIMELINE</h6>
16822 efrain 803
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 804
      		</div>
805
 
806
            <!-- Modal body -->
807
      		<div class="modal-body">
808
       			<div class="row">
809
                  	<div class="col-md-12">
810
                   		<div class="timeline">
811
                   		</div>
812
                   	</div>
813
               	</div>
814
      		</div>
815
 
816
            <!-- Modal footer -->
16891 efrain 817
      		<div class="modal-footer text-right">
16822 efrain 818
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 819
      		</div>
820
 
821
    	</div>
822
	</div>
823
</div>
824
 
825
<!-- The Modal -->
826
<div class="modal" id="modalChangePassword">
827
	<div class="modal-dialog">
828
    	<div class="modal-content">
829
 
830
            <!-- Modal Header -->
831
      		<div class="modal-header">
16845 efrain 832
        		<h6 class="modal-title">LABEL_USERS</h6>
16822 efrain 833
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1 www 834
      		</div>
835
 
16891 efrain 836
<?php
1 www 837
                    $form = $this->formChangePassword;
838
            		$form->setAttributes([
839
                        'method'    => 'post',
840
                        'name'      => 'form-change-password',
841
                        'id'        => 'form-change-password'
842
                    ]);
843
 
844
                    $form->prepare();
845
                    echo $this->form()->openTag($form);
16891 efrain 846
                    ?>
847
      		<div class="modal-body">
848
 
849
                        <div class="row">
850
                        	<div class="col-12 mt-3">
1 www 851
        					<?php
852
                            $element = $form->get('first_name');
853
                            $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
854
                            $element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
855
 
856
                            echo $this->formLabel($element);
857
                            echo $this->formText($element);
858
                            ?>
16891 efrain 859
                            </div>
1 www 860
						</div>
16891 efrain 861
 
862
                        <div class="row">
863
                        	<div class="col-12 mt-3">
1 www 864
        					<?php
865
                            $element = $form->get('last_name');
866
                            $element->setOptions(['label' => 'LABEL_LAST_NAME']);
867
                            $element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
868
 
869
                            echo $this->formLabel($element);
870
                            echo $this->formText($element);
871
                            ?>
16891 efrain 872
                            </div>
1 www 873
						</div>
16891 efrain 874
 
875
                        <div class="row">
876
                        	<div class="col-12 mt-3">
1 www 877
        					<?php
878
                            $element = $form->get('email');
879
                            $element->setOptions(['label' => 'LABEL_EMAIL']);
880
                            $element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
881
 
882
                            echo $this->formLabel($element);
883
                            echo $this->formText($element);
884
                            ?>
16891 efrain 885
                            </div>
1 www 886
						</div>
16891 efrain 887
 
888
                        <div class="row">
889
                        	<div class="col-12 mt-3">
1 www 890
        					<?php
891
                            $element = $form->get('password');
892
                            $element->setOptions(['label' => 'LABEL_PASSWORD']);
893
                            $element->setAttributes(['class' => 'form-control']);
894
 
895
                            echo $this->formLabel($element);
896
                            echo $this->formPassword($element);
897
                            ?>
16891 efrain 898
                            </div>
1 www 899
						</div>
16891 efrain 900
 
901
                        <div class="row">
902
                        	<div class="col-12 mt-3">
1 www 903
                    	<?php
904
                            $element = $form->get('confirmation');
905
                            $element->setOptions(['label' => 'LABEL_CONFIRMATION']);
906
                            $element->setAttributes(['class' => 'form-control']);
907
 
908
                            echo $this->formLabel($element);
909
                            echo $this->formPassword($element);
910
                        ?>
16891 efrain 911
                        	</div>
1 www 912
						</div>
913
 
16891 efrain 914
 
1 www 915
      		</div>
916
 
917
            <!-- Modal footer -->
16891 efrain 918
      		<div class="modal-footer text-right">
919
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
16822 efrain 920
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
1 www 921
      		</div>
16891 efrain 922
      		<?php echo $this->form()->closeTag($form); ?>
1 www 923
 
924
    	</div>
925
	</div>
926
</div>
927
 
928