Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16929 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
16701 efrain 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
 
8
$routeAdd       = $this->url('fast-survey/add');
9
$routeDatatable = $this->url('fast-survey');
10
 
11
$allowAdd       = $acl->isAllowed($roleName, 'fast-survey/add') ? 1 : 0;
12
$allowEdit      = $acl->isAllowed($roleName, 'fast-survey/edit') ? 1 : 0;
13
$allowDelete    = $acl->isAllowed($roleName, 'fast-survey/delete') ? 1 : 0;
16747 efrain 14
$allowChart    = $acl->isAllowed($roleName, 'fast-survey/chart') ? 1 : 0;
16701 efrain 15
$allowDownload  = $acl->isAllowed($roleName, 'fast-survey/download') ? 1 : 0;
16
 
16822 efrain 17
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
18
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
16701 efrain 19
 
20
 
16929 efrain 21
 
22
 
23
 
16822 efrain 24
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
16701 efrain 25
 
16822 efrain 26
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
27
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
16701 efrain 28
 
29
 
16822 efrain 30
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
16701 efrain 31
 
32
 
33
 
16747 efrain 34
 
35
 
16822 efrain 36
$this->inlineScript()->appendFile($this->basePath('assets/vendors/chart.js/chart.js'));
37
$this->inlineScript()->appendFile($this->basePath('assets/vendors/chartjs-plugin-datalabels/chartjs-plugin-datalabels.js'));
16747 efrain 38
 
39
 
16822 efrain 40
 
16701 efrain 41
$this->inlineScript()->captureStart();
42
echo <<<JS
16747 efrain 43
 
44
 
45
    var ctxChartResult = document.getElementById("chartResult").getContext("2d");
46
 
47
 
48
    var chartResult = new Chart(ctxChartResult, {
49
        type: 'bar',
50
        data: {
51
            labels: [],
52
            datasets: [
53
                {
54
                	label : 'LABEL_VOTES',
55
         			backgroundColor: '#E69090',
56
                    borderColor: '#E69090',
57
                    borderWidth: 1,
58
                    fill: false,
59
                    data : []
60
              	},
61
            ]
62
        },
63
        options: {
64
            indexAxis: 'y',
65
            tooltips: {
66
                mode: 'index',
67
                intersect: false
68
            },
69
            scales: {
70
                xAxes: [{
71
                    ticks: {
72
                        beginAtZero:true
73
                    }
74
                }]
75
            }
76
        }
77
    });
78
 
