Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15441 | Ir a la última revisión | | 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
 
16
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
17
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
18
 
19
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
20
 
21
 
22
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
23
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
24
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
25
 
26
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
27
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
28
 
29
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
33
 
34
 
35
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
37
 
38
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
39
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
40
 
41
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
43
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
44
 
45
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
46
 
47
 
48
 
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) {
72
            if(element.parent('.form-group').length) {
73
                error.insertAfter(element);
74
            } else if(element.parent('.toggle').length) {
75
                error.insertAfter(element.parent().parent());
76
            } else {
77
                error.insertAfter(element.parent());
78
            }
79
        }
80
    });
81
 
82
 
83
    $.fn.showFormErrorValidator = function(fieldname, errors) {
84
        var field = $(fieldname);
85
        if(field) {
86
            $(field).addClass('is-invalid');
87
 
88
            var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
89
            if(field.parent('.form-group').length) {
90
                error.insertAfter(field);
91
            } else  if(field.parent('.toggle').length) {
92
                error.insertAfter(field.parent().parent());
93
            } else {
94
                error.insertAfter(field.parent());
95
            }
96
        }
97
    };
98
 
99
    var gridTable = $('#gridTable').dataTable( {
100
        'processing': true,
101
        'serverSide': true,
102
        'searching': true,
103
        'order': [[ 0, 'asc' ]],
104
        'ordering':  true,
105
        'ordenable' : true,
106
        'responsive': true,
107
        'select' : false,
108
        'paging': true,
109
        'pagingType': 'simple_numbers',
110
    	'ajax': {
111
    	   'url' : '$routeDatatable',
112
    		'type' : 'get',
113
            'beforeSend': function (request) {
114
                NProgress.start();
115
            },
116
            'dataFilter': function(response) {
117
                var response = jQuery.parseJSON( response );
118
 
119
                var json                = {};
120
                json.recordsTotal       = 0;
121
                json.recordsFiltered    = 0;
122
                json.data               = [];
123
 
124
 
125
                if(response.success) {
126
                    json.recordsTotal       = response.data.total;
127
                    json.recordsFiltered    = response.data.total;
128
                    json.data               = response.data.items;
129
                } else {
130
                    $.fn.showError(response.data)
131
                }
132
 
133
                return JSON.stringify( json );
134
            }
135
        },
136
        'language' : {
137
            'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
138
            'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
139
            'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
140
            'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
141
            'sInfo':           'LABEL_DATATABLE_SINFO',
142
            'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
143
            'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
144
            'sInfoPostFix':    '',
145
            'sSearch':         'LABEL_DATATABLE_SSEARCH',
146
            'sUrl':            '',
147
            'sInfoThousands':  ',',
148
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
149
            'oPaginate': {
150
                'sFirst':    'LABEL_DATATABLE_SFIRST',
151
                'sLast':     'LABEL_DATATABLE_SLAST',
152
                'sNext':     'LABEL_DATATABLE_SNEXT',
153
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
154
            },
155
            'oAria': {
156
                'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
157
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
158
            },
159
        },
160
        'drawCallback': function( settings ) {
161
            NProgress.done();
162
            $('button.btn-delete').confirmation({
163
                rootSelector: 'button.btn-delete',
164
                title : 'LABEL_ARE_YOU_SURE',
165
                singleton : true,
166
                btnOkLabel: 'LABEL_YES',
167
                btnCancelLabel: 'LABEL_NO',
168
                onConfirm: function(value) {
169
                    var action = $(this).data('href');
170
                    NProgress.start();
171
                    $.ajax({
172
                        'dataType'  : 'json',
173
                        'accept'    : 'application/json',
174
                        'method'    : 'post',
175
                        'url'       :  action,
176
                    }).done(function(response) {
177
                        if(response['success']) {
178
                            $.fn.showSuccess(response['data']);
179
                            gridTable.api().ajax.reload(null, false);
180
                        } else {
181
                            $.fn.showError(response['data']);
182
                        }
183
                    }).fail(function( jqXHR, textStatus, errorThrown) {
184
                        $.fn.showError(textStatus);
185
                    }).always(function() {
186
                        NProgress.done();
187
                    });
188
                },
189
            });
190
        },
191
        'aoColumns': [
192
            { 'mDataProp': 'name' },
193
            { 'mDataProp': 'main_hostname' },
194
            { 'mDataProp': 'admin_hostname' },
195
            { 'mDataProp': 'status' },
196
            { 'mDataProp': 'actions' },
197
        ],
198
        'columnDefs': [
199
            {
200
                'targets':0,
201
                'className' : 'text-vertical-middle',
202
            },
203
            {
204
                'targets': -2,
205
                'orderable': false,
206
                'className' : 'text-center',
207
                'render' : function ( data, type, row ) {
208
 
209
                    checked = data == 'a' ? ' checked="checked" ' : '';
210
                    return '<div class="checkbox checkbox-success">' +
211
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
212
                        '<label ></label></div>';
213
                }
214
            },
215
            {
216
                'targets': -1,
217
                'orderable': false,
218
                'render' : function ( data, type, row ) {
219
                    s = '';
220
 
221
                    if(allowEdit && data['link_edit']) {
222
                        s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
223
                    }
224
                    if(allowDelete  && data['link_delete']) {
225
                        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;';
226
                    }
227
                    return s;
228
                }
229
            }
230
        ],
231
    });
