Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
15337 efrain 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
 
8
$routeDatatable = $this->url('settings/private-networks');
9
$routeAdd       = $this->url('settings/private-networks/add');
10
 
11
$allowAdd       = $acl->isAllowed($roleName, 'settings/private-networks/add') ? 1 : 0;
12
$allowEdit      = $acl->isAllowed($roleName, 'settings/private-networks/edit') ? 1 : 0;
13
$allowDelete    = $acl->isAllowed($roleName, 'settings/private-networks/delete') ? 1 : 0;
14
 
15
 
16822 efrain 16
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
17
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
15337 efrain 18
 
16822 efrain 19
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
15337 efrain 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'));
15337 efrain 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'));
15337 efrain 33
 
34
 
16822 efrain 35
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
36
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
15337 efrain 37
 
38
 
39
 
16822 efrain 40
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.js'));
41
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/i18n/es.js'));
42
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.css'));
15337 efrain 43
 
16927 efrain 44
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap5-theme/select2-bootstrap-5-theme.css'));
15337 efrain 45
 
46
 
16822 efrain 47
 
48
 
15337 efrain 49
$status_active = \LeadersLinked\Model\Network::STATUS_ACTIVE;
50
 
51
$this->inlineScript()->captureStart();
52
echo <<<JS
53
jQuery( document ).ready(function( $ ) {
54
    $.validator.addMethod('passwordStrengthCheck', function(value) {
55
        return /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$^x%x*-]).{6,16}$/.test(value)
56
    }, 'ERROR_PASSWORD_STRENGTH');
57
 
58
    var allowEdit   = $allowEdit;
59
    var allowDelete = $allowDelete;
60
 
61
    $.validator.setDefaults({
62
        debug: true,
63
        highlight: function(element) {
64
            $(element).addClass('is-invalid');
65
        },
66
        unhighlight: function(element) {
67
            $(element).removeClass('is-invalid');
68
        },
69
        errorElement: 'span',
70
        errorClass: 'error invalid-feedback',
71
        errorPlacement: function(error, element) {
16822 efrain 72
            error.insertAfter(element);
73
 
15337 efrain 74
        }
75
    });
76
 
16929 efrain 77
 
15337 efrain 78
 
79
    var gridTable = $('#gridTable').dataTable( {
80
        'processing': true,
81
        'serverSide': true,
82
        'searching': true,
83
        'order': [[ 0, 'asc' ]],
84
        'ordering':  true,
85
        'ordenable' : true,
86
        'responsive': true,
87
        'select' : false,
88
        'paging': true,
89
        'pagingType': 'simple_numbers',
90
    	'ajax': {
91
    	   'url' : '$routeDatatable',
92
    		'type' : 'get',
93
            'beforeSend': function (request) {
94
                NProgress.start();
95
            },
96
            'dataFilter': function(response) {
97
                var response = jQuery.parseJSON( response );
98
 
99
                var json                = {};
100
                json.recordsTotal       = 0;
101
                json.recordsFiltered    = 0;
102
                json.data               = [];
103
 
104
 
105
                if(response.success) {
106
                    json.recordsTotal       = response.data.total;
107
                    json.recordsFiltered    = response.data.total;
108
                    json.data               = response.data.items;
109
                } else {
110
                    $.fn.showError(response.data)
111
                }
112
 
113
                return JSON.stringify( json );
114
            }
115
        },
116
        'language' : {
117
            'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
118
            'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
119
            'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
120
            'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
121
            'sInfo':           'LABEL_DATATABLE_SINFO',
122
            'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
123
            'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
124
            'sInfoPostFix':    '',
125
            'sSearch':         'LABEL_DATATABLE_SSEARCH',
126
            'sUrl':            '',
127
            'sInfoThousands':  ',',
128
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
129
            'oPaginate': {
130
                'sFirst':    'LABEL_DATATABLE_SFIRST',
131
                'sLast':     'LABEL_DATATABLE_SLAST',
132
                'sNext':     'LABEL_DATATABLE_SNEXT',
133
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
134
            },
135
            'oAria': {
136
                'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
137
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
138
            },
139
        },
140
        'drawCallback': function( settings ) {
141
            NProgress.done();
16822 efrain 142
 
15337 efrain 143
        },
144
        'aoColumns': [
145
            { 'mDataProp': 'name' },
146
            { 'mDataProp': 'main_hostname' },
147
            { 'mDataProp': 'admin_hostname' },
148
            { 'mDataProp': 'status' },
149
            { 'mDataProp': 'actions' },
150
        ],
151
        'columnDefs': [
152
            {
153
                'targets':0,
154
                'className' : 'text-vertical-middle',
155
            },
156
            {
157
                'targets': -2,
158
                'orderable': false,
159
                'className' : 'text-center',
160
                'render' : function ( data, type, row ) {
161
 
16822 efrain 162
                    checked = data == 'a' ? 'checked' : '';
163
 
164
                    return '<div class="form-check">' +
16971 efrain 165
                        '<input type="checkbox" class="form-check-input" disabled="" ' + checked + '>' +
16822 efrain 166
                        '<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
15337 efrain 167
                }
168
            },
169
            {
170
                'targets': -1,
171
                'orderable': false,
172
                'render' : function ( data, type, row ) {
173
                    s = '';
174
 
175
                    if(allowEdit && data['link_edit']) {
16906 efrain 176
                        s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> LABEL_EDIT </button>&nbsp;';
15337 efrain 177
                    }
178
                    if(allowDelete  && data['link_delete']) {
179
                        s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>&nbsp;';
180
                    }
181
                    return s;
182
                }
183
            }
184
        ],
185
    });
186
 
187
    var validatorAdd = $('#form-add').validate({
188
        debug: true,
189
        onclick: false,
190
        onkeyup: false,
191
        ignore: [':hidden'],
192
        rules: {
193
            'first_name': {
194
                required: true,
195
                maxlength: 64,
196
            },
197
            'last_name': {
198
                required: true,
199
                maxlength: 64,
200
            },
201
            'email': {
202
                required: true,
203
                email: true,
204
                maxlength: 250,
205
            },
206
            'password': {
207
                required: true,
208
                minlength: 6,
209
                maxlength: 16,
210
                passwordStrengthCheck: true,
211
            },
212
            'confirmation' : {
213
                required: true,
214
                minlength: 6,
215
                maxlength: 16,
216
                equalTo: '#form-add #password'
217
            },
218
            'company': {
219
                required: true,
220
                maxlength: 128,
221
            },
222
            'company_size_id': {
223
                required: true,
224
            },
225
            'industry_id': {
226
               required: true,
227
            },
228
            'main_hostname': {
229
                required: true,
230
                maxlength: 250,
231
            },
15452 efrain 232
            'alternative_hostname': {
233
                required: false,
234
                maxlength: 250,
235
            },
15337 efrain 236
            'admin_hostname': {
237
                required: true,
15459 efrain 238
                maxlength: 250,
15337 efrain 239
            },
16948 efrain 240
            'service_hostname': {
241
                required: true,
242
                maxlength: 250,
243
                url: true,
244
            },
15831 efrain 245
            'moodle_name': {
246
                required: false,
247
                maxlength: 20,
248
            },
15459 efrain 249
            'moodle_url': {
250
                required: false,
251
                maxlength: 250,
15831 efrain 252
                url: true,
15459 efrain 253
            },
16985 efrain 254
            'microlearning_name': {
255
                required: false,
256
                maxlength: 250,
257
            },
15831 efrain 258
            'microlearning_appstore': {
259
                required: false,
260
                maxlength: 250,
261
                url: true,
262
            },
263
            'microlearning_playstore': {
264
                required: false,
265
                maxlength: 250,
266
                url: true,
267
            },
15459 efrain 268
            'relationship_user_mode': {
269
                required: true,
270
            },
271
            'status': {
272
                required: false,
273
            },
15441 efrain 274
            'theme_id': {
275
                required: true,
276
            },
15337 efrain 277
        },
278
        submitHandler: function(form)
279
        {
280
            NProgress.start();
281
            $.ajax({
282
                'dataType'  : 'json',
283
                'accept'    : 'application/json',
284
                'method'    : 'post',
285
                'url'       : $('#form-add').attr('action'),
286
                'data'      : $('#form-add').serialize()
287
            }).done(function(response) {
288
                if(response.success) {
289
                    $.fn.showSuccess(response.data);
290
 
16822 efrain 291
                    $('#card-add').hide();
292
                    $('#card-edit').hide();
293
                    $('#card-list').show();
15337 efrain 294
                    gridTable.api().ajax.reload(null, false);
295
                } else {
296
                    if(jQuery.type(response.data) == 'string') {
297
                        $.fn.showError(response.data)
298
                    } else  {
299
                        $.each(response.data, function( fieldname, errors ) {
300
                            $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
301
                        });
302
                    }
303
                }
304
            }).fail(function( jqXHR, textStatus, errorThrown) {
305
                $.fn.showError(textStatus)
306
 
307
            }).always(function() {
308
                NProgress.done();
309
            })
310
        },
311
        invalidHandler: function(form, validator) {
312
        }
313
    });
314
 
