Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16927 | Rev 16948 | Ir a la última revisión | | 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">' +
165
                        '<input type="checkbox" class="form-check-input" disabled="" checked="' + checked + '">' +
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,
15459 efrain 231
                url: true,
15337 efrain 232
            },
15452 efrain 233
            'alternative_hostname': {
234
                required: false,
235
                maxlength: 250,
15459 efrain 236
                 url: true,
15452 efrain 237
            },
15337 efrain 238
            'admin_hostname': {
239
                required: true,
15459 efrain 240
                maxlength: 250,
241
                 url: true,
15337 efrain 242
            },
15831 efrain 243
            'moodle_name': {
244
                required: false,
245
                maxlength: 20,
246
            },
15459 efrain 247
            'moodle_url': {
248
                required: false,
249
                maxlength: 250,
15831 efrain 250
                url: true,
15459 efrain 251
            },
15831 efrain 252
            'microlearning_appstore': {
253
                required: false,
254
                maxlength: 250,
255
                url: true,
256
            },
257
            'microlearning_playstore': {
258
                required: false,
259
                maxlength: 250,
260
                url: true,
261
            },
15459 efrain 262
            'relationship_user_mode': {
263
                required: true,
264
            },
265
            'status': {
266
                required: false,
267
            },
15441 efrain 268
            'theme_id': {
269
                required: true,
270
            },
15337 efrain 271
        },
272
        submitHandler: function(form)
273
        {
274
            NProgress.start();
275
            $.ajax({
276
                'dataType'  : 'json',
277
                'accept'    : 'application/json',
278
                'method'    : 'post',
279
                'url'       : $('#form-add').attr('action'),
280
                'data'      : $('#form-add').serialize()
281
            }).done(function(response) {
282
                if(response.success) {
283
                    $.fn.showSuccess(response.data);
284
 
16822 efrain 285
                    $('#card-add').hide();
286
                    $('#card-edit').hide();
287
                    $('#card-list').show();
15337 efrain 288
                    gridTable.api().ajax.reload(null, false);
289
                } else {
290
                    if(jQuery.type(response.data) == 'string') {
291
                        $.fn.showError(response.data)
292
                    } else  {
293
                        $.each(response.data, function( fieldname, errors ) {
294
                            $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
295
                        });
296
                    }
297
                }
298
            }).fail(function( jqXHR, textStatus, errorThrown) {
299
                $.fn.showError(textStatus)
300
 
301
            }).always(function() {
302
                NProgress.done();
303
            })
304
        },
305
        invalidHandler: function(form, validator) {
306
        }
307
    });
308
 
309
    var validatorEdit = $('#form-edit').validate({
310
        debug: true,
311
        onclick: false,
312
        onkeyup: false,
313
        ignore: [':hidden'],
314
        rules: {
15441 efrain 315
            'theme_id' : {
316
                required: true,
317
            },
15337 efrain 318
            'name': {
319
                required: true,
320
                maxlength: 128,
321
            },
322
            'main_hostname': {
323
                required: true,
324
                maxlength: 250,
325
            },
15452 efrain 326
            'alternative_hostname': {
327
                required: false,
328
                maxlength: 250,
329
            },
15337 efrain 330
            'admin_hostname': {
331
                required: true,
332
                maxlength: 250,
333
            },
15459 efrain 334
            'status': {
335
                required: false,
15337 efrain 336
            },
15831 efrain 337
            'moodle_name': {
338
                required: false,
339
                maxlength: 20,
340
            },
341
 
15459 efrain 342
            'moodle_url': {
343
                required: false,
344
                maxlength: 250,
345
                 url: true,
346
            },
15831 efrain 347
            'microlearning_appstore': {
348
                required: false,
349
                maxlength: 250,
350
                url: true,
351
            },
352
            'microlearning_playstore': {
353
                required: false,
354
                maxlength: 250,
355
                url: true,
356
            },
15459 efrain 357
            'relationship_user_mode': {
358
                required: true,
359
            },
15441 efrain 360
            'theme_id': {
361
                required: true,
362
            },
15337 efrain 363
        },
364
        submitHandler: function(form)
365
        {
366
            NProgress.start();
367
            $.ajax({
368
                'dataType'  : 'json',
369
                'accept'    : 'application/json',
370
                'method'    : 'post',
371
                'url'       : $('#form-edit').attr('action'),
372
                'data'      : $('#form-edit').serialize()
373
            }).done(function(response) {
374
                if(response.success) {
375
                    $.fn.showSuccess(response.data);
376
 
16822 efrain 377
                    $('#card-add').hide();
378
                    $('#card-edit').hide();
379
                    $('#card-list').show();
15337 efrain 380
                    gridTable.api().ajax.reload(null, false);
381
                } else {
382
                    if(jQuery.type(response.data) == 'string') {
383
                        $.fn.showError(response.data)
384
                    } else  {
385
                        $.each(response.data, function( fieldname, errors ) {
386
                            $.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
387
                        });
388
                    }
389
                }
390
            }).fail(function( jqXHR, textStatus, errorThrown) {
391
                $.fn.showError(textStatus)
392
 
393
            }).always(function() {
394
                NProgress.done();
395
            })
396
        },
397
        invalidHandler: function(form, validator) {
398
        }
399
    });
