fadlyshafa

Untitled

Sep 8th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.44 KB | None | 0 0
  1. @extends('layouts.master')
  2.  
  3. @section('content')
  4.  
  5. <div class="row">
  6.     <div class="col-md-12">
  7.         <p>
  8.             <button class="btn btn-flat btn-sm btn-warning btn-refresh"><i class="fa fa-refresh"></i> Refresh</button>
  9.  
  10.             <a href="{{ url('master/buku/add') }}" class="btn btn-flat btn-sm btn-success"><i class="fa fa-plus"></i> Tambah Buku</a>
  11.         </p>
  12.         <div class="box box-warning">
  13.             <div class="box-header">
  14.                 <h4>{{ $title }}</h4>
  15.             </div>
  16.             <div class="box-body">
  17.                 <table class="table table-hover myTable">
  18.                     <thead>
  19.                         <tr>
  20.                             <th>#</th>
  21.                             <th>Gambar</th>
  22.                             <th>Judul</th>
  23.                             <th>Kategori</th>
  24.                             <th>Penulis</th>
  25.                             <th>Stock</th>
  26.                             <th>Created At</th>
  27.                             <th>Action</th>
  28.                         </tr>
  29.                     </thead>
  30.                     <tbody>
  31.                         @foreach($data as $e=>$dt)
  32.                         <tr>
  33.                             <td>{{ $e+1 }}</td>
  34.                             <td>
  35.                                 <img src="{{ asset('uploads/'.$dt->gambar) }}" style="width: 50px;">
  36.                             </td>
  37.                             <td>{{ $dt->judul }}</td>
  38.                             <td>
  39.                                 {{ $dt->nama }}
  40.                             </td>
  41.                             <td>{{ $dt->penulis }}</td>
  42.                             <td>{{ $dt->stock }}</td>
  43.                             <td>{{ $dt->created_at }}</td>
  44.                             <td>
  45.                                 <p>
  46.                                     <a href="{{ url('master/buku/'.$dt->id) }}" class="btn btn-flat btn-xs btn-warning"><i class="fa fa-pencil"></i></a>
  47.                                     <a href="{{ url('master/buku/'.$dt->id) }}" class="btn btn-flat btn-xs btn-danger btn-hapus"><i class="fa fa-trash"></i></a>
  48.                                 </p>
  49.                             </td>
  50.                         </tr>
  51.                         @endforeach
  52.                     </tbody>
  53.                 </table>
  54.             </div>
  55.         </div>
  56.     </div>
  57. </div>
  58.  
  59. <!-- Modal Hapus -->
  60. <div class="modal fade" id="modal-notification" tabindex="-1" role="dialog" aria-labelledby="modal-notification" aria-hidden="true">
  61.       <div class="modal-dialog modal-danger modal-dialog-centered modal-" role="document">
  62.         <div class="modal-content bg-gradient-danger">
  63.  
  64.           <div class="modal-header">
  65.             <h6 class="modal-title" id="modal-title-notification">Your attention is required</h6>
  66.             <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  67.               <span aria-hidden="true">×</span>
  68.             </button>
  69.           </div>
  70.  
  71.           <div class="modal-body">
  72.  
  73.             <div class="py-3 text-center">
  74.               <i class="ni ni-bell-55 ni-3x"></i>
  75.               <h4 class="heading mt-4">Apakah kamu yakin ingin menghapus data ini?</h4>
  76.             </div>
  77.  
  78.           </div>
  79.  
  80.           <div class="modal-footer">
  81.             <form action="" method="post">
  82.               {{ csrf_field() }}
  83.               {{ method_field('delete') }}
  84.               <button type="submit" class="btn btn-white">Ok, Got it</button>
  85.             </form>
  86.             <button type="button" class="btn btn-link text-white ml-auto" data-dismiss="modal">Close</button>
  87.           </div>
  88.  
  89.         </div>
  90.       </div>
  91.     </div>
  92.  
  93. @endsection
  94.  
  95. @section('scripts')
  96.  
  97. <script type="text/javascript">
  98.     $(document).ready(function(){
  99.  
  100.         var flash = "{{ Session::has('sukses') }}";
  101.         if(flash){
  102.             var pesan = "{{ Session::get('sukses') }}"
  103.             alert(pesan);
  104.         }
  105.  
  106.         $('.btn-refresh').click(function(e){
  107.             e.preventDefault();
  108.             location.reload();
  109.         })
  110.  
  111.         $('body').on('click','.btn-hapus',function(e){
  112.             e.preventDefault();
  113.             var url = $(this).attr('href');
  114.             $('#modal-notification').find('form').attr('action',url);
  115.            
  116.             $('#modal-notification').modal();
  117.         })
  118.  
  119.     })
  120. </script>
  121.  
  122. @endsection
Add Comment
Please, Sign In to add comment