@extends('admin.layout.main')
@section('content')
<div class="row">
    <div class="col-lg-12" style="padding-left: 4px;padding-right: 4px;">
        <div class="card m-b-30" style="border-radius: 5px;">
            <div class="card-header">
                <h5 class="card-title" style="font-weight: bold; padding-top: 15px; font-size: 20px;">Agent Manage</h5>
            </div>

            <div class="card-body" style="padding-bottom: 50px;">
                <form action="{{url('admin/agentdit')}}" method="post">@csrf

                    @if ($errors->any())
                    <div class="alert alert-danger">
                        <ul>
                            @foreach ($errors->all() as $error)
                                <li>{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                    @endif
                
                    <div class="row">
                        <input type="hidden" name="ag_id" value="{{$agdata->id}}">
                        <div class="col-md-6">
                            <input style="margin-top: 10px;height: 38px;" class="form-control" type="text" name="name" placeholder="Name" value="{{$agdata->name}}" required>
                        </div>

                        <div class="col-md-6">
                            <input style="margin-top: 10px;height: 38px;" class="form-control" type="number" name="mobile" id="mobile" value="{{$agdata->mobile}}" placeholder="Mobile" required>
                        </div>

                        <div class="col-md-6">
                            <input style="margin-top: 10px;height: 38px;" class="form-control" type="email" name="email" id="email" placeholder="Email" value="{{$agdata->email}}">
                        </div>

                        <div class="col-md-6">
                            <input style="margin-top: 10px;height: 38px;" class="form-control" type="text" name="shop_name" placeholder="Shop Name" value="{{$agdata->shop_name}}" required>
                        </div>

                        <div class="col-md-6">
                            <input style="margin-top: 10px;height: 38px;" class="form-control" type="number" name="percent" id="percent" min="3" value="{{$agdata->min_ratio}}" placeholder="Min Percent" required>
                        </div>

                        <div class="col-md-6">
                            <textarea style="width: 100%;padding-left: 10px;margin-top: 10px;" class="form-control" rows="3" name="address" placeholder="Shop Address..." required>{!! $agdata->address !!}</textarea>
                        </div> 

                        <div class="col-md-6">
                            <button style="height: 38px;background: #00a2bb;color: #fff;margin-top: 10px;" type="submit" class="btn">Update Now</button>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>      
</div>



@endsection