search_result.blade.php 2.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
@extends('layout')
@section('title')
    search
@endsection

@section('content')
    <section>
        <h2>Daftar Client</h2>
        {{--Cek jika user sudah ada. Jika tidak ada
            maka kolom tidak akan ditampilkan
        --}}
        @if(count($user))
            <table border="1">
                <thead>
                <th>ID</th>
                <th>Image</th>
                <th>Full Name</th>
                <th>Sex</th>
                <th>Identity Card</th>
                <th>Birth Date</th>
                <th>Province</th>
                <th>District</th>
                <th>Sector</th>
                <th>Cellar</th>
                <th>Option</th>
                </thead>
                <tbody>
                @foreach($user as $u)
                    <tr>
                        <td>{{$u->id}}</td>
                        <td><img src="img/{{$u->image}}" alt="{{$u->image}}" style="width:100px;height:100px;"></td>
                        <td>{{$u->fullName}}</td>
                        <td>{{$u->sex}}</td>
                        <td>{{$u->identityCard}}</td>
                        <td>{{$u->birthDate}}</td>
                        <td>{{$u->privince}}</td>
                        <td>{{$u->district}}</td>
                        <td>{{$u->sector}}</td>
                        <td>{{$u->cellar}}</td>
                        <td>
                            <form action="{{'user/'.$u->id.'/edit'}}" method="">
                                <button type="submit">Edit</button>
                            </form>

                            <form action="{{url('user/'.$u->id)}}" method="post">
                                {{ csrf_field() }}
                                <input type="hidden" name="_method" value="DELETE">
                                <button type="submit">Delete</button>
                            </form>
                        </td>
                    </tr>
                @endforeach
                </tbody>

            </table>
        @else
            <h4>User belum ada yang terdaftar</h4>
        @endif
    </section>


@endsection