315
    var validatorEdit = $('#form-edit').validate({
316
        debug: true,
317
        onclick: false,
318
        onkeyup: false,
319
        ignore: [':hidden'],
320
        rules: {
15441 efrain 321
            'theme_id' : {
322
                required: true,
323
            },
15337 efrain 324
            'name': {
325
                required: true,
326
                maxlength: 128,
327
            },
328
            'main_hostname': {
329
                required: true,
330
                maxlength: 250,
331
            },
15452 efrain 332
            'alternative_hostname': {
333
                required: false,
334
                maxlength: 250,
335
            },
15337 efrain 336
            'admin_hostname': {
337
                required: true,
338
                maxlength: 250,
339
            },
16948 efrain 340
            'service_hostname': {
341
                required: true,
342
                maxlength: 250,
343
            },
15459 efrain 344
            'status': {
345
                required: false,
15337 efrain 346
            },
15831 efrain 347
            'moodle_name': {
348
                required: false,
349
                maxlength: 20,
350
            },
351
 
15459 efrain 352
            'moodle_url': {
353
                required: false,
354
                maxlength: 250,
355
                 url: true,
356
            },
16985 efrain 357
            'microlearning_name': {
358
                required: false,
359
                maxlength: 250,
360
            },
15831 efrain 361
            'microlearning_appstore': {
362
                required: false,
363
                maxlength: 250,
364
                url: true,
365
            },
366
            'microlearning_playstore': {
367
                required: false,
368
                maxlength: 250,
369
                url: true,
370
            },
15459 efrain 371
            'relationship_user_mode': {
372
                required: true,
373
            },
15441 efrain 374
            'theme_id': {
375
                required: true,
376
            },
15337 efrain 377
        },
378
        submitHandler: function(form)
379
        {
380
            NProgress.start();
381
            $.ajax({
382
                'dataType'  : 'json',
383
                'accept'    : 'application/json',
384
                'method'    : 'post',
385
                'url'       : $('#form-edit').attr('action'),
386
                'data'      : $('#form-edit').serialize()
387
            }).done(function(response) {
388
                if(response.success) {
389
                    $.fn.showSuccess(response.data);
390
 
16822 efrain 391
                    $('#card-add').hide();
392
                    $('#card-edit').hide();
393
                    $('#card-list').show();
15337 efrain 394
                    gridTable.api().ajax.reload(null, false);
395
                } else {
396
                    if(jQuery.type(response.data) == 'string') {
397
                        $.fn.showError(response.data)
398
                    } else  {
399
                        $.each(response.data, function( fieldname, errors ) {
400
                            $.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
401
                        });
402
                    }
403
                }
404
            }).fail(function( jqXHR, textStatus, errorThrown) {
405
                $.fn.showError(textStatus)
406
 
407
            }).always(function() {
408
                NProgress.done();
409
            })
410
        },
411
        invalidHandler: function(form, validator) {
412
        }
413
    });
414
 
415
    $('body').on('click', 'button.btn-add', function(e) {
416
        e.preventDefault();
417
 
418
        $('#form-add #first_name').val('');
419
        $('#form-add #last_name').val('');
420
        $('#form-add #email').val('');
421
        $('#form-add #password').val('');
422
        $('#form-add #confirmation').val('');
423
        $('#form-add #company').val('');
424
        $('#form-add #company_size_id').val('').trigger('change');
425
        $('#form-add #industry_id').val('').trigger('change');
426
        $('#form-add #main_hostname').val('');
15452 efrain 427
        $('#form-add #alternative_hostname').val('');
15337 efrain 428
        $('#form-add #admin_hostname').val('');
16948 efrain 429
        $('#form-add #service_hostname').val('');
15831 efrain 430
        $('#form-add #moodle_name').val('');
15459 efrain 431
        $('#form-add #moodle_url').val('');
16985 efrain 432
        $('#form-add #microlearning_name').val('');
15831 efrain 433
        $('#form-add #microlearning_appstore').val('');
434
        $('#form-add #microlearning_playstore').val('');
15459 efrain 435
        $('#form-add #relationship_user_mode').val('').trigger('change');
15441 efrain 436
        $('#form-add #theme_id').val('');
15337 efrain 437
 
438
        validatorAdd.resetForm();
16822 efrain 439
 
440
        $('#card-list').hide();
441
        $('#card-edit').hide();
442
        $('#card-add').show();
15337 efrain 443
    });
444
 
