Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16943 | | Comparar con el anterior | Ultima modificación | Ver Log |

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