Proyectos de Subversion LeadersLinked - Backend

Rev

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