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