fadlyshafa

Untitled

Aug 24th, 2019
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.68 KB | None | 0 0
  1. @extends('admin.layouts.master')
  2.  
  3. @section('content')
  4.  
  5. <div class="row">
  6.     <div class="col-md-10 col-md-offset-1">
  7.         <div class="box">
  8.             <div class="box-header">
  9.                 <p>
  10.                     <a href="{{ url('admin/user/add') }}" class="btn btn-sm btn-success">Tambah User</a>
  11.                 </p>
  12.             </div>
  13.  
  14.             <div class="box-body">
  15.                
  16.                 <table class="table myTable">
  17.                     <thead>
  18.                         <tr>
  19.                             <th>#</th>
  20.                             <th>Email</th>
  21.                             <th>Action</th>
  22.                         </tr>
  23.                     </thead>
  24.                     <tbody>
  25.                         @foreach($data as $e=>$dt)
  26.                         <tr>
  27.                             <td>{{ $e+1 }}</td>
  28.                             <td>{{ $dt->email }}</td>
  29.                             <td>
  30.                                 <div style="width:60px">
  31.                                     <a href="{{ url('admin/user/'.$dt->id) }}" class="btn btn-warning btn-xs btn-edit" id="edit"><i class="fa fa-pencil-square-o"></i></a>
  32.  
  33.                                     <button href="{{ url('admin/user/'.$dt->id) }}" class="btn btn-danger btn-xs btn-hapus" id="delete"><i class="fa fa-trash-o"></i></button>
  34.                                 </div>
  35.                             </td>
  36.                         </tr>
  37.                         @endforeach
  38.                     </tbody>
  39.                 </table>
  40.  
  41.             </div>
  42.         </div>
  43.     </div>
  44. </div>
  45.  
  46. <!-- modal hapus -->
  47. <div class="modal fade" id="modal-hapus" tabindex="-1" role="dialog" aria-labelledby="modal-notification" aria-hidden="true">
  48.       <div class="modal-dialog modal-default modal-dialog-centered modal-" role="document">
  49.         <div class="modal-content bg-gradient-danger">
  50.  
  51.           <div class="modal-header">
  52.             <h6 class="modal-title" id="modal-title-notification">Your attention is required</h6>
  53.             <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  54.               <span aria-hidden="true">×</span>
  55.             </button>
  56.           </div>
  57.  
  58.           <div class="modal-body">
  59.  
  60.             <div class="py-3 text-center">
  61.               <i class="ni ni-bell-55 ni-3x"></i>
  62.               <h4 class="heading mt-4">Apakah kamu yakin ingin menghapus data ini?</h4>
  63.             </div>
  64.  
  65.           </div>
  66.  
  67.           <div class="modal-footer">
  68.             <form action="" method="post">
  69.               {{ csrf_field() }}
  70.               {{ method_field('delete') }}
  71.               <button type="submit" class="btn btn-white">Ok, Got it</button>
  72.             </form>
  73.             <button type="button" class="btn btn-link text-white ml-auto" data-dismiss="modal">Close</button>
  74.           </div>
  75.  
  76.         </div>
  77.       </div>
  78.     </div>
  79.  
  80. @endsection
  81.  
  82. @section('scripts')
  83.  
  84. <script type="text/javascript">
  85.     $(document).ready(function(){
  86.         $('body').on('click','.btn-hapus',function(e){
  87.             e.preventDefault();
  88.             var url = $(this).attr('href');
  89.             $('#modal-hapus').find('form').attr('action',url);
  90.  
  91.             $('#modal-hapus').modal();
  92.         })
  93.     })
  94. </script>
  95.  
  96. @endsection
Advertisement
Add Comment
Please, Sign In to add comment