400
 
401
    $('body').on('click', 'button.btn-add', function(e) {
402
        e.preventDefault();
403
 
404
        $('#form-add #first_name').val('');
405
        $('#form-add #last_name').val('');
406
        $('#form-add #email').val('');
407
        $('#form-add #password').val('');
408
        $('#form-add #confirmation').val('');
409
        $('#form-add #company').val('');
410
        $('#form-add #company_size_id').val('').trigger('change');
411
        $('#form-add #industry_id').val('').trigger('change');
412
        $('#form-add #main_hostname').val('');
15452 efrain 413
        $('#form-add #alternative_hostname').val('');
15337 efrain 414
        $('#form-add #admin_hostname').val('');
15831 efrain 415
        $('#form-add #moodle_name').val('');
15459 efrain 416
        $('#form-add #moodle_url').val('');
15831 efrain 417
        $('#form-add #microlearning_appstore').val('');
418
        $('#form-add #microlearning_playstore').val('');
15459 efrain 419
        $('#form-add #relationship_user_mode').val('').trigger('change');
15441 efrain 420
        $('#form-add #theme_id').val('');
15337 efrain 421
 
422
        validatorAdd.resetForm();
16822 efrain 423
 
424
        $('#card-list').hide();
425
        $('#card-edit').hide();
426
        $('#card-add').show();
15337 efrain 427
    });
428
 