16701 efrain 79
    jQuery( document ).ready(function( $ ) {
80
 
81
 
82
 
83
 
84
        var allowEdit   = $allowEdit;
85
        var allowDelete = $allowDelete;
16747 efrain 86
        var allowChart   = $allowChart;
16701 efrain 87
        var allowDownload = $allowDownload;
88
 
89
        var gridTable = $('#gridTable').dataTable( {
90
            'processing': true,
91
            'serverSide': true,
92
            'searching': true,
93
            'order': [[ 0, 'asc' ]],
94
            'ordering':  true,
95
            'ordenable' : true,
96
            'responsive': true,
97
            'select' : false,
98
        	'paging': true,
99
            'pagingType': 'simple_numbers',
100
    		'ajax': {
101
    			'url' : '$routeDatatable',
102
    			'type' : 'get',
103
                'beforeSend': function (request) {
104
                  NProgress.start();
105
                },
106
                'dataFilter': function(response) {
107
                    var response = jQuery.parseJSON( response );
108
 
109
                    var json                = {};
110
                    json.recordsTotal       = 0;
111
                    json.recordsFiltered    = 0;
112
                    json.data               = [];
113
 
114
 
115
                    if(response.success) {
116
                        json.recordsTotal       = response.data.total;
117
                        json.recordsFiltered    = response.data.total;
118
                        json.data               = response.data.items;
119
                    } else {
120
                        $.fn.showError(response.data)
121
                    }
122
 
123
                    return JSON.stringify( json );
124
                }
125
    		},
126
            'language' : {
127
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
128
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
129
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
130
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
131
                'sInfo':           'LABEL_DATATABLE_SINFO',
132
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
133
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
134
                'sInfoPostFix':    '',
135
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
136
                'sUrl':            '',
137
                'sInfoThousands':  ',',
138
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
139
                'oPaginate': {
140
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
141
                    'sLast':     'LABEL_DATATABLE_SLAST',
142
                    'sNext':     'LABEL_DATATABLE_SNEXT',
143
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
144
                },
145
                'oAria': {
146
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
147
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
148
                },
149
            },
150
            'drawCallback': function( settings ) {
151
                NProgress.done();
16822 efrain 152
 
16701 efrain 153
            },
154
            'aoColumns': [
155
                { 'mDataProp': 'question' },
156
                { 'mDataProp': 'details' },
157
                { 'mDataProp': 'votes' },
158
                { 'mDataProp': 'actions' },
159
    	    ],
160
            'columnDefs': [
161
                {
162
                    'targets': 0,
163
                    'className' : 'text-vertical-middle',
164
                },
165
                {
166
                    'targets': 1,
167
                    'orderable': false,
168
                    'render' : function ( data, type, row ) {
16747 efrain 169
                        var s = 'LABEL_DURATION_FROM : ' + data['added_on'] + '<br>';
16701 efrain 170
                        s = s + 'LABEL_DURATION_UNTIL : ' + data['expire_on'] + '<br>';
171
 
172
                    return s;
173
 
174
                    }
175
                },
176
                {
177
                    'targets': 2,
178
                    'className' : 'text-vertical-middle',
179
                    'orderable': false,
180
                },
181
                {
182
                    'targets': -1,
183
                    'orderable': false,
184
                    'render' : function ( data, type, row ) {
185
                        s = '';
186
 
187
                        if(allowEdit && data['link_edit']) {
16906 efrain 188
                            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;';
16701 efrain 189
                        }
190
                        if(allowDelete && data['link_delete']) {
191
                            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;';
192
                        }
16747 efrain 193
                        if(allowChart && data['link_chart']) {
194
                            s = s + '<button class="btn btn-danger btn-chart" data-href="' + data['link_chart']+ '" data-toggle="tooltip" title="LABEL_CHART"><i class="fa fa-line-chart"></i> LABEL_CHART </button>&nbsp;';
195
                        }
196
                        if(allowDownload && data['link_download']) {
197
                            s = s + '<button class="btn btn-danger btn-download" data-href="' + data['link_download']+ '" data-toggle="tooltip" title="LABEL_DOWNLOAD"><i class="fa fa-download"></i> LABEL_DOWNLOAD </button>&nbsp;';
198
                        }
16701 efrain 199
                        return s;
200
                    }
201
                }
202
              ],
203
        });
204
 
205
 
206
        var validator = $('#form').validate({
207
            debug: true,
208
            onclick: false,
209
            onkeyup: false,
210
            ignore: [],
211
            rules: {
212
                'question': {
213
                    required: true,
214
                    maxlength: 1024,
215
                },
216
                'number_of_answers' : {
217
                    required: true,
218
                    digits: true,
219
                    min: 2,
220
                    max: 5
221
                },
222
                'answer1': {
223
                    required: true,
224
                    maxlength: 100,
225
                },
226
                'answer2': {
227
                    required: true,
228
                    maxlength: 100,
229
                },
230
                'answer3': {
231
                    required: function (element) {
232
                        return $('#form #number_of_answers').val() >= 3 ? true : false;
233
                    } ,
234
                    maxlength: 100,
235
                },
236
                'answer4': {
237
                    required: function (element) {
238
                        return $('#form #number_of_answers').val() >= 4 ? true : false;
239
                    } ,
240
                    maxlength: 100,
241
                },
242
                'answer5': {
243
                    required: function (element) {
244
                        return $('#form #number_of_answers').val() >= 5 ? true : false;
245
                    } ,
246
                    maxlength: 100,
247
                },
248
                'privacy': {
249
                    required: true,
250
                },
251
                'result_type': {
252
                    required: false,
253
 
254
                },
255
                'duration_days' : {
256
                    required: true,
257
                    digits: true,
258
                    min: 1,
259
                    max: 29
260
                },
261
                'duration_hours' : {
262
                    required: true,
263
                    digits: true,
264
                    min: 0,
265
                    max: 23
266
                },
267
                'duration_minutes' : {
268
                    required: true,
269
                    digits: true,
270
                    min: 0,
271
                    max: 59
272
                },
273
            },
274
            submitHandler: function(form)
275
            {
276
                $.ajax({
277
                    'dataType'  : 'json',
278
                    'accept'    : 'application/json',
279
                    'method'    : 'post',
280
                    'url'       :  $('#form').attr('action'),
281
                    'data'      :  $('#form').serialize(),
282
 
283
                }).done(function(response) {
284
                    NProgress.start();
285
                    if(response['success']) {
286
                        $.fn.showSuccess(response['data']);
287
 
288
                        $('#row-form').hide();
289
                        $('#row-listing').show();
290
 
291
 
292
                        gridTable.api().ajax.reload(null, false);
293
                    } else {
294
                        validator.resetForm();
295
                        if(jQuery.type(response['data']) == 'string') {
296
                            $.fn.showError(response['data']);
297
                        } else  {
298
                            $.each(response['data'], function( fieldname, errors ) {
299
                                $.fn.showFormErrorValidator('#form #' + fieldname, errors);
300
                            });
301
                        }
302
                    }
303
                }).fail(function( jqXHR, textStatus, errorThrown) {
304
                    $.fn.showError(textStatus);
305
                }).always(function() {
306
                    NProgress.done();
307
                });
308
                return false;
309
            },
310
            invalidHandler: function(form, validator) {
311
            }
312
        });
313
 
314
 
315
 
316
        $('body').on('click', 'button.btn-add', function(e) {
317
            e.preventDefault();
318
 
319
            $('#card-form-title').html('LABEL_ADD');
320
            $('#form').attr('action', '$routeAdd');
321
            $('#form #question').val('');
322
            $('#form #number_of_answers').val('2');
323
            $('#form #answer1').val('');
324
            $('#form #answer2').val('');
325
            $('#form #answer3').val('');
326
            $('#form #answer4').val('');
327
            $('#form #answer5').val('');
328
            $('#form #privacy').val($("#form #privacy option:first").val());
329
            $('#form #result_type').val($("#form #result_type option:first").val());
330
            $('#form #duration_days').val('1');
331
            $('#form #duration_hours').val('0');
332
            $('#form #duration_minutes').val('0');
333
 
334
            $('#form-group-answer3').hide();
335
            $('#form-group-answer4').hide();
336
            $('#form-group-answer5').hide();
337
 
338
            validator.resetForm();
339
            $('#row-listing').hide();
340
            $('#row-form').show();
341
 
342
        });
343
 
344
        $('body').on('click', 'button.btn-edit', function(e) {
345
            e.preventDefault();
346
            NProgress.start();
347
            var action = $(this).data('href');
348
 
349
            $.ajax({
350
                'dataType'  : 'json',
351
                'method'    : 'get',
352
                'url'       :  action,
353
            }).done(function(response) {
354
                if(response['success']) {
355
 
356
                    $('#card-form-title').html('LABEL_EDIT');
357
                    $('#form').attr('action', action);
358
                    $('#form #question').val(response['data']['question']);
359
                    $('#form #number_of_answers').val(response['data']['number_of_answers']);
360
                    $('#form #answer1').val(response['data']['answer1']);
361
                    $('#form #answer2').val(response['data']['answer2']);
362
                    $('#form #answer3').val(response['data']['answer3']);
363
                    $('#form #answer4').val(response['data']['answer4']);
364
                    $('#form #answer5').val(response['data']['answer5']);
365
                    $('#form #privacy').val(response['data']['privacy']);
366
                    $('#form #result_type').val(response['data']['result_type']);
367
                    $('#form #duration_days').val(response['data']['duration_days']);
368
                    $('#form #duration_hours').val(response['data']['duration_hours']);
369
                    $('#form #duration_minutes').val(response['data']['duration_minutes']);
370
 
371
                    switch(response['data']['number_of_answers'])
372
                    {
373
                        case 3 :
374
                            $('#form-group-answer3').show();
375
                            $('#form-group-answer4').hide();
376
                            $('#form-group-answer5').hide();
377
                            break;
378
 
379
                        case 4 :
380
                            $('#form-group-answer3').show();
381
                            $('#form-group-answer4').show();
382
                            $('#form-group-answer5').hide();
383
                            break;
384
 
385
                        case 5 :
386
                            $('#form-group-answer3').show();
387
                            $('#form-group-answer4').show();
388
                            $('#form-group-answer5').show();
389
                            break;
390
 
391
                        default :
392
                            $('#form-group-answer3').hide();
393
                            $('#form-group-answer4').hide();
394
                            $('#form-group-answer5').hide();
395
                            break;
396
 
397
                    }
398
 
399
 
400
                    validator.resetForm();
401
                    $('#row-listing').hide();
402
                    $('#row-form').show();
403
 
404
 
405
                } else {
406
                    $.fn.showError(response['data']);
407
                }
408
            }).fail(function( jqXHR, textStatus, errorThrown) {
409
                $.fn.showError(textStatus);
410
            }).always(function() {
411
                NProgress.done();
412
            });
413
        });
414
 
16747 efrain 415
        $('body').on('click', 'button.btn-chart', function(e) {
416
            e.preventDefault();
417
            NProgress.start();
418
            var action = $(this).data('href');
419
 
420
            $.ajax({
421
                'dataType'  : 'json',
422
                'method'    : 'get',
423
                'url'       :  action,
424
            }).done(function(response) {
425
                if(response['success']) {
426
 
427
                    $('#chart-question').html(response['data']['question']);
428
 
429
                    chartResult.data.labels = response['data']['labels'];
430
                    chartResult.data.datasets[0].data = response['data']['values'];
431
                    chartResult.update();
432
 
433
                    $('#row-listing').hide();
434
                    $('#row-chart').show();
435
 
436
 
437
                } else {
438
                    $.fn.showError(response['data']);
439
                }
440
            }).fail(function( jqXHR, textStatus, errorThrown) {
441
                $.fn.showError(textStatus);
442
            }).always(function() {
443
                NProgress.done();
444
            });
445
        });
446
 
447
 
448
        $('body').on('click', 'button.btn-download', function(e) {
449
            e.preventDefault();
450
 
451
            NProgress.start();
452
             var action = $(this).data('href');
453
 
454
 
455
            $.ajax({
456
                'dataType'  : 'json',
457
                'method'    : 'get',
458
                'url'       : action,
459
            }).done(function(response) {
460
                if(response['success']) {
461
                    var anchor = window.document.createElement("a");
462
                    anchor.href = 'data:application/octet-stream;charset=utf-8;base64,' + response['data']['content'] ;
463
                    anchor.download = response['data']['basename'];
464
                    document.body.appendChild(anchor);
465
                    anchor.click();  // IE: "Access is denied"; see: https://connect.microsoft.com/IE/feedback/details/797361/ie-10-treats-blob-url-as-cross-origin-and-denies-access
466
                    document.body.removeChild(anchor);
467
                } else {
468
                    $.fn.showError(response['data']);
469
                }
470
            }).fail(function( jqXHR, textStatus, errorThrown) {
471
                $.fn.showError(textStatus);
472
            }).always(function() {
473
                NProgress.done();
474
            });
475
 
476
 
477
        });
478
 
479
 
480
 
16701 efrain 481
        $('body').on('click', 'button.btn-refresh', function(e) {
482
            e.preventDefault();
483
            gridTable.api().ajax.reload(null, false);
484
        });
485
 
486
 
487
        $('body').on('click', 'button.btn-cancel', function(e) {
488
            e.preventDefault();
16747 efrain 489
            $('#row-chart').hide();
16701 efrain 490
            $('#row-form').hide();
491
            $('#row-listing').show();
492
        });
493
 
16822 efrain 494
    $('body').on('click', 'button.btn-delete', function(e) {
495
        e.preventDefault();
496
        var action = $(this).data('href');
497
 
498
 
499
          swal.fire({
500
            title: 'LABEL_ARE_YOU_SURE',
501
            icon: 'question',
502
            cancelButtonText: 'LABEL_NO',
503
            showCancelButton: true,
504
            confirmButtonText: 'LABEL_YES'
505
          }).then((result) => {
506
            if (result.isConfirmed) {
507
 
508
                    NProgress.start();
509
                    $.ajax({
510
                        'dataType'  : 'json',
511
                        'accept'    : 'application/json',
512
                        'method'    : 'post',
513
                        'url'       :  action,
514
                    }).done(function(response) {
515
                        if(response['success']) {
516
                            $.fn.showSuccess(response['data']);
517
                            gridTable.api().ajax.reload(null, false);
518
                        } else {
519
                            $.fn.showError(response['data']);
520
                        }
521
                    }).fail(function( jqXHR, textStatus, errorThrown) {
522
                        $.fn.showError(textStatus);
523
                    }).always(function() {
524
                        NProgress.done();
525
                    });
526
                }
527
           });
528
        });
529
 
16701 efrain 530
        $('#form #number_of_answers').change(function(e) {
531
            e.preventDefault();
532
 
533
            switch(parseInt($(this).val()))
534
                    {
535
                        case 3 :
536
                            $('#form-group-answer3').show();
537
                            $('#form-group-answer4').hide();
538
                            $('#form-group-answer5').hide();
539
                            break;
540
 
541
                        case 4 :
542
                            $('#form-group-answer3').show();
543
                            $('#form-group-answer4').show();
544
                            $('#form-group-answer5').hide();
545
                            break;
546
 
547
                        case 5 :
548
                            $('#form-group-answer3').show();
549
                            $('#form-group-answer4').show();
550
                            $('#form-group-answer5').show();
551
                            break;
552
 
553
                        default :
554
                            $('#form-group-answer3').hide();
555
                            $('#form-group-answer4').hide();
556
                            $('#form-group-answer5').hide();
557
                            break;
558
 
559
                    }
560
 
561
 
562
        });
563
 
564
 
565
        $('#form #duration_days').inputNumberFormat({decimal: 0});
566
        $('#form #duration_hours').inputNumberFormat({decimal: 0});
567
        $('#form #duration_minutes').inputNumberFormat({decimal: 0});
568
 
569
 
570
 
571
 
572
 
573
    });