445
    $('body').on('click', 'button.btn-edit', function(e) {
446
        e.preventDefault();
447
        NProgress.start();
448
        var action = $(this).data('href');
449
 
450
        $.ajax({
451
            'dataType'  : 'json',
452
            'method'    : 'get',
453
            'url'       :  action,
454
        }).done(function(response) {
455
            if(response['success']) {
456
 
457
                $('#form-edit').attr('action', action);
458
                $('#form-edit #name').val(response['data']['name']);
459
                $('#form-edit #main_hostname').val(response['data']['main_hostname']);
15452 efrain 460
                $('#form-edit #alternative_hostname').val(response['data']['alternative_hostname']);
15337 efrain 461
                $('#form-edit #admin_hostname').val(response['data']['admin_hostname']);
16948 efrain 462
                $('#form-edit #service_hostname').val(response['data']['service_hostname']);
15337 efrain 463
                $('#form-edit #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
15441 efrain 464
                $('#form-edit #theme_id').val(response['data']['theme_id']);
15831 efrain 465
                $('#form-edit #moodle_name').val(response['data']['moodle_name']);
15459 efrain 466
                $('#form-edit #moodle_url').val(response['data']['moodle_url']);
16985 efrain 467
                $('#form-edit #microlearning_name').val(response['data']['microlearning_name']);
15831 efrain 468
                $('#form-edit #microlearning_appstore').val(response['data']['microlearning_appstore']);
469
                $('#form-edit #microlearning_playstore').val(response['data']['microlearning_playstore']);
15459 efrain 470
                $('#form-edit #relationship_user_mode').val(response['data']['relationship_user_mode']).trigger('change');
15337 efrain 471
                validatorEdit.resetForm();
472
 
16822 efrain 473
                $('#card-list').hide();
474
                $('#card-add').hide();
475
                $('#card-edit').show();
15337 efrain 476
            } else {
477
                $.fn.showError(response['data']);
478
            }
479
        }).fail(function( jqXHR, textStatus, errorThrown) {
480
            $.fn.showError(textStatus);
481
        }).always(function() {
482
            NProgress.done();
483
        });
484
    });
16822 efrain 485
 
486
 
487
    $('body').on('click', 'button.btn-cancel', function(e) {
488
        e.preventDefault();
489
 
490
        $('#card-add').hide();
491
        $('#card-edit').hide();
492
        $('#card-list').show();
493
    });
15337 efrain 494
 
495
 
496
    $('body').on('click', 'button.btn-refresh', function(e) {
497
        e.preventDefault();
498
        gridTable.api().ajax.reload(null, false);
499
    });
500
 
16822 efrain 501
    $('body').on('click', 'button.btn-delete', function(e) {
502
        e.preventDefault();
503
        var action = $(this).data('href');
15337 efrain 504
 
505
 
16822 efrain 506
          swal.fire({
507
            title: 'LABEL_ARE_YOU_SURE',
508
            icon: 'question',
509
            cancelButtonText: 'LABEL_NO',
510
            showCancelButton: true,
511
            confirmButtonText: 'LABEL_YES'
512
          }).then((result) => {
513
            if (result.isConfirmed) {
514
 
515
                    NProgress.start();
516
                    $.ajax({
517
                        'dataType'  : 'json',
518
                        'accept'    : 'application/json',
519
                        'method'    : 'post',
520
                        'url'       :  action,
521
                    }).done(function(response) {
522
                        if(response['success']) {
523
                            $.fn.showSuccess(response['data']);
524
                            gridTable.api().ajax.reload(null, false);
525
                        } else {
526
                            $.fn.showError(response['data']);
527
                        }
528
                    }).fail(function( jqXHR, textStatus, errorThrown) {
529
                        $.fn.showError(textStatus);
530
                    }).always(function() {
531
                        NProgress.done();
532
                    });
533
            }
534
          });
535
 
536
 
537
    });
538
 
539
 
540
 
15337 efrain 541
    $('body').on('click', 'button.btn-cancel', function(e) {
542
        e.preventDefault();
543
        $('#modalAdd').modal('hide');
544
        $('#modalEdit').modal('hide');
545
    });
546
 
547
    $('#form-add #company_size_id').select2({
16918 efrain 548
        theme: 'bootstrap-5',
15337 efrain 549
        width: '100%',
550
    });
551
 
552
    $('#form-add #industry_id').select2({
16918 efrain 553
        theme: 'bootstrap-5',
15337 efrain 554
        width: '100%',
555
    });
556
 
557
    $('#form-edit #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
558
 
559
});
560
JS;
561
$this->inlineScript()->captureEnd();
562
?>
563
 
564
 
16822 efrain 565
 <div class="container">
566
 	<div class="card" id="card-list">
567
 		<div class="card-body">
568
 			<h6 class="card-title">LABEL_PRIVATE_NETWORKS</h6>
569
     	    <div class="row">
