text: function getAnnualLeavesDatatable() {
      var to = $('#to').val();
      var from = $('#from').val();
      var table = $('#annual_leaves_datatable').DataTable({
          processing: true,
          serverSide: true,
          ajax: {
              url: URL + '/annual-leaves/getAnnualLeavesDatatable',
              type: "POST",
              data: {_token: _TOKEN, to: to, from: from}
          },
          columns: [
              {'className': 'text-center', data: 'DT_RowIndex', orderable: false, sortable: false, searchable: false},
              {'className': 'text-center', data: 'user_name'},
              {'className': 'text-center', data: 'leave_date'},
              {'className': 'text-center', data: 'return_to_work_date'},
              {'className': 'text-center', data: 'annual_leave_type_value'},
              {'className': 'text-center', data: 'total_days_taken'},
              {'className': 'text-center', data: 'annual_leave_notes'},
              {'className': 'text-center', data: 'actions', orderable: false, sortable: false, searchable: false}
          ]
      });
  }
  
  function deleteAnnualLeave(annual_leave_hash) {
      bootbox.confirm("Are you sure you want to delete this leave data?", function (result) {
          if (result) {
              $.post(URL + "/annual-leaves/deleteAnnualLeave", {'_token': _TOKEN, annual_leave_hash: annual_leave_hash}, function (data, status) {
                  if (data == '1') {
                      flashToastSuccess('Leave Record Deleted Successfully');
                      $('#annual_leaves_datatable').DataTable().ajax.reload();
                  } else {
                      flashToastError('Leave Record Deletion Failed');
                  }
              });
          }
      });
  }
  
  $(document).ready(function () {
      getAnnualLeavesDatatable();
  });