574
JS;
575
$this->inlineScript()->captureEnd();
576
?>
577
 
16822 efrain 578
<div class="container">
16864 efrain 579
	<div class="card" id="row-listing">
580
	 	<div class="card-header">
581
	 		<h6 class="card-title">LABEL_FAST_SURVEYS</h6>
582
	 	</div>
583
	 	<div class="card-body">
584
	 		<div class="row">
585
	 	         <div class="col-12 mt-3">
586
 
16912 efrain 587
	 	          <table id="gridTable" class="table  table-bordered">
16701 efrain 588
                            <thead>
589
                                <tr>
590
                                    <th>LABEL_QUESTION</th>
591
                                    <th>LABEL_DETAILS</th>
592
                                    <th>LABEL_VOTES</th>
593
                                    <th>LABEL_ACTIONS</th>
594
                                </tr>
595
                            </thead>
596
                            <tbody>
597
                            </tbody>
598
                        </table>
16864 efrain 599
 
600
	 	         </div>
601
	 	     </div>
602
	 	</div>
603
	 	<div class="card-footer text-right">
604
	 		<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
605
       		<?php if ($allowAdd) : ?>
606
         	<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
607
        	<?php endif; ?>
608
 
609
	 	</div>
610
	</div>
611
 
612
	<div class="card" id="row-form" style="display: none">