16891 efrain 570
                <div class="col-12 mt-3">
15337 efrain 571
 
16912 efrain 572
               		<table id="gridTable" class="table  table-bordered">
16822 efrain 573
               			<thead>
574
            				<tr>
575
                       			<th>LABEL_NAME</th>
576
                          		<th>LABEL_MAIN_HOSTNAME</th>
577
                          		<th>LABEL_ADMIN_HOSTNAME</th>
578
                              	<th>LABEL_ACTIVE</th>
579
                              	<th>LABEL_ACTIONS</th>
580
                       		</tr>
581
                       	</thead>
582
                  		<tbody>
583
                   		</tbody>
584
             		 </table>
585
     			</div>
15337 efrain 586
 
16822 efrain 587
			</div>
588
    	</div>
589
    	<div class="card-footer clearfix">
590
        	<div style="float:right;">
16992 efrain 591
         		<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
16822 efrain 592
             	<?php if ($allowAdd) : ?>
593
             	<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
594
    			<?php endif; ?>
595
    		</div>
596
    	</div>
597
    </div>
598
 
599
	<div class="card" id="card-add" style="display: none">
600
		<?php
15337 efrain 601
                    $form = $this->formAdd;
602
            		$form->setAttributes([
603
                        'method'    => 'post',
604
                        'name'      => 'form-add',
605
                        'id'        => 'form-add',
606
            		    'action'    => $routeAdd,
607
                    ]);
608
 
609
                    $form->prepare();
610
                    echo $this->form()->openTag($form);
16822 efrain 611
        ?>
612
 		<div class="card-body">
613
 			<h6 class="card-title">LABEL_NEW_PRIVATE_NETWORK</h6>
614
 
615
 			<div class="row">
16841 efrain 616
                      	<div class="col-12  mr-3">
15337 efrain 617
        					<?php
618
        					$element = $form->get('first_name');
619
        					$element->setOptions(['label' => 'LABEL_FIRST_NAME']);
620
                            $element->setAttributes(['class' => 'form-control']);
621
 
622
                            echo $this->formLabel($element);
623
                            echo $this->formText($element);
624
                            ?>
16822 efrain 625
						</div>
626
					</div>
627
                    <div class="row">
16841 efrain 628
                      	<div class="col-12  mr-3">
15337 efrain 629
        					<?php
630
        					$element = $form->get('last_name');
631
        					$element->setOptions(['label' => 'LABEL_LAST_NAME']);
632
                            $element->setAttributes(['class' => 'form-control']);
633
 
634
                            echo $this->formLabel($element);
635
                            echo $this->formText($element);
636
                            ?>
637
						</div>
16822 efrain 638
					</div>
639
                    <div class="row">
16841 efrain 640
                      	<div class="col-12  mr-3">
15337 efrain 641
                    	<?php
642
                    	    $element = $form->get('email');
643
                    	    $element->setOptions(['label' => 'LABEL_EMAIL']);
644
                            $element->setAttributes(['class' => 'form-control']);
645
 
646
                            echo $this->formLabel($element);
647
                            echo $this->formText($element);
648
                        ?>
649
						</div>
16822 efrain 650
					</div>
651
                    <div class="row">
16841 efrain 652
                      	<div class="col-12  mr-3">
15337 efrain 653
                    	<?php
654
                    	    $element = $form->get('password');
655
                    	    $element->setOptions(['label' => 'LABEL_PASSWORD']);
656
                            $element->setAttributes(['class' => 'form-control']);
657
 
658
                            echo $this->formLabel($element);
659
                            echo $this->formPassword($element);
660
                        ?>
661
						</div>
16822 efrain 662
					</div>
663
                    <div class="row">
16841 efrain 664
                      	<div class="col-12  mr-3">
15337 efrain 665
                    	<?php
666
                    	    $element = $form->get('confirmation');
667
                    	    $element->setOptions(['label' => 'LABEL_CONFIRMATION']);
668
                            $element->setAttributes(['class' => 'form-control']);
669
 
670
                            echo $this->formLabel($element);
671
                            echo $this->formPassword($element);
672
                        ?>
673
						</div>
16822 efrain 674
					</div>
675
                    <div class="row">
16841 efrain 676
                      	<div class="col-12  mr-3">
15337 efrain 677
                    	<?php
678
                    	    $element = $form->get('company');
679
                    	    $element->setOptions(['label' => 'LABEL_COMPANY']);
680
                            $element->setAttributes(['class' => 'form-control']);
681
 
682
                            echo $this->formLabel($element);
683
                            echo $this->formText($element);
684
                        ?>
685
						</div>
16822 efrain 686
					</div>
687
                    <div class="row">