429
    $('body').on('click', 'button.btn-edit', function(e) {
430
        e.preventDefault();
431
        NProgress.start();
432
        var action = $(this).data('href');
433
 
434
        $.ajax({
435
            'dataType'  : 'json',
436
            'method'    : 'get',
437
            'url'       :  action,
438
        }).done(function(response) {
439
            if(response['success']) {
440
 
441
                $('#form-edit').attr('action', action);
442
                $('#form-edit #name').val(response['data']['name']);
443
                $('#form-edit #main_hostname').val(response['data']['main_hostname']);
15452 efrain 444
                $('#form-edit #alternative_hostname').val(response['data']['alternative_hostname']);
15337 efrain 445
                $('#form-edit #admin_hostname').val(response['data']['admin_hostname']);
446
                $('#form-edit #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
15441 efrain 447
                $('#form-edit #theme_id').val(response['data']['theme_id']);
15831 efrain 448
                $('#form-edit #moodle_name').val(response['data']['moodle_name']);
15459 efrain 449
                $('#form-edit #moodle_url').val(response['data']['moodle_url']);
15831 efrain 450
                $('#form-edit #microlearning_appstore').val(response['data']['microlearning_appstore']);
451
                $('#form-edit #microlearning_playstore').val(response['data']['microlearning_playstore']);
15459 efrain 452
                $('#form-edit #relationship_user_mode').val(response['data']['relationship_user_mode']).trigger('change');
15337 efrain 453
                validatorEdit.resetForm();
454
 
16822 efrain 455
                $('#card-list').hide();
456
                $('#card-add').hide();
457
                $('#card-edit').show();
15337 efrain 458
            } else {
459
                $.fn.showError(response['data']);
460
            }
461
        }).fail(function( jqXHR, textStatus, errorThrown) {
462
            $.fn.showError(textStatus);
463
        }).always(function() {
464
            NProgress.done();
465
        });
466
    });
16822 efrain 467
 
468
 
469
    $('body').on('click', 'button.btn-cancel', function(e) {
470
        e.preventDefault();
471
 
472
        $('#card-add').hide();
473
        $('#card-edit').hide();
474
        $('#card-list').show();
475
    });
15337 efrain 476
 
477
 
478
    $('body').on('click', 'button.btn-refresh', function(e) {
479
        e.preventDefault();
480
        gridTable.api().ajax.reload(null, false);
481
    });
482
 
16822 efrain 483
    $('body').on('click', 'button.btn-delete', function(e) {
484
        e.preventDefault();
485
        var action = $(this).data('href');
15337 efrain 486
 
487
 
16822 efrain 488
          swal.fire({
489
            title: 'LABEL_ARE_YOU_SURE',
490
            icon: 'question',
491
            cancelButtonText: 'LABEL_NO',
492
            showCancelButton: true,
493
            confirmButtonText: 'LABEL_YES'
494
          }).then((result) => {
495
            if (result.isConfirmed) {
496
 
497
                    NProgress.start();
498
                    $.ajax({
499
                        'dataType'  : 'json',
500
                        'accept'    : 'application/json',
501
                        'method'    : 'post',
502
                        'url'       :  action,
503
                    }).done(function(response) {
504
                        if(response['success']) {
505
                            $.fn.showSuccess(response['data']);
506
                            gridTable.api().ajax.reload(null, false);
507
                        } else {
508
                            $.fn.showError(response['data']);
509
                        }
510
                    }).fail(function( jqXHR, textStatus, errorThrown) {
511
                        $.fn.showError(textStatus);
512
                    }).always(function() {
513
                        NProgress.done();
514
                    });
515
            }
516
          });
517
 
518
 
519
    });
520
 
521
 
522
 
15337 efrain 523
    $('body').on('click', 'button.btn-cancel', function(e) {
524
        e.preventDefault();
525
        $('#modalAdd').modal('hide');
526
        $('#modalEdit').modal('hide');
527
    });
528
 
529
    $('#form-add #company_size_id').select2({
16918 efrain 530
        theme: 'bootstrap-5',
15337 efrain 531
        width: '100%',
532
    });
533
 
534
    $('#form-add #industry_id').select2({
16918 efrain 535
        theme: 'bootstrap-5',
15337 efrain 536
        width: '100%',
537
    });
538
 
539
    $('#form-edit #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
540
 
541
});
542
JS;
543
$this->inlineScript()->captureEnd();
544
?>
545
 
546
 
16822 efrain 547
 <div class="container">
548
 	<div class="card" id="card-list">
549
 		<div class="card-body">
550
 			<h6 class="card-title">LABEL_PRIVATE_NETWORKS</h6>
551
     	    <div class="row">
16891 efrain 552
                <div class="col-12 mt-3">
15337 efrain 553
 
16912 efrain 554
               		<table id="gridTable" class="table  table-bordered">
16822 efrain 555
               			<thead>
556
            				<tr>
557
                       			<th>LABEL_NAME</th>
558
                          		<th>LABEL_MAIN_HOSTNAME</th>
559
                          		<th>LABEL_ADMIN_HOSTNAME</th>
560
                              	<th>LABEL_ACTIVE</th>
561
                              	<th>LABEL_ACTIONS</th>
