123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- @extends('admin.layout.index')
- @push('css-head')
- @endpush
- @section('content')
- <!-- Page header -->
- <div class="page-header page-header-light">
- <div class="breadcrumb-line breadcrumb-line-light header-elements-md-inline">
- <div class="d-flex">
- <div class="breadcrumb">
- <a href="{{url('/admin')}}" class="breadcrumb-item"><i class="icon-home2 mr-2"></i> Dashboard</a>
- <span class="breadcrumb-item active">Admins</span>
- </div>
- </div>
- <div class="header-elements d-none">
- <div class="breadcrumb justify-content-center">
- <a href="{{ url('admin/admins/create') }}" class="breadcrumb-elements-item">
- <i class="icon-plus3 mr-2"></i>
- Create new
- </a>
- </div>
- </div>
- </div>
- </div>
- <!-- /page header -->
- <!-- Content area -->
- <div class="content">
- <div class="card">
- <table class="table datatable-basic">
- <thead>
- <tr>
- <th style="width: 5%;">#</th>
- <th>Name</th>
- <th>Email</th>
- <th>Role</th>
- <th>Status</th>
- <th class="text-center">Actions</th>
- </tr>
- </thead>
- <tbody>
- @foreach($admins as $key => $row)
- <tr>
- <td>{{ ++$key }}</td>
- <td>{{ $row->name }}</td>
- <td>{{ $row->email }}</td>
- <td>{{ $row->roles->first()?$row->roles->first()->name:'--' }}</td>
- <td>
- <div class="form-check form-check-switchery">
- <label class="form-check-label">
- <input type="checkbox" class="form-check-input-switchery switchery" name="status{{ $row->id }}" @if($row->status == 1) {{ 'checked' }} @endif data-id="{{ $row->id }}">
- </label>
- </div>
- </td>
- <td class="text-center">
- <div class="list-icons">
- <div class="dropdown">
- <a href="#" class="list-icons-item" data-toggle="dropdown">
- <i class="icon-menu9"></i>
- </a>
- <div class="dropdown-menu dropdown-menu-right">
- <a href="{{ url('admin/admins/view') }}/{{ $row->id }}" class="dropdown-item">
- <i class="icon-eye"></i> View
- </a>
- <a href="{{ url('admin/admins/edit') }}/{{ $row->id }}" class="dropdown-item">
- <i class="icon-pencil7"></i> Edit
- </a>
- {!! Form::model($admins, ['method' => 'delete', 'url' => ['admin/admins/delete', $row->id], 'class' =>'dropdown-item form-delete']) !!}
- {!! Form::hidden('id', $row->id) !!}
- <i class="icon-trash"></i> Delete
- {!! Form::close() !!}
- </div>
- </div>
- </div>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- </div>
- <!-- /content area -->
- @endsection
- @push('scripts')
- <script src="{{ asset('/assets/global/js/plugins/notifications/sweet_alert.min.js') }}"></script>
- <script src="{{ asset('/assets/global/js/plugins/tables/datatables/datatables.min.js') }}"></script>
- <script src="{{ asset('/assets/global/js/demo_pages/datatables_basic.js') }}"></script>
- <script src="{{ asset('/assets/global/js/plugins/forms/styling/switchery.min.js') }}"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $('[data-toggle="tooltip"]').tooltip();
- var elem = document.querySelector('.switchery');
- var init = new Switchery(elem);
- });
- </script>
- <script type="text/javascript">
- $('.form-delete').click(function(e){
- e.preventDefault();
- $form = $(this);
- swal({
- title: 'Are you sure?',
- text: "You won't be able to revert this!",
- type: 'warning',
- showCancelButton: true,
- confirmButtonColor: '#3085d6',
- cancelButtonColor: '#d33',
- confirmButtonText: 'Yes, delete it!'
- }).then((result) => {
- if (result.value) {
- $form.submit();
- }
- });
- });
- $("input[type='checkbox']").on('click', function(){
- var id = $(this).data('id');
- var urll="{{ url('admin/admins/status') }}/"+id;
- var msg_success = 'Status Updated Successfully.';
- var msg_error = 'Something went wrong!';
- $.ajax({
- url:urll,
- success: function(data){
- notify('success',msg_success);
- },
- error: function (data) {
- notify('error',msg_error);
- }
- });
- });
- </script>
- @endpush
|