Advertisement
fadlyshafa

Untitled

Dec 28th, 2019
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.65 KB | None | 0 0
  1. @extends('layouts.master')
  2.  
  3. @section('content')
  4.  
  5. <div class="row">
  6.     <div class="col-md-12">
  7.         <h4>{{ $title }}</h4>
  8.         <div class="box box-warning">
  9.             <div class="box-header">
  10.                 <p>
  11.                     <button class="btn btn-sm btn-flat btn-warning btn-refresh"><i class="fa fa-refresh"></i> Refresh</button>
  12.                 </p>
  13.             </div>
  14.             <div class="box-body">
  15.                <table class="table table-hover">
  16.                    <thead>
  17.                        <tr>
  18.                            <th>#</th>
  19.                            <th>user</th>
  20.                            <th>buku</th>
  21.                            <th>penulis buku</th>
  22.                            <th>status</th>
  23.                            <th>created_at</th>
  24.  
  25.                            @if(\Auth::user()->status == 1)
  26.                            <th>action</th>
  27.                            @endif
  28.                        </tr>
  29.                    </thead>
  30.                    <tbody>
  31.                        @foreach($data as $e=>$dt)
  32.                        <tr>
  33.                            <td>{{ $e+1 }}</td>
  34.                            <td>{{ $dt->user_r->name }}</td>
  35.                            <td>{{ $dt->buku_r->judul }}</td>
  36.                            <td>{{ $dt->buku_r->penulis }}</td>
  37.  
  38.                            @if($dt->status == 1)
  39.                            <td><label class="label label-success">Sedang Dipinjam</label></td>
  40.                            @else
  41.                            <td><label class="label label-warning">Sudah Dikembalikan</label></td>
  42.                            @endif
  43.  
  44.                            <td>{{ $dt->created_at }}</td>
  45.  
  46.                            @if(\Auth::user()->status == 1)
  47.                            @if($dt->status==1)
  48.                            <td>
  49.                              <a href="{{ url('pengembalian-buku/'.$dt->id) }}" class="btn btn-primary btn-flat">Kembalikan</a>
  50.                            </td>
  51.                            @else
  52.                            <td></td>
  53.                            @endif
  54.                            @endif
  55.                            
  56.                        </tr>
  57.                        @endforeach
  58.                    </tbody>
  59.                </table>
  60.             </div>
  61.         </div>
  62.     </div>
  63. </div>
  64.  
  65. @endsection
  66.  
  67. @section('scripts')
  68.  
  69. <script type="text/javascript">
  70.     $(document).ready(function(){
  71.  
  72.         // btn refresh
  73.         $('.btn-refresh').click(function(e){
  74.             e.preventDefault();
  75.             $('.preloader').fadeIn();
  76.             location.reload();
  77.         })
  78.  
  79.     })
  80. </script>
  81.  
  82. @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement