<x-app-layout>
    @include('admin.include.sidebar')
    <!-- Page Content  -->
    <div class="wrapper">
       <!-- Sidebar  -->
       <!-- Page Content  -->
       <div id="content">
          
          <div class="navbar-expand-lg navbar-light bg-light">
            <form action="{{route('coupon.update',$coupon->id)}}" method="POST" enctype="multipart/form-data">
               @csrf
               @method('PATCH')
               <div class="col-12">
                  <div class="row">
                    <div class="col-md-6 form-group">
                       <label>Heading</label>
                       <input type="text" class="form-control" id="" value="{{$coupon->heading}}" name="heading" required="">
                    </div>
                    <div class="col-md-6 form-group">
                       <label>Discount amt</label>
                       <input type="number" class="form-control" value="{{$coupon->description}}" id="" name="description"required="">
                    </div>
                    <div class="col-md-6 form-group">
                       <label>Offer Code</label>
                       <input type="text" class="form-control" id="" value="{{$coupon->offer_code}}" name="offer_code"required="">
                    </div>
                    <div class="col-md-6 form-group">
                       <label>Minimum Order Amount</label>
                       <input type="text" class="form-control"  value="{{$coupon->minimum_ord_amt}}"id="" name="minimum_ord_amt"required="">
                    </div>
                    <div class="col-md-6 form-group">
                       <label>Start Date</label>
                       <input type="date" class="form-control" id="" value="{{$coupon->start_date}}" name="start_date"required="">
                    </div>
                    <div class="col-md-6 form-group">
                       <label>End Date</label>
                       <input type="date" class="form-control" id="" value="{{$coupon->end_date}}" name="end_date"required="">
                    </div>
                    <div class="col-md-6 form-group">
                       <label>Start Time</label>
                       <input type="time" class="form-control" id="" value="{{$coupon->start_time}}" name="start_time"required="">
                    </div>
                    <div class="col-md-6 form-group">
                       <label>End Time</label>
                       <input type="time" class="form-control" id="" value="{{$coupon->end_time}}" name="end_time"required="">
                    </div>
                    <div class="col-6 form-group">
                       <label>Offer Type</label>
                       <select name="offer_type" class="form-control" required>
                          <option value="Flat" {{$coupon->offer_type == 'Flat' ? 'selected':''}}>Flat</option>
                          <option value="Percentage" {{$coupon->offer_type == 'Percentage' ? 'selected':''}}>Percentage</option>
                       </select>
                    </div>
                    <div class="col-6 form-group">
                       <label>Status</label>
                       <select name="status" class="form-control" required>
                          <option value="1" {{$coupon->status == 1 ? 'selected':''}}>Active</option>
                          <option value="0" {{$coupon->status == 0 ? 'selected':''}}>Inactive</option>
                       </select>
                    </div>
                    <div class="col-4 mb-2">
                        <div class="text-center">
                           <img src="{{env('APP_URL')}}{{Storage::url($coupon->image)}}" class="rounded" alt="{{$coupon->image}}">
                        </div>
                  </div>
                    <div class="col-4">
                       <div class="form-group">
                         <label for="exampleFormControlFile1">Upload Image</label>
                         <input type="file" class="form-control-file" id="exampleFormControlFile1" name="image">
                       </div>
                    </div>
                     <div class="col-md-12">
                        <input type="submit" class="btn btn-success" value="submit">
                     </div>
                  </div>
               </div>
            </form>
          </div>
       </div>
    </div>
  </x-app-layout>