@extends('layouts.app')
@section('content')
@include('closer.closerheader')

    <div class='container'>
    <div class='row d-flex justify-content-center'>
        <div class='col-md-8 mt-3 text-center'>
            <a href='{{ route("closer-dashboard") }}' class='btn btn-primary'>Home</a>    
        </div>
    </div>
     <div class='row d-flex justify-content-center'>
        <div class='col-md-5' style='padding-top:20px;'>
            <h2 class='text-center'>Add New Coupon</h2>
                @if ($errors->any())
                <div class="alert alert-danger">
                <ul class='m-0' style='list-style-type:none;'>
                @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
                @endforeach
                </ul>
                </div>
                @endif

    <form method='post' action="{{ route('insertcoupon')}}">
        @csrf

        <div class="form-group my-3">
             <input type="text" class="form-control" name="code" placeholder="Enter Coupon Name">
        </div>   
        <div class="form-group my-3">
            <input type="text" class="form-control" name="discount_price" placeholder="Enter Discount Price">
        </div>  
            <div class="form-group">   
            @foreach($closer as $clsr)
        <input  type="text" hidden class="form-control" id="clsrid" name='closer_id' value='{{$clsr->id}}'>
            @endforeach     
            </div>
    
    <div class="form-group my-3">
        <button type='submit' class='btn btn-success w-100'>Add Coupon</button>
    </div>       
    </form>
    </div>
</div>
</div>

@endsection