613
	 	<div class="card-header">
614
	 		<h6 class="card-title" id="card-form-title"></h6>
615
	 	</div>
616
	 	 <?php
16701 efrain 617
                    $form = $this->form;
618
                    $form->setAttributes([
619
                        'method'    => 'post',
620
                        'name'      => 'form',
621
                        'id'        => 'form',
622
                    ]);
623
 
624
                    $form->prepare();
625
                    echo $this->form()->openTag($form);
626
                    ?>
16864 efrain 627
	 	<div class="card-body">
628
	 		<div class="row">
629
	 	         <div class="col-12 mt-3">
16701 efrain 630
                            <?php
631
                            $element = $form->get('question');
632
                            $element->setOptions(['label' => 'LABEL_QUESTION']);
633
                            $element->setAttributes(['class' => 'form-control']);
634
 
635
                            echo $this->formLabel($element);
636
                            echo $this->formText($element);
637
                            ?>
16864 efrain 638
	 	         </div>
639
	 	     </div>
640
	 		<div class="row">
641
	 	         <div class="col-12 mt-3">
16701 efrain 642
                            <?php
643
                            $element = $form->get('number_of_answers');
644
                            $element->setOptions(['label' => 'LABEL_NUMBER_OF_ANSWERS']);
645
                            $element->setAttributes(['class' => 'form-control']);