232
 
233
    var validatorAdd = $('#form-add').validate({
234
        debug: true,
235
        onclick: false,
236
        onkeyup: false,
237
        ignore: [':hidden'],
238
        rules: {
239
            'first_name': {
240
                required: true,
241
                maxlength: 64,
242
            },
243
            'last_name': {
244
                required: true,
245
                maxlength: 64,
246
            },
247
            'email': {
248
                required: true,
249
                email: true,
250
                maxlength: 250,
251
            },
252
            'password': {
253
                required: true,
254
                minlength: 6,
255
                maxlength: 16,
256
                passwordStrengthCheck: true,
257
            },
258
            'confirmation' : {
259
                required: true,
260
                minlength: 6,
261
                maxlength: 16,
262
                equalTo: '#form-add #password'
263
            },
264
            'company': {
265
                required: true,
266
                maxlength: 128,
267
            },
268
            'company_size_id': {
269
                required: true,
270
            },
271
            'industry_id': {
272
               required: true,
273
            },
274
            'main_hostname': {
275
                required: true,
276
                maxlength: 250,
277
            },
278
            'admin_hostname': {
279
                required: true,
280
                maxlength: 250,
281
            },
282
        },
283
        submitHandler: function(form)
284
        {
285
            NProgress.start();
286
            $.ajax({
287
                'dataType'  : 'json',
288
                'accept'    : 'application/json',
289
                'method'    : 'post',
290
                'url'       : $('#form-add').attr('action'),
291
                'data'      : $('#form-add').serialize()
292
            }).done(function(response) {
293
                if(response.success) {
294
                    $.fn.showSuccess(response.data);
295
 
296
                    $('#modalAdd').modal('hide');
297
                    gridTable.api().ajax.reload(null, false);
298
                } else {
299
                    if(jQuery.type(response.data) == 'string') {
300
                        $.fn.showError(response.data)
301
                    } else  {
302
                        $.each(response.data, function( fieldname, errors ) {
303
                            $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
304
                        });
305
                    }
306
                }
307
            }).fail(function( jqXHR, textStatus, errorThrown) {
308
                $.fn.showError(textStatus)
309
 
310
            }).always(function() {
311
                NProgress.done();
312
            })
313
        },
314
        invalidHandler: function(form, validator) {
315
        }
316
    });
317
 
