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

{{-- Product Packages Edit--}}

<form method="POST" action="{{route('PromotionPackage.update',$PromotionPackage->id)}}">
    @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 Promotion Packages</h4>
                </div>            
            </div>  
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-sm-6 form-group">
                    <label for="cbProduct">Product</label>
                    <select class="form-control" id="cbProduct" name="product_id">
                        @php
                        echo App\Http\Controllers\ProductController::ProductListForCombo($PromotionPackage->product_id);
                        @endphp

                    </select>   
                </div>
                <div class="col-sm-6 form-group">
                    <label for="cbService">Service Type</label>
                    <select class="form-control" id="cbService" name="serviceType_id">
                        @php
                        echo App\Http\Controllers\ServiceTypeController::ServiceTypeListForCombo($PromotionPackage->serviceType_id);
                        @endphp
                    </select>
                </div>

                <div class="col-sm-6 form-group">
                    <label for="numQty">Qty</label>
                    <input type="number" class="form-control @error('qty') is-invalid @enderror" name="qty" id="numQty" value="{{$PromotionPackage->qty}}" required/>
                    @error('qty')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
                <div class="col-sm-6 form-group">
                    <label for="txtDiscount">Discount Percentage</label>
                    <input type="text" class="form-control @error('discount') is-invalid @enderror" name="discount" id="txtDiscount" value="{{$PromotionPackage->discount}}"  required/>
                    @error('discount')<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="{{$PromotionPackage->narration}}"/>
                </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('PromotionPackage.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="{{route('Company.store')}}">
            @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="{{route('Company.index')}}" class="btn btn-primary">Back</a> --}}
@endsection




