Advertisement
fadlyshafa

Untitled

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