318
    var validatorEdit = $('#form-edit').validate({
319
        debug: true,
320
        onclick: false,
321
        onkeyup: false,
322
        ignore: [':hidden'],
323
        rules: {
324
            'name': {
325
                required: true,
326
                maxlength: 128,
327
            },
328
            'main_hostname': {
329
                required: true,
330
                maxlength: 250,
331
            },
332
            'admin_hostname': {
333
                required: true,
334
                maxlength: 250,
335
            },
336
            'staatus': {
337
                required: true,
338
            },
339
        },
340
        submitHandler: function(form)
341
        {
342
            NProgress.start();
343
            $.ajax({
344
                'dataType'  : 'json',
345
                'accept'    : 'application/json',
346
                'method'    : 'post',
347
                'url'       : $('#form-edit').attr('action'),
348
                'data'      : $('#form-edit').serialize()
349
            }).done(function(response) {
350
                if(response.success) {
351
                    $.fn.showSuccess(response.data);
352
 
353
                    $('#modalEdit').modal('hide');
354
                    gridTable.api().ajax.reload(null, false);
355
                } else {
356
                    if(jQuery.type(response.data) == 'string') {
357
                        $.fn.showError(response.data)
358
                    } else  {
359
                        $.each(response.data, function( fieldname, errors ) {
360
                            $.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
361
                        });
362
                    }
363
                }
364
            }).fail(function( jqXHR, textStatus, errorThrown) {
365
                $.fn.showError(textStatus)
366
 
367
            }).always(function() {
368
                NProgress.done();
369
            })
370
        },
371
        invalidHandler: function(form, validator) {
372
        }
373
    });
374
 
375
    $('body').on('click', 'button.btn-add', function(e) {
376
        e.preventDefault();
377
 
378
        $('#form-add #first_name').val('');
379
        $('#form-add #last_name').val('');
380
        $('#form-add #email').val('');
381
        $('#form-add #password').val('');
382
        $('#form-add #confirmation').val('');
383
        $('#form-add #company').val('');
384
        $('#form-add #company_size_id').val('').trigger('change');
385
        $('#form-add #industry_id').val('').trigger('change');
386
        $('#form-add #main_hostname').val('');
387
        $('#form-add #admin_hostname').val('');
388
 
389
 
390
        validatorAdd.resetForm();
391
        $('#modalAdd').modal('show');
392
    });
393
 
394
    $('body').on('click', 'button.btn-edit', function(e) {
395
        e.preventDefault();
396
        NProgress.start();
397
        var action = $(this).data('href');
398
 
399
        $.ajax({
400
            'dataType'  : 'json',
401
            'method'    : 'get',
402
            'url'       :  action,
403
        }).done(function(response) {
404
            if(response['success']) {
405
 
406
                $('#form-edit').attr('action', action);
407
                $('#form-edit #name').val(response['data']['name']);
408
                $('#form-edit #main_hostname').val(response['data']['main_hostname']);
409
                $('#form-edit #admin_hostname').val(response['data']['admin_hostname']);
410
                $('#form-edit #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
411
 
412
                validatorEdit.resetForm();
413
 
414
                $('#modalEdit').modal('show');
415
            } else {
416
                $.fn.showError(response['data']);
417
            }
418
        }).fail(function( jqXHR, textStatus, errorThrown) {
419
            $.fn.showError(textStatus);
420
        }).always(function() {
421
            NProgress.done();
422
        });
423
    });
424
 
425
 
426
    $('body').on('click', 'button.btn-refresh', function(e) {
427
        e.preventDefault();
428
        gridTable.api().ajax.reload(null, false);
429
    });
430
 
431
 
432
 
433
 
434
    $('body').on('click', 'button.btn-cancel', function(e) {
435
        e.preventDefault();
436
        $('#modalAdd').modal('hide');
437
        $('#modalEdit').modal('hide');
438
    });
439
 
440
    $('#form-add #company_size_id').select2({
441
        theme: 'bootstrap4',
442
        width: '100%',
443
    });
444
 
445
    $('#form-add #industry_id').select2({
446
        theme: 'bootstrap4',
447
        width: '100%',
448
    });
449
 
450
    $('#form-edit #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
451
 
452
});
453
JS;
454
$this->inlineScript()->captureEnd();
455
?>
456
 
457
<!-- Content Header (Page header) -->
458
<section class="content-header">
459
    <div class="container-fluid">
460
        <div class="row mb-2">
461
            <div class="col-sm-12">
462
                <h1>LABEL_PRIVATE_NETWORKS</h1>
463
            </div>
464
        </div>
465
    </div><!-- /.container-fluid -->
466
</section>
467
 
468
<section class="content">
469
    <div class="container-fluid">
470
        <div class="row">
471
            <div class="col-12">
472
                <div class="card">
473
                    <div class="card-body">
474
                        <table id="gridTable" class="table table-striped table-hover">
475
                            <thead>
476
                                <tr>
477
                                    <th>LABEL_NAME</th>
