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

{{-- Edit Company Details--}}

<form method="POST" action="{{route('Company.update',$Company->id)}}" enctype='multipart/form-data'>
    @csrf
    @method('patch')
    <div class="card">
        <div class="card-header">        
            <div class="d-flex align-items-center">
                <div class="p-2  flex-fill bd-highlight">
                    <h4>Edit Company Details</h4>
                </div>            
            </div>  
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-sm-3 form-group">
                    @if($Company->logo)                               
                        <img src="{{asset('storage/CompanyDetail/Logo/'.$Company->logo)}}" alt="avatar" width="100px" id="imgImage"/>
                    @else
                        <p>No Image</p>
                    @endif
                </div>
                <div class="col-sm-8 form-group">
                    <label for="fileLogo">Logo</label>
                    <input type="file" class="form-control-file @error('logo1') is-invalid @enderror" name="logo1" id="fileLogo" value="" required/>
                    @error('logo1')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
                <div class="col-sm-6 form-group">
                    <label for="txtTitle">Title</label>
                    <input type="text" class="form-control @error('title') is-invalid @enderror" name="title" id="txtTitle" value="{{$Company->title}}" required/>
                    @error('title')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
                <div class="col-sm-6 form-group">
                    <label for="txtTagline">Tagline</label>
                    <input type="text" class="form-control  @error('tagline') is-invalid @enderror" name="tagline" id="txtTagline" value="{{$Company->tagline}}" required/>
                    @error('tagline')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
                <div class="col-sm-12 form-group">
                    <label for="txtName">Address</label>
                    <textarea class="form-control @error('address') is-invalid @enderror" id="txtAddress" name="address" rows="4" cols="50" required>{{$Company->address}}</textarea>
                    @error('address')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
                <div class="col-sm-6 form-group">
                    <label for="txtEmail">Email</label>
                    <input type="email" class="form-control @error('email') is-invalid @enderror" name="email" id="txtEmail" value="{{$Company->email}}" required/>
                    @error('email')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
                <div class="col-sm-6 form-group">
                    <label for="txtPhone">Phone</label>
                    <input type="text" class="form-control  @error('phone') is-invalid @enderror" name="phone" id="txtPhone" value="{{$Company->phone}}" required/>
                    @error('phone')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
                <div class="col-sm-12 form-group">
                    <label for="txtName">Narration</label>
                    <input type="text" class="form-control" name="narration" id="txtNarration" value="{{$Company->narration}}" required/>
                </div>

            </div>
        </div>
        <div class="card-footer">
            <div class="d-flex  justify-content-start p-2" style="width:50%;float:left;">
                <a class="btn btn-primary" href="{{route('Employee.index')}}"><i class="fas fa-arrow-left"></i> Back</a>
            </div>
            <div class="d-flex  justify-content-end p-2">
                <button type="reset" class="btn btn-secondary mr-2" name="btnSave">Clear</button>
                <button type="submit" class="btn btn-primary" name="btnSave">Save</button>
            </div>
        </div>
    </div>
</form>




    {{-- <h1 class="text-2xl">Enter your next TODO</h1>
        <form method="post" action="">
            @csrf
            <input type="text" name="title" class="py-2 px-2 border rounded"/>
            <input type="submit" value="Save Todo" class="p-2 rounded"/>
        </form>
        <x-flash/>
        <a href="" class="btn btn-primary">Back</a> --}}
@endsection