562
                       		</tr>
563
                       	</thead>
564
                  		<tbody>
565
                   		</tbody>
566
             		 </table>
567
     			</div>
15337 efrain 568
 
16822 efrain 569
			</div>
570
    	</div>
571
    	<div class="card-footer clearfix">
572
        	<div style="float:right;">
573
         		<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
574
             	<?php if ($allowAdd) : ?>
575
             	<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
576
    			<?php endif; ?>
577
    		</div>
578
    	</div>
579
    </div>
580
 
581
	<div class="card" id="card-add" style="display: none">
582
		<?php
15337 efrain 583
                    $form = $this->formAdd;
584
            		$form->setAttributes([
585
                        'method'    => 'post',
586
                        'name'      => 'form-add',
587
                        'id'        => 'form-add',
588
            		    'action'    => $routeAdd,
589
                    ]);
590
 
591
                    $form->prepare();
592
                    echo $this->form()->openTag($form);
16822 efrain 593
        ?>
594
 		<div class="card-body">
595
 			<h6 class="card-title">LABEL_NEW_PRIVATE_NETWORK</h6>
596
 
597
 			<div class="row">
16841 efrain 598
                      	<div class="col-12  mr-3">
15337 efrain 599
        					<?php
600
        					$element = $form->get('first_name');
601
        					$element->setOptions(['label' => 'LABEL_FIRST_NAME']);
602
                            $element->setAttributes(['class' => 'form-control']);
603
 
604
                            echo $this->formLabel($element);
605
                            echo $this->formText($element);
606
                            ?>
16822 efrain 607
						</div>
608
					</div>
609
                    <div class="row">
16841 efrain 610
                      	<div class="col-12  mr-3">
15337 efrain 611
        					<?php
612
        					$element = $form->get('last_name');
613
        					$element->setOptions(['label' => 'LABEL_LAST_NAME']);
614
                            $element->setAttributes(['class' => 'form-control']);
615
 
616
                            echo $this->formLabel($element);
617
                            echo $this->formText($element);
618
                            ?>
619
						</div>
16822 efrain 620
					</div>
621
                    <div class="row">
16841 efrain 622
                      	<div class="col-12  mr-3">
15337 efrain 623
                    	<?php
624
                    	    $element = $form->get('email');
625
                    	    $element->setOptions(['label' => 'LABEL_EMAIL']);
626
                            $element->setAttributes(['class' => 'form-control']);
627
 
628
                            echo $this->formLabel($element);
629
                            echo $this->formText($element);
630
                        ?>
631
						</div>
16822 efrain 632
					</div>
633
                    <div class="row">
16841 efrain 634
                      	<div class="col-12  mr-3">
15337 efrain 635
                    	<?php
636
                    	    $element = $form->get('password');
637
                    	    $element->setOptions(['label' => 'LABEL_PASSWORD']);
638
                            $element->setAttributes(['class' => 'form-control']);
639
 
640
                            echo $this->formLabel($element);
641
                            echo $this->formPassword($element);
642
                        ?>
643
						</div>
16822 efrain 644
					</div>
645
                    <div class="row">
16841 efrain 646
                      	<div class="col-12  mr-3">
15337 efrain 647
                    	<?php
648
                    	    $element = $form->get('confirmation');
649
                    	    $element->setOptions(['label' => 'LABEL_CONFIRMATION']);
650
                            $element->setAttributes(['class' => 'form-control']);
651
 
652
                            echo $this->formLabel($element);
653
                            echo $this->formPassword($element);
654
                        ?>
655
						</div>
16822 efrain 656
					</div>
657
                    <div class="row">
16841 efrain 658
                      	<div class="col-12  mr-3">
15337 efrain 659
                    	<?php
660
                    	    $element = $form->get('company');
661
                    	    $element->setOptions(['label' => 'LABEL_COMPANY']);
662
                            $element->setAttributes(['class' => 'form-control']);
663
 
664
                            echo $this->formLabel($element);