478
                                    <th>LABEL_MAIN_HOSTNAME</th>
479
                                    <th>LABEL_ADMIN_HOSTNAME</th>
480
                                    <th>LABEL_ACTIVE</th>
481
                                    <th>LABEL_ACTIONS</th>
482
                                </tr>
483
                            </thead>
484
                            <tbody>
485
                            </tbody>
486
                        </table>
487
                    </div>
488
                    <div class="card-footer clearfix">
489
                        <div style="float:right;">
490
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
491
                            <?php if ($allowAdd) : ?>
492
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
493
                            <?php endif; ?>
494
 
495
                        </div>
496
                    </div>
497
                </div>
498
            </div>
499
        </div>
500
    </div>
501
</section>
502
 
503
 
504
<!-- The Modal -->
505
<div class="modal" id="modalAdd">
506
	<div class="modal-dialog  modal-xl">
507
    	<div class="modal-content">
508
 
509
            <!-- Modal Header -->
510
      		<div class="modal-header">
511
        		<h4 class="modal-title">LABEL_NEW_PRIVATE_NETWORK<span id="form-title"></span></h4>
512
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
513
      		</div>
514
 
515
            <!-- Modal body -->
516
      		<div class="modal-body">
517
       			 <?php
518
                    $form = $this->formAdd;
519
            		$form->setAttributes([
520
                        'method'    => 'post',
521
                        'name'      => 'form-add',
522
                        'id'        => 'form-add',
523
            		    'action'    => $routeAdd,
524
                    ]);
525
 
526
                    $form->prepare();
527
                    echo $this->form()->openTag($form);
528
                    ?>
529
                      	<div class="form-group">
530
        					<?php
531
        					$element = $form->get('first_name');
532
        					$element->setOptions(['label' => 'LABEL_FIRST_NAME']);
533
                            $element->setAttributes(['class' => 'form-control']);
534
 
535
                            echo $this->formLabel($element);
536
                            echo $this->formText($element);
537
                            ?>
538
						</div>
539
    					<div class="form-group">
540
        					<?php
541
        					$element = $form->get('last_name');
542
        					$element->setOptions(['label' => 'LABEL_LAST_NAME']);
543
                            $element->setAttributes(['class' => 'form-control']);
544
 
545
                            echo $this->formLabel($element);
546
                            echo $this->formText($element);
547
                            ?>
548
						</div>
549
						<div class="form-group">
550
                    	<?php
551
                    	    $element = $form->get('email');
552
                    	    $element->setOptions(['label' => 'LABEL_EMAIL']);
553
                            $element->setAttributes(['class' => 'form-control']);
554
 
555
                            echo $this->formLabel($element);
556
                            echo $this->formText($element);
557
                        ?>
558
						</div>
559
						<div class="form-group">
560
                    	<?php
561
                    	    $element = $form->get('password');
562
                    	    $element->setOptions(['label' => 'LABEL_PASSWORD']);
563
                            $element->setAttributes(['class' => 'form-control']);
564
 
565
                            echo $this->formLabel($element);
566
                            echo $this->formPassword($element);
567
                        ?>
568
						</div>
569
						<div class="form-group">
570
                    	<?php
571
                    	    $element = $form->get('confirmation');
572
                    	    $element->setOptions(['label' => 'LABEL_CONFIRMATION']);
573
                            $element->setAttributes(['class' => 'form-control']);
574
 
575
                            echo $this->formLabel($element);
576
                            echo $this->formPassword($element);
577
                        ?>
578
						</div>
579
						<div class="form-group">
580
                    	<?php
581
                    	    $element = $form->get('company');
582
                    	    $element->setOptions(['label' => 'LABEL_COMPANY']);
583
                            $element->setAttributes(['class' => 'form-control']);
584
 
585
                            echo $this->formLabel($element);
586
                            echo $this->formText($element);
587
                        ?>
588
						</div>
589
						<div class="form-group">
590
                    	<?php
591
                    	    $element = $form->get('industry_id');
592
                    	    $element->setOptions(['label' => 'LABEL_INDUSTRY']);
593
                            $element->setAttributes(['class' => 'form-control']);
594
 
595
                            echo $this->formLabel($element);
596
                            echo $this->formSelect($element);
597
                        ?>
598
						</div>
599
						<div class="form-group">
600
                    	<?php
601
                    	    $element = $form->get('company_size_id');
602
                    	    $element->setOptions(['label' => 'LABEL_COMPANY_SIZE']);
603
                            $element->setAttributes(['class' => 'form-control']);
604
 
605
                            echo $this->formLabel($element);
606
                            echo $this->formSelect($element);
607
                        ?>
608
						</div>
609
						<div class="form-group">
610
                    	<?php
611
                    	    $element = $form->get('main_hostname');
612
                    	    $element->setOptions(['label' => 'LABEL_MAIN_HOSTNAME']);
613
                            $element->setAttributes(['class' => 'form-control']);
614
 
615
                            echo $this->formLabel($element);
616
                            echo $this->formText($element);
617
                        ?>
618
						</div>
619
						<div class="form-group">
620
                    	<?php
621
                    	    $element = $form->get('admin_hostname');
622
                    	    $element->setOptions(['label' => 'LABEL_ADMIN_HOSTNAME']);
623
                            $element->setAttributes(['class' => 'form-control']);
624
 
625
                            echo $this->formLabel($element);
626
                            echo $this->formText($element);
627
                        ?>
628
						</div>
629
 
630
 
631
        				<div class="form-group">
632
                    		<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
633
                    		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
634
                   		</div>
635
     	      		<?php echo $this->form()->closeTag($form); ?>
636
      		</div>
637
 
638
            <!-- Modal footer -->
639
      		<div class="modal-footer">
640
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
641
      		</div>
642
 
643
    	</div>
644
	</div>
645
</div>
646
 
647
 
648
<!-- The Modal -->
649
<div class="modal" id="modalEdit">
650
	<div class="modal-dialog  modal-xl">
651
    	<div class="modal-content">
652
 
653
            <!-- Modal Header -->
654
      		<div class="modal-header">
655
        		<h4 class="modal-title">LABEL_EDIT_PRIVATE_NETWORK<span id="form-title"></span></h4>
656
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
657
      		</div>
658
 
659
            <!-- Modal body -->
660
      		<div class="modal-body">
661
       			 <?php
662
                    $form = $this->formEdit;
663
            		$form->setAttributes([
664
                        'method'    => 'post',
665
                        'name'      => 'form-edit',
666
                        'id'        => 'form-edit',
667
 
668
                    ]);
669
 
670
                    $form->prepare();
671
                    echo $this->form()->openTag($form);
672
                    ?>
673
 
674
						<div class="form-group">
675
                    	<?php
676
                    	    $element = $form->get('name');
677
                    	    $element->setOptions(['label' => 'LABEL_NAME']);
678
                            $element->setAttributes(['class' => 'form-control']);
679
 
680
                            echo $this->formLabel($element);
681
                            echo $this->formText($element);
682
                        ?>
683
						</div>
684
						<div class="form-group">
685
                    	<?php
686
                    	    $element = $form->get('main_hostname');
687
                    	    $element->setOptions(['label' => 'LABEL_MAIN_HOSTNAME']);
688
                            $element->setAttributes(['class' => 'form-control']);
689
 
690
                            echo $this->formLabel($element);
691
                            echo $this->formText($element);
692
                        ?>
693
						</div>
694
						<div class="form-group">
695
                    	<?php
696
                    	    $element = $form->get('admin_hostname');
697
                    	    $element->setOptions(['label' => 'LABEL_ADMIN_HOSTNAME']);
698
                            $element->setAttributes(['class' => 'form-control']);
699
 
700
                            echo $this->formLabel($element);
701
                            echo $this->formText($element);
702
                        ?>
703
						</div>
704
						<div class="form-group">
705
                            <?php
706
                            $element = $form->get('status');
707
                            echo $this->formCheckbox($element);
708
                            ?>
709
                        </div>
710
 
711
 
712
        				<div class="form-group">
713
                    		<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
714
                    		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
715
                   		</div>
716
     	      		<?php echo $this->form()->closeTag($form); ?>
717
      		</div>
718
 
719
            <!-- Modal footer -->
720
      		<div class="modal-footer">
721
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
722
      		</div>
723
 
724
    	</div>
725
	</div>
726
</div>
727