16841 efrain 688
                      	<div class="col-12  mr-3">
15337 efrain 689
                    	<?php
690
                    	    $element = $form->get('industry_id');
691
                    	    $element->setOptions(['label' => 'LABEL_INDUSTRY']);
692
                            $element->setAttributes(['class' => 'form-control']);
693
 
694
                            echo $this->formLabel($element);
695
                            echo $this->formSelect($element);
696
                        ?>
697
						</div>
16822 efrain 698
					</div>
699
                    <div class="row">
16841 efrain 700
                      	<div class="col-12  mr-3">
15337 efrain 701
                    	<?php
702
                    	    $element = $form->get('company_size_id');
703
                    	    $element->setOptions(['label' => 'LABEL_COMPANY_SIZE']);
704
                            $element->setAttributes(['class' => 'form-control']);
705
 
706
                            echo $this->formLabel($element);
707
                            echo $this->formSelect($element);
708
                        ?>
709
						</div>
16822 efrain 710
					</div>
711
                    <div class="row">
16841 efrain 712
                      	<div class="col-12  mr-3">
15337 efrain 713
                    	<?php
714
                    	    $element = $form->get('main_hostname');
715
                    	    $element->setOptions(['label' => 'LABEL_MAIN_HOSTNAME']);
716
                            $element->setAttributes(['class' => 'form-control']);
717
 
718
                            echo $this->formLabel($element);
719
                            echo $this->formText($element);
720
                        ?>
721
						</div>
16822 efrain 722
					</div>
723
                    <div class="row">
16841 efrain 724
                      	<div class="col-12  mr-3">
15337 efrain 725
                    	<?php
15452 efrain 726
                    	    $element = $form->get('alternative_hostname');
727
                    	    $element->setOptions(['label' => 'LABEL_ALTERNATIVE_HOSTNAME']);
728
                            $element->setAttributes(['class' => 'form-control']);
729
 
730
                            echo $this->formLabel($element);
731
                            echo $this->formText($element);
732
                        ?>
733
						</div>
16822 efrain 734
					</div>
735
                    <div class="row">
16841 efrain 736
                      	<div class="col-12  mr-3">
15452 efrain 737
                    	<?php
15337 efrain 738
                    	    $element = $form->get('admin_hostname');
739
                    	    $element->setOptions(['label' => 'LABEL_ADMIN_HOSTNAME']);
740
                            $element->setAttributes(['class' => 'form-control']);
741
 
742
                            echo $this->formLabel($element);
743
                            echo $this->formText($element);
744
                        ?>
745
						</div>
16822 efrain 746
					</div>
16948 efrain 747
					<div class="row">
748
                      	<div class="col-12  mr-3">
749
                    	<?php
750
                    	    $element = $form->get('service_hostname');
751
                    	    $element->setOptions(['label' => 'LABEL_SERVICE_HOSTNAME']);
752
                            $element->setAttributes(['class' => 'form-control']);
753
 
754
                            echo $this->formLabel($element);
755
                            echo $this->formText($element);
756
                        ?>
757
						</div>
758
					</div>
16822 efrain 759
                    <div class="row">
16841 efrain 760
                      	<div class="col-12  mr-3">
15441 efrain 761
                    	<?php
15831 efrain 762
                    	    $element = $form->get('moodle_name');
763
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_NAME']);
764
                            $element->setAttributes(['class' => 'form-control']);
765
 
766
                            echo $this->formLabel($element);
767
                            echo $this->formText($element);
768
                        ?>
769
						</div>
16822 efrain 770
					</div>
771
                    <div class="row">
16841 efrain 772
                      	<div class="col-12  mr-3">
15831 efrain 773
                    	<?php
15459 efrain 774
                    	    $element = $form->get('moodle_url');
775
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_URL']);
776
                            $element->setAttributes(['class' => 'form-control']);
777
 
778
                            echo $this->formLabel($element);
779
                            echo $this->formText($element);
780
                        ?>
781
						</div>
16822 efrain 782
					</div>
16985 efrain 783
					<div class="row">
784
                      	<div class="col-12  mr-3">
785
                    	<?php
786
                    	    $element = $form->get('microlearning_name');
787
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_NAME']);
788
                            $element->setAttributes(['class' => 'form-control']);
789
 
790
                            echo $this->formLabel($element);
791
                            echo $this->formText($element);
792
                        ?>
793
						</div>
794
					</div>
16822 efrain 795
                    <div class="row">
16841 efrain 796
                      	<div class="col-12  mr-3">
15831 efrain 797
                    	<?php
798
                    	    $element = $form->get('microlearning_appstore');
