| 15451 | 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('my-coach/categories/add');
 | 
        
           |  |  | 9 | $routeDatatable = $this->url('my-coach/categories');
 | 
        
           |  |  | 10 |   | 
        
           |  |  | 11 | $allowAdd       = $acl->isAllowed($roleName, 'my-coach/categories/add') ? 1 : 0;
 | 
        
           |  |  | 12 | $allowEdit      = $acl->isAllowed($roleName, 'my-coach/categories/edit') ? 1 : 0;
 | 
        
           |  |  | 13 | $allowDelete    = $acl->isAllowed($roleName, 'my-coach/categories/delete') ? 1 : 0;
 | 
        
           |  |  | 14 |   | 
        
           | 16822 | efrain | 15 | $this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
 | 
        
           |  |  | 16 | $this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
 | 
        
           | 15451 | efrain | 17 |   | 
        
           |  |  | 18 |   | 
        
           |  |  | 19 |   | 
        
           | 16929 | efrain | 20 |   | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 |   | 
        
           | 16822 | efrain | 23 | $this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
 | 
        
           | 15451 | efrain | 24 |   | 
        
           | 16822 | efrain | 25 | $this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
 | 
        
           |  |  | 26 | $this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
 | 
        
           | 15451 | efrain | 27 |   | 
        
           |  |  | 28 |   | 
        
           | 16822 | efrain | 29 | $this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
 | 
        
           |  |  | 30 | $this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
 | 
        
           | 15451 | efrain | 31 |   | 
        
           |  |  | 32 |   | 
        
           |  |  | 33 |   | 
        
           |  |  | 34 |   | 
        
           | 16822 | efrain | 35 | $this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.js'));
 | 
        
           |  |  | 36 | $this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/i18n/es.js'));
 | 
        
           |  |  | 37 | $this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.css'));
 | 
        
           | 15451 | efrain | 38 |   | 
        
           | 16927 | efrain | 39 | $this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap5-theme/select2-bootstrap-5-theme.css'));
 | 
        
           | 15451 | efrain | 40 |   | 
        
           | 16822 | efrain | 41 |   | 
        
           |  |  | 42 |   | 
        
           | 15451 | efrain | 43 | $status_active = \LeadersLinked\Model\MyCoachCategory::STATUS_ACTIVE;
 | 
        
           |  |  | 44 | $privacy_company = \LeadersLinked\Model\MyCoachCategory::PRIVACY_COMPANY;
 | 
        
           |  |  | 45 |   | 
        
           |  |  | 46 | $this->inlineScript()->captureStart();
 | 
        
           |  |  | 47 | echo <<<JS
 | 
        
           |  |  | 48 |     jQuery( document ).ready(function( $ ) {
 | 
        
           |  |  | 49 |   | 
        
           |  |  | 50 |         var allowEdit   = $allowEdit;
 | 
        
           |  |  | 51 |         var allowDelete = $allowDelete;
 | 
        
           |  |  | 52 |   | 
        
           |  |  | 53 |         var gridTable = $('#gridTable').dataTable( {
 | 
        
           |  |  | 54 |             'processing': true,
 | 
        
           |  |  | 55 |             'serverSide': true,
 | 
        
           |  |  | 56 |             'searching': true,
 | 
        
           |  |  | 57 |             'order': [[ 0, 'asc' ]],
 | 
        
           |  |  | 58 |             'ordering':  true,
 | 
        
           |  |  | 59 |             'ordenable' : true,
 | 
        
           |  |  | 60 |             'responsive': true,
 | 
        
           |  |  | 61 |             'select' : false,
 | 
        
           |  |  | 62 |         	'paging': true,
 | 
        
           |  |  | 63 |             'pagingType': 'simple_numbers',
 | 
        
           |  |  | 64 |     		'ajax': {
 | 
        
           |  |  | 65 |     			'url' : '$routeDatatable',
 | 
        
           |  |  | 66 |     			'type' : 'get',
 | 
        
           |  |  | 67 |                 'beforeSend': function (request) {
 | 
        
           |  |  | 68 |                   NProgress.start();
 | 
        
           |  |  | 69 |                 },
 | 
        
           |  |  | 70 |                 'dataFilter': function(response) {
 | 
        
           |  |  | 71 |                     var response = jQuery.parseJSON( response );
 | 
        
           |  |  | 72 |   | 
        
           |  |  | 73 |                     var json                = {};
 | 
        
           |  |  | 74 |                     json.recordsTotal       = 0;
 | 
        
           |  |  | 75 |                     json.recordsFiltered    = 0;
 | 
        
           |  |  | 76 |                     json.data               = [];
 | 
        
           |  |  | 77 |   | 
        
           |  |  | 78 |   | 
        
           |  |  | 79 |                     if(response.success) {
 | 
        
           |  |  | 80 |                         json.recordsTotal       = response.data.total;
 | 
        
           |  |  | 81 |                         json.recordsFiltered    = response.data.total;
 | 
        
           |  |  | 82 |                         json.data               = response.data.items;
 | 
        
           |  |  | 83 |                     } else {
 | 
        
           |  |  | 84 |                         $.fn.showError(response.data)
 | 
        
           |  |  | 85 |                     }
 | 
        
           |  |  | 86 |   | 
        
           |  |  | 87 |                     return JSON.stringify( json );
 | 
        
           |  |  | 88 |                 }
 | 
        
           |  |  | 89 |     		},
 | 
        
           |  |  | 90 |             'language' : {
 | 
        
           |  |  | 91 |                 'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
 | 
        
           |  |  | 92 |                 'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
 | 
        
           |  |  | 93 |                 'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
 | 
        
           |  |  | 94 |                 'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
 | 
        
           |  |  | 95 |                 'sInfo':           'LABEL_DATATABLE_SINFO',
 | 
        
           |  |  | 96 |                 'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
 | 
        
           |  |  | 97 |                 'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
 | 
        
           |  |  | 98 |                 'sInfoPostFix':    '',
 | 
        
           |  |  | 99 |                 'sSearch':         'LABEL_DATATABLE_SSEARCH',
 | 
        
           |  |  | 100 |                 'sUrl':            '',
 | 
        
           |  |  | 101 |                 'sInfoThousands':  ',',
 | 
        
           |  |  | 102 |                 'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
 | 
        
           |  |  | 103 |                 'oPaginate': {
 | 
        
           |  |  | 104 |                     'sFirst':    'LABEL_DATATABLE_SFIRST',
 | 
        
           |  |  | 105 |                     'sLast':     'LABEL_DATATABLE_SLAST',
 | 
        
           |  |  | 106 |                     'sNext':     'LABEL_DATATABLE_SNEXT',
 | 
        
           |  |  | 107 |                     'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
 | 
        
           |  |  | 108 |                 },
 | 
        
           |  |  | 109 |                 'oAria': {
 | 
        
           |  |  | 110 |                     'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
 | 
        
           |  |  | 111 |                     'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
 | 
        
           |  |  | 112 |                 },
 | 
        
           |  |  | 113 |             },
 | 
        
           |  |  | 114 |             'drawCallback': function( settings ) {
 | 
        
           |  |  | 115 |                 NProgress.done();
 | 
        
           | 16822 | efrain | 116 |   | 
        
           | 15451 | efrain | 117 |             },
 | 
        
           |  |  | 118 |             'aoColumns': [
 | 
        
           |  |  | 119 |                 { 'mDataProp': 'name' },
 | 
        
           |  |  | 120 |                 { 'mDataProp': 'privacy' },
 | 
        
           |  |  | 121 |                 { 'mDataProp': 'status' },
 | 
        
           |  |  | 122 |                 { 'mDataProp': 'actions' },
 | 
        
           |  |  | 123 |     	    ],
 | 
        
           |  |  | 124 |             'columnDefs': [
 | 
        
           |  |  | 125 |                 {
 | 
        
           |  |  | 126 |                     'targets': 0,
 | 
        
           |  |  | 127 |                     'className' : 'text-vertical-middle',
 | 
        
           |  |  | 128 |                 },
 | 
        
           |  |  | 129 |                 {
 | 
        
           |  |  | 130 |                     'targets': 1,
 | 
        
           |  |  | 131 |                     'orderable': false,
 | 
        
           |  |  | 132 |                     'className' : 'text-vertical-middle',
 | 
        
           |  |  | 133 |   | 
        
           |  |  | 134 |                 },
 | 
        
           |  |  | 135 |   | 
        
           |  |  | 136 |                 {
 | 
        
           |  |  | 137 |                     'targets': -2,
 | 
        
           |  |  | 138 |                     'orderable': false,
 | 
        
           |  |  | 139 |                     'className' : 'text-center',
 | 
        
           |  |  | 140 |                       'render' : function ( data, type, row ) {
 | 
        
           |  |  | 141 |   | 
        
           | 16822 | efrain | 142 |                         checked = data == 'a'  ? 'checked' : '';
 | 
        
           |  |  | 143 |                         return '<div class="form-check">' +
 | 
        
           | 16971 | efrain | 144 |                             '<input type="checkbox" class="form-check-input" disabled="" ' + checked + '>' +
 | 
        
           | 16822 | efrain | 145 |                             '<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
 | 
        
           | 15451 | efrain | 146 |                     }
 | 
        
           |  |  | 147 |                 },
 | 
        
           |  |  | 148 |                 {
 | 
        
           |  |  | 149 |                     'targets': -1,
 | 
        
           |  |  | 150 |                     'orderable': false,
 | 
        
           |  |  | 151 |                     'render' : function ( data, type, row ) {
 | 
        
           |  |  | 152 |                         s = '';
 | 
        
           |  |  | 153 |   | 
        
           |  |  | 154 |                         if(allowEdit) {
 | 
        
           | 16906 | efrain | 155 |                             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> ';
 | 
        
           | 15451 | efrain | 156 |                         }
 | 
        
           |  |  | 157 |                         if(allowDelete) {
 | 
        
           |  |  | 158 |                             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> ';
 | 
        
           |  |  | 159 |                         }
 | 
        
           |  |  | 160 |                         return s;
 | 
        
           |  |  | 161 |                     }
 | 
        
           |  |  | 162 |                 }
 | 
        
           |  |  | 163 |               ],
 | 
        
           |  |  | 164 |         });
 | 
        
           |  |  | 165 |   | 
        
           |  |  | 166 |         var validator = $('#form').validate({
 | 
        
           |  |  | 167 |             debug: true,
 | 
        
           |  |  | 168 |             onclick: false,
 | 
        
           |  |  | 169 |             onkeyup: false,
 | 
        
           |  |  | 170 |             ignore: [],
 | 
        
           |  |  | 171 |             rules: {
 | 
        
           |  |  | 172 |                 'name': {
 | 
        
           |  |  | 173 |                     required: true,
 | 
        
           |  |  | 174 |                     maxlength: 128,
 | 
        
           |  |  | 175 |                 },
 | 
        
           |  |  | 176 |                 'status': {
 | 
        
           |  |  | 177 |                     required: false,
 | 
        
           |  |  | 178 |                 },
 | 
        
           |  |  | 179 |                 'privacy': {
 | 
        
           |  |  | 180 |                     required: true
 | 
        
           |  |  | 181 |                 },
 | 
        
           |  |  | 182 |             },
 | 
        
           |  |  | 183 |             submitHandler: function(form)
 | 
        
           |  |  | 184 |             {
 | 
        
           |  |  | 185 |                 $('#submitBtn').prop('disabled', true);
 | 
        
           |  |  | 186 |                 $.ajax({
 | 
        
           |  |  | 187 |                     'dataType'  : 'json',
 | 
        
           |  |  | 188 |                     'accept'    : 'application/json',
 | 
        
           |  |  | 189 |                     'method'    : 'post',
 | 
        
           |  |  | 190 |                     'url'       :  $('#form').attr('action'),
 | 
        
           |  |  | 191 |                     'data'      :  $('#form').serialize()
 | 
        
           |  |  | 192 |                 }).done(function(response) {
 | 
        
           |  |  | 193 |                     NProgress.start();
 | 
        
           |  |  | 194 |                     if(response['success']) {
 | 
        
           |  |  | 195 |                         $.fn.showSuccess(response['data']);
 | 
        
           |  |  | 196 |   | 
        
           |  |  | 197 |                         $('#modal').modal('hide');
 | 
        
           |  |  | 198 |   | 
        
           |  |  | 199 |   | 
        
           |  |  | 200 |                          gridTable.api().ajax.reload(null, false);
 | 
        
           |  |  | 201 |                     } else {
 | 
        
           |  |  | 202 |                         validator.resetForm();
 | 
        
           |  |  | 203 |                         if(jQuery.type(response['data']) == 'string') {
 | 
        
           |  |  | 204 |                             $.fn.showError(response['data']);
 | 
        
           |  |  | 205 |                         } else  {
 | 
        
           |  |  | 206 |                             $.each(response['data'], function( fieldname, errors ) {
 | 
        
           |  |  | 207 |                                 $.fn.showFormErrorValidator('#form #' + fieldname, errors);
 | 
        
           |  |  | 208 |                             });
 | 
        
           |  |  | 209 |                         }
 | 
        
           |  |  | 210 |                     }
 | 
        
           |  |  | 211 |                     $('#submitBtn').prop('disabled', false);
 | 
        
           |  |  | 212 |                 }).fail(function( jqXHR, textStatus, errorThrown) {
 | 
        
           |  |  | 213 |                    $.fn.showError(textStatus);
 | 
        
           |  |  | 214 |                 }).always(function() {
 | 
        
           |  |  | 215 |                     $('#submitBtn').prop('disabled', false);
 | 
        
           |  |  | 216 |                     NProgress.done();
 | 
        
           |  |  | 217 |                 });
 | 
        
           |  |  | 218 |                 return false;
 | 
        
           |  |  | 219 |             },
 | 
        
           |  |  | 220 |             invalidHandler: function(form, validator) {
 | 
        
           |  |  | 221 |   | 
        
           |  |  | 222 |             }
 | 
        
           |  |  | 223 |         });
 | 
        
           |  |  | 224 |   | 
        
           |  |  | 225 |         $('body').on('click', 'button.btn-add', function(e) {
 | 
        
           |  |  | 226 |             e.preventDefault();
 | 
        
           |  |  | 227 |   | 
        
           | 16840 | efrain | 228 |   | 
        
           | 15451 | efrain | 229 |             $('#form').attr('action', '$routeAdd');
 | 
        
           |  |  | 230 |             $('#form #name').val('');
 | 
        
           |  |  | 231 |             $('#form #privacy').val('$privacy_company').trigger('change');
 | 
        
           |  |  | 232 |             $('#form #status').bootstrapToggle('on');
 | 
        
           | 16701 | efrain | 233 |   | 
        
           | 15451 | efrain | 234 |   | 
        
           |  |  | 235 |             validator.resetForm();
 | 
        
           |  |  | 236 |             $('#modal').modal('show');
 | 
        
           |  |  | 237 |   | 
        
           |  |  | 238 |             return false;
 | 
        
           |  |  | 239 |         });
 | 
        
           |  |  | 240 |   | 
        
           |  |  | 241 |         $('body').on('click', 'button.btn-edit', function(e) {
 | 
        
           |  |  | 242 |             e.preventDefault();
 | 
        
           |  |  | 243 |             NProgress.start();
 | 
        
           |  |  | 244 |             var action = $(this).data('href');
 | 
        
           |  |  | 245 |             $('#submitBtn').prop('disabled', true);
 | 
        
           |  |  | 246 |             $.ajax({
 | 
        
           |  |  | 247 |                 'dataType'  : 'json',
 | 
        
           |  |  | 248 |                 'method'    : 'get',
 | 
        
           |  |  | 249 |                 'url'       :  action,
 | 
        
           |  |  | 250 |             }).done(function(response) {
 | 
        
           |  |  | 251 |                 if(response['success']) {
 | 
        
           |  |  | 252 |   | 
        
           | 16840 | efrain | 253 |   | 
        
           | 15451 | efrain | 254 |                     $('#form').attr('action', action);
 | 
        
           |  |  | 255 |                     $('#form #name').val(response['data']['name']);
 | 
        
           |  |  | 256 |                     $('#form #privacy').val(response['data']['privacy']).trigger('change');
 | 
        
           |  |  | 257 |                     $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
 | 
        
           |  |  | 258 |                     validator.resetForm();
 | 
        
           |  |  | 259 |   | 
        
           |  |  | 260 |                     $('#modal').modal('show');
 | 
        
           |  |  | 261 |   | 
        
           |  |  | 262 |                 } else {
 | 
        
           |  |  | 263 |                     $.fn.showError(response['data']);
 | 
        
           |  |  | 264 |                 }
 | 
        
           |  |  | 265 |                 $('#submitBtn').prop('disabled', false);
 | 
        
           |  |  | 266 |             }).fail(function( jqXHR, textStatus, errorThrown) {
 | 
        
           |  |  | 267 |                 $.fn.showError(textStatus);
 | 
        
           |  |  | 268 |             }).always(function() {
 | 
        
           |  |  | 269 |                 NProgress.done();
 | 
        
           |  |  | 270 |                 $('#submitBtn').prop('disabled', false);
 | 
        
           |  |  | 271 |             });
 | 
        
           |  |  | 272 |   | 
        
           |  |  | 273 |             return false;
 | 
        
           |  |  | 274 |         });
 | 
        
           |  |  | 275 |   | 
        
           |  |  | 276 |         $('body').on('click', 'button.btn-refresh', function(e) {
 | 
        
           |  |  | 277 |             e.preventDefault();
 | 
        
           |  |  | 278 |             gridTable.api().ajax.reload(null, false);
 | 
        
           |  |  | 279 |   | 
        
           |  |  | 280 |             return false;
 | 
        
           |  |  | 281 |         });
 | 
        
           |  |  | 282 |   | 
        
           |  |  | 283 |   | 
        
           |  |  | 284 |   | 
        
           |  |  | 285 |   | 
        
           |  |  | 286 |         $('body').on('click', 'button.btn-cancel', function(e) {
 | 
        
           |  |  | 287 |             e.preventDefault();
 | 
        
           |  |  | 288 |             $('#modal').modal('hide');
 | 
        
           |  |  | 289 |         });
 | 
        
           |  |  | 290 |   | 
        
           | 16822 | efrain | 291 |     $('body').on('click', 'button.btn-delete', function(e) {
 | 
        
           |  |  | 292 |         e.preventDefault();
 | 
        
           |  |  | 293 |         var action = $(this).data('href');
 | 
        
           |  |  | 294 |   | 
        
           |  |  | 295 |   | 
        
           |  |  | 296 |           swal.fire({
 | 
        
           |  |  | 297 |             title: 'LABEL_ARE_YOU_SURE',
 | 
        
           |  |  | 298 |             icon: 'question',
 | 
        
           |  |  | 299 |             cancelButtonText: 'LABEL_NO',
 | 
        
           |  |  | 300 |             showCancelButton: true,
 | 
        
           |  |  | 301 |             confirmButtonText: 'LABEL_YES'
 | 
        
           |  |  | 302 |           }).then((result) => {
 | 
        
           |  |  | 303 |             if (result.isConfirmed) {
 | 
        
           |  |  | 304 |   | 
        
           |  |  | 305 |                     NProgress.start();
 | 
        
           |  |  | 306 |                     $.ajax({
 | 
        
           |  |  | 307 |                         'dataType'  : 'json',
 | 
        
           |  |  | 308 |                         'accept'    : 'application/json',
 | 
        
           |  |  | 309 |                         'method'    : 'post',
 | 
        
           |  |  | 310 |                         'url'       :  action,
 | 
        
           |  |  | 311 |                     }).done(function(response) {
 | 
        
           |  |  | 312 |                         if(response['success']) {
 | 
        
           |  |  | 313 |                             $.fn.showSuccess(response['data']);
 | 
        
           |  |  | 314 |                             gridTable.api().ajax.reload(null, false);
 | 
        
           |  |  | 315 |                         } else {
 | 
        
           |  |  | 316 |                             $.fn.showError(response['data']);
 | 
        
           |  |  | 317 |                         }
 | 
        
           |  |  | 318 |                     }).fail(function( jqXHR, textStatus, errorThrown) {
 | 
        
           |  |  | 319 |                         $.fn.showError(textStatus);
 | 
        
           |  |  | 320 |                     }).always(function() {
 | 
        
           |  |  | 321 |                         NProgress.done();
 | 
        
           |  |  | 322 |                     });
 | 
        
           |  |  | 323 |                 }
 | 
        
           |  |  | 324 |            });
 | 
        
           |  |  | 325 |         });
 | 
        
           |  |  | 326 |   | 
        
           | 15451 | efrain | 327 |         $('#form #privacy').select2({
 | 
        
           | 16918 | efrain | 328 |             theme: 'bootstrap-5',
 | 
        
           | 15451 | efrain | 329 |             width: '100%',
 | 
        
           | 16941 | stevensc | 330 |             dropdownParent: $('#modal'),
 | 
        
           | 15451 | efrain | 331 |         });
 | 
        
           |  |  | 332 |   | 
        
           |  |  | 333 |         $('#form #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
 | 
        
           |  |  | 334 |   | 
        
           |  |  | 335 |     });
 | 
        
           |  |  | 336 | JS;
 | 
        
           |  |  | 337 | $this->inlineScript()->captureEnd();
 | 
        
           |  |  | 338 | ?>
 | 
        
           |  |  | 339 |   | 
        
           | 16864 | efrain | 340 | <div class="container">
 | 
        
           | 16941 | stevensc | 341 |     <div class="card" id="">
 | 
        
           |  |  | 342 |         <div class="card-header">
 | 
        
           |  |  | 343 |             <h6 class="card-title">LABEL_MY_COACH_CATEGORIES</h6>
 | 
        
           |  |  | 344 |         </div>
 | 
        
           |  |  | 345 |         <div class="card-body">
 | 
        
           |  |  | 346 |             <div class="row">
 | 
        
           |  |  | 347 |                 <div class="col-12 mt-3">
 | 
        
           | 15451 | efrain | 348 |   | 
        
           | 16941 | stevensc | 349 |                     <table id="gridTable" class="table table-bordered">
 | 
        
           |  |  | 350 |                         <thead>
 | 
        
           |  |  | 351 |                             <tr>
 | 
        
           |  |  | 352 |                                 <th>LABEL_NAME</th>
 | 
        
           |  |  | 353 |                                 <th>LABEL_PRIVACY</th>
 | 
        
           |  |  | 354 |                                 <th>LABEL_ACTIVE</th>
 | 
        
           |  |  | 355 |                                 <th>LABEL_ACTIONS</th>
 | 
        
           |  |  | 356 |                             </tr>
 | 
        
           |  |  | 357 |                         </thead>
 | 
        
           |  |  | 358 |                         <tbody>
 | 
        
           |  |  | 359 |                         </tbody>
 | 
        
           |  |  | 360 |                     </table>
 | 
        
           | 16864 | efrain | 361 |   | 
        
           | 16941 | stevensc | 362 |                 </div>
 | 
        
           |  |  | 363 |             </div>
 | 
        
           |  |  | 364 |         </div>
 | 
        
           |  |  | 365 |         <div class="card-footer text-right">
 | 
        
           |  |  | 366 |             <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
 | 
        
           |  |  | 367 |             <?php if ($allowAdd) : ?>
 | 
        
           |  |  | 368 |                 <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
 | 
        
           |  |  | 369 |             <?php endif; ?>
 | 
        
           |  |  | 370 |         </div>
 | 
        
           |  |  | 371 |     </div>
 | 
        
           | 16864 | efrain | 372 |   | 
        
           |  |  | 373 |   | 
        
           | 16941 | stevensc | 374 |   | 
        
           |  |  | 375 |   | 
        
           | 16864 | efrain | 376 | </div>
 | 
        
           |  |  | 377 |   | 
        
           |  |  | 378 |   | 
        
           |  |  | 379 |   | 
        
           |  |  | 380 |   | 
        
           | 15451 | efrain | 381 | <!-- The Modal -->
 | 
        
           |  |  | 382 | <div class="modal" id="modal">
 | 
        
           |  |  | 383 |     <div class="modal-dialog  modal-xl">
 | 
        
           |  |  | 384 |         <div class="modal-content">
 | 
        
           |  |  | 385 |   | 
        
           |  |  | 386 |             <!-- Modal Header -->
 | 
        
           |  |  | 387 |             <div class="modal-header">
 | 
        
           | 16845 | efrain | 388 |                 <h6 class="modal-title">LABEL_MY_COACH_CATEGORIES</h6>
 | 
        
           | 16822 | efrain | 389 |                 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
 | 
        
           | 15451 | efrain | 390 |             </div>
 | 
        
           |  |  | 391 |   | 
        
           |  |  | 392 |             <!-- Modal body -->
 | 
        
           |  |  | 393 |             <div class="modal-body">
 | 
        
           |  |  | 394 |   | 
        
           |  |  | 395 |                 <?php
 | 
        
           |  |  | 396 |                 $form = $this->form;
 | 
        
           |  |  | 397 |                 $form->setAttributes([
 | 
        
           |  |  | 398 |                     'method'    => 'post',
 | 
        
           |  |  | 399 |                     'name'      => 'form',
 | 
        
           |  |  | 400 |                     'id'        => 'form'
 | 
        
           |  |  | 401 |                 ]);
 | 
        
           |  |  | 402 |   | 
        
           |  |  | 403 |                 $form->prepare();
 | 
        
           |  |  | 404 |                 echo $this->form()->openTag($form);
 | 
        
           |  |  | 405 |   | 
        
           |  |  | 406 |                 ?>
 | 
        
           |  |  | 407 |                 <div class="card-body">
 | 
        
           | 16941 | stevensc | 408 |   | 
        
           |  |  | 409 |                     <div class="row">
 | 
        
           |  |  | 410 |                         <div class="col-12 mt-3">
 | 
        
           |  |  | 411 |                             <?php
 | 
        
           | 15451 | efrain | 412 |                             $element = $form->get('name');
 | 
        
           |  |  | 413 |                             $element->setOptions(['label' => 'LABEL_NAME']);
 | 
        
           |  |  | 414 |                             $element->setAttributes(['class' => 'form-control']);
 | 
        
           |  |  | 415 |   | 
        
           |  |  | 416 |                             echo $this->formLabel($element);
 | 
        
           |  |  | 417 |                             echo $this->formText($element);
 | 
        
           |  |  | 418 |                             ?>
 | 
        
           | 16941 | stevensc | 419 |                         </div>
 | 
        
           |  |  | 420 |                     </div>
 | 
        
           | 15451 | efrain | 421 |   | 
        
           | 16941 | stevensc | 422 |                     <div class="row">
 | 
        
           |  |  | 423 |                         <div class="col-12 mt-3">
 | 
        
           |  |  | 424 |                             <?php
 | 
        
           |  |  | 425 |                             $element = $form->get('privacy');
 | 
        
           |  |  | 426 |                             $element->setAttributes(['class' => 'form-control']);
 | 
        
           |  |  | 427 |                             $element->setOptions(['label' => 'LABEL_PRIVACY']);
 | 
        
           | 15451 | efrain | 428 |   | 
        
           | 16941 | stevensc | 429 |                             echo $this->formLabel($element);
 | 
        
           |  |  | 430 |                             echo $this->formSelect($element);
 | 
        
           |  |  | 431 |                             ?>
 | 
        
           | 15451 | efrain | 432 |   | 
        
           | 16941 | stevensc | 433 |                         </div>
 | 
        
           |  |  | 434 |                     </div>
 | 
        
           | 15451 | efrain | 435 |   | 
        
           | 16941 | stevensc | 436 |                     <div class="row">
 | 
        
           |  |  | 437 |                         <div class="col-12 mt-3">
 | 
        
           |  |  | 438 |                             <?php
 | 
        
           |  |  | 439 |                             $element = $form->get('status');
 | 
        
           |  |  | 440 |                             $element->setOptions(['label' => 'LABEL_STATUS']);
 | 
        
           |  |  | 441 |                             // echo $this->formLabel($element);
 | 
        
           |  |  | 442 |                             echo $this->formCheckbox($element);
 | 
        
           |  |  | 443 |                             ?>
 | 
        
           | 15451 | efrain | 444 |   | 
        
           | 16941 | stevensc | 445 |                         </div>
 | 
        
           |  |  | 446 |                     </div>
 | 
        
           | 15451 | efrain | 447 |   | 
        
           | 16941 | stevensc | 448 |                 </div>
 | 
        
           | 16864 | efrain | 449 |   | 
        
           | 16941 | stevensc | 450 |   | 
        
           |  |  | 451 |                 <?php echo $this->form()->closeTag($form); ?>
 | 
        
           |  |  | 452 |                 <!-- Modal footer -->
 | 
        
           |  |  | 453 |                 <div class="modal-footer text-right">
 | 
        
           |  |  | 454 |                     <button type="submit" id="submitBtn" form="form" class="btn btn-primary">LABEL_SAVE</button>
 | 
        
           |  |  | 455 |                     <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
 | 
        
           |  |  | 456 |                 </div>
 | 
        
           | 15451 | efrain | 457 |             </div>
 | 
        
           |  |  | 458 |   | 
        
           |  |  | 459 |   | 
        
           | 16941 | stevensc | 460 |         </div>
 | 
        
           | 15451 | efrain | 461 |     </div>
 | 
        
           |  |  | 462 | </div>
 |