665
                            echo $this->formText($element);
666
                        ?>
667
						</div>
16822 efrain 668
					</div>
669
                    <div class="row">
16841 efrain 670
                      	<div class="col-12  mr-3">
15337 efrain 671
                    	<?php
672
                    	    $element = $form->get('industry_id');
673
                    	    $element->setOptions(['label' => 'LABEL_INDUSTRY']);
674
                            $element->setAttributes(['class' => 'form-control']);
675
 
676
                            echo $this->formLabel($element);
677
                            echo $this->formSelect($element);
678
                        ?>
679
						</div>
16822 efrain 680
					</div>
681
                    <div class="row">
16841 efrain 682
                      	<div class="col-12  mr-3">
15337 efrain 683
                    	<?php
684
                    	    $element = $form->get('company_size_id');
685
                    	    $element->setOptions(['label' => 'LABEL_COMPANY_SIZE']);
686
                            $element->setAttributes(['class' => 'form-control']);
687
 
688
                            echo $this->formLabel($element);
689
                            echo $this->formSelect($element);
690
                        ?>
691
						</div>
16822 efrain 692
					</div>
693
                    <div class="row">
16841 efrain 694
                      	<div class="col-12  mr-3">
15337 efrain 695
                    	<?php
696
                    	    $element = $form->get('main_hostname');
697
                    	    $element->setOptions(['label' => 'LABEL_MAIN_HOSTNAME']);
698
                            $element->setAttributes(['class' => 'form-control']);
699
 
700
                            echo $this->formLabel($element);
701
                            echo $this->formText($element);
702
                        ?>
703
						</div>
16822 efrain 704
					</div>
705
                    <div class="row">
16841 efrain 706
                      	<div class="col-12  mr-3">
15337 efrain 707
                    	<?php
15452 efrain 708
                    	    $element = $form->get('alternative_hostname');
709
                    	    $element->setOptions(['label' => 'LABEL_ALTERNATIVE_HOSTNAME']);
710
                            $element->setAttributes(['class' => 'form-control']);
711
 
712
                            echo $this->formLabel($element);
713
                            echo $this->formText($element);
714
                        ?>
715
						</div>
16822 efrain 716
					</div>
717
                    <div class="row">
16841 efrain 718
                      	<div class="col-12  mr-3">
15452 efrain 719
                    	<?php
15337 efrain 720
                    	    $element = $form->get('admin_hostname');
721
                    	    $element->setOptions(['label' => 'LABEL_ADMIN_HOSTNAME']);
722
                            $element->setAttributes(['class' => 'form-control']);
723
 
724
                            echo $this->formLabel($element);
725
                            echo $this->formText($element);
726
                        ?>
727
						</div>
16822 efrain 728
					</div>
729
                    <div class="row">
16841 efrain 730
                      	<div class="col-12  mr-3">
15441 efrain 731
                    	<?php
15831 efrain 732
                    	    $element = $form->get('moodle_name');
733
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_NAME']);
734
                            $element->setAttributes(['class' => 'form-control']);
735
 
736
                            echo $this->formLabel($element);
737
                            echo $this->formText($element);
738
                        ?>
739
						</div>
16822 efrain 740
					</div>
741
                    <div class="row">
16841 efrain 742
                      	<div class="col-12  mr-3">
15831 efrain 743
                    	<?php
15459 efrain 744
                    	    $element = $form->get('moodle_url');
745
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_URL']);
746
                            $element->setAttributes(['class' => 'form-control']);
747
 
748
                            echo $this->formLabel($element);
749
                            echo $this->formText($element);
750
                        ?>
751
						</div>
16822 efrain 752
					</div>
753
                    <div class="row">
16841 efrain 754
                      	<div class="col-12  mr-3">
15831 efrain 755
                    	<?php
756
                    	    $element = $form->get('microlearning_appstore');
757
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_APPSTORE']);
758
                            $element->setAttributes(['class' => 'form-control']);
759
 
760
                            echo $this->formLabel($element);