646
 
647
                            echo $this->formLabel($element);
648
                            echo $this->formSelect($element);
649
                            ?>
16864 efrain 650
	 	         </div>
651
	 	     </div>
652
	 		<div class="row">
653
	 	         <div class="col-12 mt-3">
16701 efrain 654
                            <?php
655
                            $element = $form->get('answer1');
656
                            $element->setOptions(['label' => 'LABEL_ANSWER1']);
657
                            $element->setAttributes(['class' => 'form-control']);
658
 
659
                            echo $this->formLabel($element);
660
                            echo $this->formText($element);
661
                            ?>
16864 efrain 662
	 	         </div>
663
	 	     </div>
664
	 		<div class="row">
665
	 	         <div class="col-12 mt-3">
16701 efrain 666
                            <?php
667
                            $element = $form->get('answer2');
668
                            $element->setOptions(['label' => 'LABEL_ANSWER2']);
669
                            $element->setAttributes(['class' => 'form-control']);
670
 
671
                            echo $this->formLabel($element);
672
                            echo $this->formText($element);
673
                            ?>
16864 efrain 674
	 	         </div>
675
	 	     </div>
676
 
677
	 		<div class="row" id="form-group-answer3">
678
	 	         <div class="col-12 mt-3">
16701 efrain 679
                            <?php