799
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_APPSTORE']);
800
                            $element->setAttributes(['class' => 'form-control']);
801
 
802
                            echo $this->formLabel($element);
803
                            echo $this->formText($element);
804
                        ?>
805
						</div>
16822 efrain 806
					</div>
807
                    <div class="row">
16841 efrain 808
                      	<div class="col-12  mr-3">
15831 efrain 809
                    	<?php
810
                    	    $element = $form->get('microlearning_playstore');
811
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_PLAYSTORE']);
812
                            $element->setAttributes(['class' => 'form-control']);
813
 
814
                            echo $this->formLabel($element);
815
                            echo $this->formText($element);
816
                        ?>
817
						</div>
16822 efrain 818
					</div>
819
                    <div class="row">
16841 efrain 820
                      	<div class="col-12  mr-3">
15459 efrain 821
                    	<?php
822
                    	    $element = $form->get('relationship_user_mode');
17003 efrain 823
                    	    $element->setOptions(['label' => 'LABEL_RELATIONSHIP_USER_MODE']);
15459 efrain 824
                            $element->setAttributes(['class' => 'form-control']);
825
 
826
                            echo $this->formLabel($element);
827
                            echo $this->formSelect($element);
828
                        ?>
829
						</div>
16822 efrain 830
					</div>
831
                    <div class="row">
16841 efrain 832
                      	<div class="col-12  mr-3">
15459 efrain 833
                    	<?php
15441 efrain 834
                    	    $element = $form->get('theme_id');
835
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
836
                            $element->setAttributes(['class' => 'form-control']);
15337 efrain 837
 
15441 efrain 838
                            echo $this->formLabel($element);
839
                            echo $this->formSelect($element);
840
                        ?>
841
						</div>
16822 efrain 842
					</div>
843
 
844
 		</div>
845
 		<div class="card-footer text-right">
846
 			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
847
        	<button type="button" class="btn btn-light btn-cancel">LABEL_CLOSE</button>
848
 
849
 		</div>
850
 		<?php echo $this->form()->closeTag($form); ?>
851
 	</div>
852
 
853
	<div class="card" id="card-edit" style="display: none">
854
	<?php
15337 efrain 855
                    $form = $this->formEdit;
856
            		$form->setAttributes([
857
                        'method'    => 'post',
858
                        'name'      => 'form-edit',
859
                        'id'        => 'form-edit',
860
 
861
                    ]);
862
 
863
                    $form->prepare();
864
                    echo $this->form()->openTag($form);
16822 efrain 865
                    ?>
866
 		<div class="card-body">
867
 			<h6 class="card-title">LABEL_EDIT_PRIVATE_NETWORK</h6>
868
 
869
 			<div class="row">
16841 efrain 870
                      	<div class="col-12  mr-3">
15337 efrain 871
                    	<?php
872
                    	    $element = $form->get('name');
873
                    	    $element->setOptions(['label' => 'LABEL_NAME']);
874
                            $element->setAttributes(['class' => 'form-control']);
875
 
876
                            echo $this->formLabel($element);
877
                            echo $this->formText($element);
878
                        ?>
879
						</div>
16822 efrain 880
					</div>
881
                    <div class="row">
16841 efrain 882
                      	<div class="col-12  mr-3">
15337 efrain 883
                    	<?php
884
                    	    $element = $form->get('main_hostname');
885
                    	    $element->setOptions(['label' => 'LABEL_MAIN_HOSTNAME']);
886
                            $element->setAttributes(['class' => 'form-control']);
887
 
888
                            echo $this->formLabel($element);
889
                            echo $this->formText($element);
890
                        ?>
891
						</div>
16822 efrain 892
					</div>
893
                    <div class="row">
16841 efrain 894
                      	<div class="col-12  mr-3">
15337 efrain 895
                    	<?php
15452 efrain 896
                    	    $element = $form->get('alternative_hostname');
897
                    	    $element->setOptions(['label' => 'LABEL_ALTERNATIVE_HOSTNAME']);
898
                            $element->setAttributes(['class' => 'form-control']);
899
 
900
                            echo $this->formLabel($element);
901
                            echo $this->formText($element);
902
                        ?>
903
						</div>
16822 efrain 904
					</div>
15452 efrain 905
 
16822 efrain 906
                    <div class="row">
16841 efrain 907
                      	<div class="col-12  mr-3">
15452 efrain 908
                    	<?php
15337 efrain 909
                    	    $element = $form->get('admin_hostname');
910
                    	    $element->setOptions(['label' => 'LABEL_ADMIN_HOSTNAME']);
911
                            $element->setAttributes(['class' => 'form-control']);
912
 
913
                            echo $this->formLabel($element);