761
                            echo $this->formText($element);
762
                        ?>
763
						</div>
16822 efrain 764
					</div>
765
                    <div class="row">
16841 efrain 766
                      	<div class="col-12  mr-3">
15831 efrain 767
                    	<?php
768
                    	    $element = $form->get('microlearning_playstore');
769
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_PLAYSTORE']);
770
                            $element->setAttributes(['class' => 'form-control']);
771
 
772
                            echo $this->formLabel($element);
773
                            echo $this->formText($element);
774
                        ?>
775
						</div>
16822 efrain 776
					</div>
777
                    <div class="row">
16841 efrain 778
                      	<div class="col-12  mr-3">
15459 efrain 779
                    	<?php
780
                    	    $element = $form->get('relationship_user_mode');
781
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
782
                            $element->setAttributes(['class' => 'form-control']);
783
 
784
                            echo $this->formLabel($element);
785
                            echo $this->formSelect($element);
786
                        ?>
787
						</div>
16822 efrain 788
					</div>
789
                    <div class="row">
16841 efrain 790
                      	<div class="col-12  mr-3">
15459 efrain 791
                    	<?php
15441 efrain 792
                    	    $element = $form->get('theme_id');
793
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
794
                            $element->setAttributes(['class' => 'form-control']);
15337 efrain 795
 
15441 efrain 796
                            echo $this->formLabel($element);
797
                            echo $this->formSelect($element);
798
                        ?>
799
						</div>
16822 efrain 800
					</div>
801
 
802
 		</div>
803
 		<div class="card-footer text-right">
804
 			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
805
        	<button type="button" class="btn btn-light btn-cancel">LABEL_CLOSE</button>
806
 
807
 		</div>
808
 		<?php echo $this->form()->closeTag($form); ?>
809
 	</div>
810
 
811
	<div class="card" id="card-edit" style="display: none">
812
	<?php
15337 efrain 813
                    $form = $this->formEdit;
814
            		$form->setAttributes([
815
                        'method'    => 'post',
816
                        'name'      => 'form-edit',
817
                        'id'        => 'form-edit',
818
 
819
                    ]);
820
 
821
                    $form->prepare();
822
                    echo $this->form()->openTag($form);
16822 efrain 823
                    ?>
824
 		<div class="card-body">
825
 			<h6 class="card-title">LABEL_EDIT_PRIVATE_NETWORK</h6>
826
 
827
 			<div class="row">
16841 efrain 828
                      	<div class="col-12  mr-3">
15337 efrain 829
                    	<?php
830
                    	    $element = $form->get('name');
831
                    	    $element->setOptions(['label' => 'LABEL_NAME']);
832
                            $element->setAttributes(['class' => 'form-control']);
833
 
834
                            echo $this->formLabel($element);
835
                            echo $this->formText($element);
836
                        ?>
837
						</div>
16822 efrain 838
					</div>
839
                    <div class="row">
16841 efrain 840
                      	<div class="col-12  mr-3">
15337 efrain 841
                    	<?php
842
                    	    $element = $form->get('main_hostname');
843
                    	    $element->setOptions(['label' => 'LABEL_MAIN_HOSTNAME']);
844
                            $element->setAttributes(['class' => 'form-control']);
845
 
846
                            echo $this->formLabel($element);
847
                            echo $this->formText($element);
848
                        ?>
849
						</div>
16822 efrain 850
					</div>
851
                    <div class="row">
16841 efrain 852
                      	<div class="col-12  mr-3">
15337 efrain 853
                    	<?php
15452 efrain 854
                    	    $element = $form->get('alternative_hostname');
855
                    	    $element->setOptions(['label' => 'LABEL_ALTERNATIVE_HOSTNAME']);
856
                            $element->setAttributes(['class' => 'form-control']);
857
 
858
                            echo $this->formLabel($element);
859
                            echo $this->formText($element);
860
                        ?>
861
						</div>
16822 efrain 862
					</div>
