@extends('admin.template')

@section('content')



    <div class="card">
        <div class="card-header">
            <h3 class="card-title">List of expense_types</h3>
        </div>
        <!-- /.card-header -->
        <div class="card-body">
            <table id="example1" class="table table-bordered table-striped" style="">
                <thead>
                <tr>
                    <th>#</th>
                    <th>اسم المنصرف</th>
                    <th>تعديل</th>
                    <th>حذف</th>
                </tr>
                </thead>
                <tbody>

@forelse($expense_types as $expense_type)

                <tr>
                    <td> {{ $expense_type->id }}</td>
                    <td> {{ $expense_type->title }} </td>

                    <td>
                        <a class="btn btn-info btn-sm" href="/admin/expense_types/{{$expense_type->id}}/edit">
                            <i class="fas fa-pencil-alt">
                            </i>
                            Edit
                        </a>
                    </td>

                    <td>
                        
                            <span class="btn btn-danger btn-sm" >
                                <form action="/admin/expense_types/{{ $expense_type->id }}" method="post">
                                    @method('DELETE')
                                    <button onclick="return confirm('Are you sure you want to delete this ?');" style="border: 0px; background:none; color: white">
                                        <i class="fas fa-trash"></i>
                                        Delete</button>
                                    @csrf
                                </form>


                            </span>
                        
                    </td>
                </tr>

    @empty

    <tr>
       <div style="color: red; font-size: 18px; font-weight: bolder;">No Data Available</div>
    </tr>

                @endforelse










                </tbody>

            </table>
        </div>
        <!-- /.card-body -->
    </div>




@endsection