680
                            $element = $form->get('answer3');
681
                            $element->setOptions(['label' => 'LABEL_ANSWER3']);
682
                            $element->setAttributes(['class' => 'form-control']);
683
 
684
                            echo $this->formLabel($element);
685
                            echo $this->formText($element);
686
                            ?>
16864 efrain 687
	 	         </div>
688
	 	     </div>
689
	 		<div class="row" id="form-group-answer4">
690
	 	         <div class="col-12 mt-3">
16701 efrain 691
                            <?php
692
                            $element = $form->get('answer4');
693
                            $element->setOptions(['label' => 'LABEL_ANSWER4']);
694
                            $element->setAttributes(['class' => 'form-control']);
695
 
696
                            echo $this->formLabel($element);
697
                            echo $this->formText($element);
698
                            ?>
16864 efrain 699
	 	         </div>
700
	 	     </div>
701
	 		<div class="row" id="form-group-answer5">
702
	 	         <div class="col-12 mt-3">
16701 efrain 703
                            <?php
704
                            $element = $form->get('answer5');
705
                            $element->setOptions(['label' => 'LABEL_ANSWER5']);
706
                            $element->setAttributes(['class' => 'form-control']);
707
 
708
                            echo $this->formLabel($element);
709
                            echo $this->formText($element);
