@extends('layouts.app')
@section('content')

<div class="container-fluid mt-5">
    <div class="card">
        <div class="card-header">{{ __('Add New Guest') }}
            <br>{{$notice}}
        </div>

        <div class="card-body">
        <form class="" action="/guest/save/" method="GET" enctype="multipart/form-data">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group row"><label class="col-sm-4 col-form-label">Guest Name</label><div class="col-sm-8"><input class="form-control" name="name" id="name" placeholder="Guest Name" type="text"></div></div>
                    <div class="form-group row"><label class="col-sm-4 col-form-label">Guest Email</label><div class="col-sm-8"><input class="form-control" name="email" id="email" placeholder="Guest Email" type="text"></div></div>

                    
                </div>
                <div class="col-sm-6">
                     <div class="form-group row"><label class="col-sm-4 col-form-label">Guest Phone</label><div class="col-sm-8"><input class="form-control" name="phone" id="phone" placeholder="Guest Phone Number" type="text"></div></div>
                    <div class="form-group row"><label class="col-sm-4 col-form-label">Guest Address</label><div class="col-sm-8"><textarea class="form-control" name="address" id="adress" placeholder="Guest Address"></textarea></div></div>
                    
                   
                </div>
            </div>
               
        </div>
        <div class="form-group text-center">
                <button class="btn btn-primary" type="submit">Save</button>
        </form>
                <a class="btn btn-link" href="/home">Cancel</a>
            </div>

    </div>
</div>

    <div class="container-fluid mt-5">
        <div class="card">
            <div class="card-header">{{ __('Guest Listing') }}</div>
            <div class="card-body">

            <div class="row">
                <div class="col-md-12">
                    <table class="table table-striped mb-0 ">
                    <thead class="thead-light">
                        <tr>
                            <th>{{ __("No") }}</th>
                            <th>{{ __("Participant Name") }}</th>
                            <th>{{ __("Email") }}</th>
                            <th>{{ __("Invitation Status") }}</th>
                            <th>{{ __("acceptance Status") }}</th>
                            <th>Action </th>
                           
                        </tr>
                    </thead>
                    <tbody>
                        @if($event)
                        @foreach($event as $event)
                        <tr>
                            <td>{{ $loop->iteration }}</td>
                            <td>{{ $event->fullname }}</td>
                            <td>{{ $event->email }}</td>
                             <td>@if($event->invitation_status == 1) Sent @else Not Send @endif</td>
                            <td>@if($event->acceptance_status == 1) Accepted @else Pending @endif</td>
                           
                            <td> <i class="fa fa-pencil-square"></i> <a href="/manage/{{$event->id}}">
                                    Edit
                                </a></td>
                            
                        </tr>
                        @endforeach
                        @else
                        <tr>
                            <td colspan="6">No data</td>
                        </tr>
                        @endif
                    </tbody>
                </table>
                    
                </div>
            </div>

              
                
            </div>
            <div class="card-footer">
                <a href="{{ route('home') }}" class="btn btn-primary">{{ __('Kembali') }}</a>
            </div>
        </div>
    </div>

    
@endsection
