@extends('layouts.adminapp')

@section('content')

{{-- Company Details --}}

<div class="card mb-4">
    <div class="card-header">
        <div class="d-flex">
            <div class="mr-auto p-2 align-self-center"><h4>Company Details</h4></div>
            <div class="p-2">
            @if($Item == "")              
            <a class="btn btn-primary" href="{{route('Company.create')}}"><i class="fa fa-plus"></i> ADD New</a>
            @endif
            </div>           
        </div>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <!--th>SLNO.</th-->
                        <th>Logo</th>
                        <th>Name</th>
                        <th>Tagline</th> 
                        <th>Address</th> 
                        <th>Email</th>
                        <th>Phone</th>
                        <th>Narration</th>                
                        <th colspan="">Actions</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($CompanyDetailses as $CompanyDetails)
                    <tr>
                        <td><img width="100px" src="{{asset('storage/CompanyDetail/Logo/'.$CompanyDetails->logo)}}"/></td>
                        <td>{{$CompanyDetails->title}}</td>
                        <td>{{$CompanyDetails->tagline}}</td>
                        <td>{{$CompanyDetails->address}}</td>
                        <td>{{$CompanyDetails->email}}</td>
                        <td>{{$CompanyDetails->phone}}</td>
                        <td>{{$CompanyDetails->narration}}</td>

                        <td><a href="{{route('Company.edit',$CompanyDetails->id)}}" class="btn btn-secondary">Edit</a></td>   
                        <td><form method="POST" action="{{route('Company.destroy',$CompanyDetails->id)}}" Id="form-delete-{{$CompanyDetails->id}}">
                            @csrf
                            @method('delete')
                            <button type="button" class="btn btn-danger"  onclick="
                            event.preventDefault();
                            if(confirm('Are you sure delete this'))
                            {
                                document.getElementById('form-delete-{{$CompanyDetails->id}}').submit();
                            }">Delete</button></form>
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
    <div class="card-footer">
        <div class="d-flex justify-content-end font-weight-bold"><h5>Total:  </h5></div>        
    </div>
</div>





@endsection