914
                            echo $this->formText($element);
915
                        ?>
916
						</div>
16822 efrain 917
					</div>
16948 efrain 918
					<div class="row">
919
                      	<div class="col-12  mr-3">
920
                    	<?php
921
                    	    $element = $form->get('service_hostname');
922
                    	    $element->setOptions(['label' => 'LABEL_SERVICE_HOSTNAME']);
923
                            $element->setAttributes(['class' => 'form-control']);
924
 
925
                            echo $this->formLabel($element);
926
                            echo $this->formText($element);
927
                        ?>
928
						</div>
929
					</div>
16822 efrain 930
                    <div class="row">
16841 efrain 931
                      	<div class="col-12  mr-3">
15337 efrain 932
                            <?php
933
                            $element = $form->get('status');
934
                            echo $this->formCheckbox($element);
935
                            ?>
16822 efrain 936
						</div>
937
					</div>
938
                    <div class="row">
16841 efrain 939
                      	<div class="col-12  mr-3">
15459 efrain 940
                    	<?php
15831 efrain 941
                    	    $element = $form->get('moodle_name');
942
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_NAME']);
943
                            $element->setAttributes(['class' => 'form-control']);
944
 
945
                            echo $this->formLabel($element);
946
                            echo $this->formText($element);
947
                        ?>
948
						</div>
16822 efrain 949
                    <div class="row">
16841 efrain 950
                      	<div class="col-12  mr-3">
15831 efrain 951
                    	<?php
15459 efrain 952
                    	    $element = $form->get('moodle_url');
953
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_URL']);
954
                            $element->setAttributes(['class' => 'form-control']);
955
 
956
                            echo $this->formLabel($element);
957
                            echo $this->formText($element);
958
                        ?>
959
						</div>
16822 efrain 960
					</div>
16988 efrain 961
							<div class="row">
962
                      	<div class="col-12  mr-3">
963
                    	<?php
964
                    	    $element = $form->get('microlearning_name');
965
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_NAME']);
966
                            $element->setAttributes(['class' => 'form-control']);
967
 
968
                            echo $this->formLabel($element);
969
                            echo $this->formText($element);
970
                        ?>
971
						</div>
972
					</div>
16822 efrain 973
                    <div class="row">
16841 efrain 974
                      	<div class="col-12  mr-3">
15831 efrain 975
                    	<?php
976
                    	    $element = $form->get('microlearning_appstore');
977
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_APPSTORE']);
978
                            $element->setAttributes(['class' => 'form-control']);
979
 
980
                            echo $this->formLabel($element);
981
                            echo $this->formText($element);
982
                        ?>
983
						</div>
16822 efrain 984
					</div>
985
                    <div class="row">
16841 efrain 986
                      	<div class="col-12  mr-3">
15831 efrain 987
                    	<?php
988
                    	    $element = $form->get('microlearning_playstore');
989
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_PLAYSTORE']);
990
                            $element->setAttributes(['class' => 'form-control']);
991
 
992
                            echo $this->formLabel($element);
993
                            echo $this->formText($element);
994
                        ?>
995
						</div>
16822 efrain 996
					</div>
997
                    <div class="row">
16841 efrain 998
                      	<div class="col-12  mr-3">
15459 efrain 999
                    	<?php
1000
                    	    $element = $form->get('relationship_user_mode');
17003 efrain 1001
                    	    $element->setOptions(['label' => 'LABEL_RELATIONSHIP_USER_MODE']);
15459 efrain 1002
                            $element->setAttributes(['class' => 'form-control']);
1003
 
1004
                            echo $this->formLabel($element);
1005
                            echo $this->formSelect($element);
1006
                        ?>
1007
						</div>
16822 efrain 1008
					</div>
1009
                    <div class="row">
16841 efrain 1010
                      	<div class="col-12  mr-3">
15441 efrain 1011
                    	<?php
1012
                    	    $element = $form->get('theme_id');
1013
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
1014
                            $element->setAttributes(['class' => 'form-control']);
15337 efrain 1015
 
15441 efrain 1016
                            echo $this->formLabel($element);
1017
                            echo $this->formSelect($element);
1018
                        ?>
1019
						</div>
16822 efrain 1020
					</div>
1021
 
1022
 		</div>
1023
 		<div class="card-footer text-right">
1024
 			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1025
        	<button type="button" class="btn btn-light btn-cancel">LABEL_CLOSE</button>
1026
 
1027
 		</div>
1028
 		<?php echo $this->form()->closeTag($form); ?>
1029
 	</div>
1030
</div>
15441 efrain 1031
 
16822 efrain 1032
 
15337 efrain 1033