710
                            ?>
16864 efrain 711
	 	         </div>
712
	 	     </div>
713
	 		<div class="row">
714
	 	         <div class="col-12 mt-3">
16701 efrain 715
                            <?php
716
                            $element = $form->get('privacy');
717
                            $element->setOptions(['label' => 'LABEL_PRIVACY']);
718
                            $element->setAttributes(['class' => 'form-control']);
719
 
720
                            echo $this->formLabel($element);
721
                            echo $this->formSelect($element);
722
                            ?>
16864 efrain 723
	 	         </div>
724
	 	     </div>
725
	 		<div class="row">
726
	 	         <div class="col-12 mt-3">
16701 efrain 727
                            <?php
728
                            $element = $form->get('result_type');
729
                            $element->setOptions(['label' => 'LABEL_RESULT_TYPE']);
730
                            $element->setAttributes(['class' => 'form-control']);
731
 
732
                            echo $this->formLabel($element);
733
                            echo $this->formSelect($element);
734
                            ?>
16864 efrain 735
	 	         </div>
736
	 	     </div>
737
	 		<div class="row">
738
	 	         <div class="col-12 mt-3">
16701 efrain 739
                            <?php
740
                            $element = $form->get('duration_days');
741
                            $element->setOptions(['label' => 'LABEL_DURATION_DAYS']);
742
                            $element->setAttributes(['class' => 'form-control']);
743
 
744
                            echo $this->formLabel($element);
745
                            echo $this->formNumber($element);
746
                            ?>
16864 efrain 747
	 	         </div>
748
	 	     </div>
749
	 		<div class="row">
750
	 	         <div class="col-12 mt-3">
16701 efrain 751
                            <?php
752
                            $element = $form->get('duration_hours');
753
                            $element->setOptions(['label' => 'LABEL_DURATION_HOURS']);
754
                            $element->setAttributes(['class' => 'form-control']);
755
 
756
                            echo $this->formLabel($element);
757
                            echo $this->formNumber($element);
758
                            ?>
16864 efrain 759
	 	         </div>
760
	 	     </div>
761
	 		<div class="row">
762
	 	         <div class="col-12 mt-3">
16701 efrain 763
                            <?php
764
                            $element = $form->get('duration_minutes');
765
                            $element->setOptions(['label' => 'LABEL_DURATION_MINUTES']);
766
                            $element->setAttributes(['class' => 'form-control']);
767
 
768
                            echo $this->formLabel($element);
769
                            echo $this->formNumber($element);
770
                            ?>
16864 efrain 771
	 	         </div>
772
	 	     </div>
773
	 	</div>
774
	 	<div class="card-footer text-right">
775
                 		<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
16701 efrain 776
                        <button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
16864 efrain 777
 
778
	 	</div>
779
	 	 <?php echo $this->form()->closeTag($form); ?>
780
	</div>
781
 
782
 
783
	<div class="card"  id="row-chart" style="display: none">
784
	 	<div class="card-header">
785
	 		<h6 class="card-title" id="chart-question"></h6>
786
	 	</div>
787
	 	<div class="card-body">
788
	 		<div class="row">
789
	 	         <div class="col-12 mt-3">
790
	 	         	<div class="col-lg-12 col-12 chart">
16747 efrain 791
                                <canvas id="chartResult" style="min-height: 250px; height: 250px; max-height: 250px; max-width: 100%;"></canvas>
792
                            </div>
16864 efrain 793
	 	         </div>
794
	 	     </div>
795
	 	</div>
796
	 	<div class="card-footer text-right">
797
			<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
798
	 	</div>
799
	</div>
800
 
801
 
802
</div>
803
 
16701 efrain 804
 
805
 
16822 efrain 806