15452 efrain 863
 
16822 efrain 864
                    <div class="row">
16841 efrain 865
                      	<div class="col-12  mr-3">
15452 efrain 866
                    	<?php
15337 efrain 867
                    	    $element = $form->get('admin_hostname');
868
                    	    $element->setOptions(['label' => 'LABEL_ADMIN_HOSTNAME']);
869
                            $element->setAttributes(['class' => 'form-control']);
870
 
871
                            echo $this->formLabel($element);
872
                            echo $this->formText($element);
873
                        ?>
874
						</div>
16822 efrain 875
					</div>
876
                    <div class="row">
16841 efrain 877
                      	<div class="col-12  mr-3">
15337 efrain 878
                            <?php
879
                            $element = $form->get('status');
880
                            echo $this->formCheckbox($element);
881
                            ?>
16822 efrain 882
						</div>
883
					</div>
884
                    <div class="row">
16841 efrain 885
                      	<div class="col-12  mr-3">
15459 efrain 886
                    	<?php
15831 efrain 887
                    	    $element = $form->get('moodle_name');
888
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_NAME']);
889
                            $element->setAttributes(['class' => 'form-control']);
890
 
891
                            echo $this->formLabel($element);
892
                            echo $this->formText($element);
893
                        ?>
894
						</div>
16822 efrain 895
                    <div class="row">
16841 efrain 896
                      	<div class="col-12  mr-3">
15831 efrain 897
                    	<?php
15459 efrain 898
                    	    $element = $form->get('moodle_url');
899
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_URL']);
900
                            $element->setAttributes(['class' => 'form-control']);
901
 
902
                            echo $this->formLabel($element);
903
                            echo $this->formText($element);
904
                        ?>
905
						</div>
16822 efrain 906
					</div>
907
                    <div class="row">
16841 efrain 908
                      	<div class="col-12  mr-3">
15831 efrain 909
                    	<?php
910
                    	    $element = $form->get('microlearning_appstore');
911
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_APPSTORE']);
912
                            $element->setAttributes(['class' => 'form-control']);
913
 
914
                            echo $this->formLabel($element);
915
                            echo $this->formText($element);
916
                        ?>
917
						</div>
16822 efrain 918
					</div>
919
                    <div class="row">
16841 efrain 920
                      	<div class="col-12  mr-3">
15831 efrain 921
                    	<?php
922
                    	    $element = $form->get('microlearning_playstore');
923
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_PLAYSTORE']);
924
                            $element->setAttributes(['class' => 'form-control']);
925
 
926
                            echo $this->formLabel($element);
927
                            echo $this->formText($element);
928
                        ?>
929
						</div>
16822 efrain 930
					</div>
931
                    <div class="row">
16841 efrain 932
                      	<div class="col-12  mr-3">
15459 efrain 933
                    	<?php
934
                    	    $element = $form->get('relationship_user_mode');
935
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
936
                            $element->setAttributes(['class' => 'form-control']);
937
 
938
                            echo $this->formLabel($element);
939
                            echo $this->formSelect($element);
940
                        ?>
941
						</div>
16822 efrain 942
					</div>
943
                    <div class="row">
16841 efrain 944
                      	<div class="col-12  mr-3">
15441 efrain 945
                    	<?php
946
                    	    $element = $form->get('theme_id');
947
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
948
                            $element->setAttributes(['class' => 'form-control']);
15337 efrain 949
 
15441 efrain 950
                            echo $this->formLabel($element);
951
                            echo $this->formSelect($element);
952
                        ?>
953
						</div>
16822 efrain 954
					</div>
955
 
956
 		</div>
957
 		<div class="card-footer text-right">
958
 			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
959
        	<button type="button" class="btn btn-light btn-cancel">LABEL_CLOSE</button>
960
 
961
 		</div>
962
 		<?php echo $this->form()->closeTag($form); ?>
963
 	</div>
964
</div>
15441 efrain 965
 
16822 efrain 966
 
15337 efrain 967