@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;">Member Info Edit</h5>
            </div>

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

                    <input type="hidden" name="user_id" value="{{$member_data->id}}">
                
                    <div class="row">
                        <div class="col-md-6">
                            <input style="margin-bottom: 5px;margin-top: 10px;height: 38px;background: transparent;" class="form-control" type="text" value="{{$member_data->username}}" readonly>
                        </div>

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

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

                        <div class="col-md-6">
                            <select style="margin-bottom: 5px; height: 38px;" class="select2-single" name="country" required>
                                @if(is_null($member_data->country))
                                <option value="">Select Country</option>
                                @else
                                <option value="{{$member_data->country}}">{{$member_data->country}}</option>
                                @endif
                                @foreach($country as $c)
                                <option value="{{$c->country_name}}">{{$c->country_name}}</option>
                                @endforeach
                            </select>
                        </div>

                        <div class="col-md-6">
                            <textarea style="margin-bottom: 5px;margin-top: 10px;" rows="3" name="address" class="form-control" placeholder="Enter Address" required>{!! $member_data->address !!}</textarea>
                        </div>

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

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


    <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;">Password Update</h5>
            </div>

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

                    <input type="hidden" name="user_id" value="{{$member_data->id}}">
                
                    <div class="row">

                        <div class="col-md-6">
                            <input style="margin-bottom: 10px;height: 38px;" class="form-control" type="password" name="password" id="password" placeholder="Enter New Password" required>
                        </div>

                        <div class="col-md-6">
                            <input style="margin-bottom: 10px;height: 38px;" class="form-control" type="password" name="conf_password" id="conf_password" placeholder="Enter Again" required>
                        </div>

                        <div class="col-md-6">
                            <button style="height: 38px;background: #ec1666;color: #fff;" type="submit" class="btn">Confirm Now</button>
                        </div>
                    </div>

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

    <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">
                @if(is_null($member_data->pin))
                <h5 class="card-title" style="font-weight: bold; padding-top: 15px; font-size: 20px;">PIN Generate</h5>
                @else
                <h5 class="card-title" style="font-weight: bold; padding-top: 15px; font-size: 20px;">PIN Update</h5>
                @endif
            </div>

            <div class="card-body" style="padding-bottom: 50px;">
                @if(is_null($member_data->pin))
                <form action="{{url('admin/pingenerate')}}" method="post">@csrf
                    <input type="hidden" name="user_id" value="{{$member_data->id}}">
                    <div class="row">
                        <div class="col-md-6">
                            <input style="margin-bottom: 10px;height: 38px;" class="form-control" type="password" name="pin" id="pin" placeholder="Enter New PIN" required>
                        </div>

                        <div class="col-md-6">
                            <input style="margin-bottom: 10px;height: 38px;" class="form-control" type="password" name="conf_pin" id="conf_pin" placeholder="Enter Again" required>
                        </div>

                        <div class="col-md-6">
                            <button style="height: 38px;background: #ec1666;color: #fff;" type="submit" class="btn">Confirm Now</button>
                        </div>
                    </div>
                </form>
                @else
                <form action="{{url('admin/pinupdate')}}" method="post">@csrf
                    <input type="hidden" name="user_id" value="{{$member_data->id}}">
                    <div class="row">

                        <div class="col-md-6">
                            <input style="margin-bottom: 10px;height: 38px;" class="form-control" type="password" name="pin" id="pin" placeholder="Enter New PIN" required>
                        </div>

                        <div class="col-md-6">
                            <input style="margin-bottom: 10px;height: 38px;" class="form-control" type="password" name="conf_pin" id="conf_pin" placeholder="Enter Again" required>
                        </div>

                        <div class="col-md-6">
                            <button style="height: 38px;background: #ec1666;color: #fff;" type="submit" class="btn">Confirm Now</button>
                        </div>
                    </div>

                </form>
                @endif
            </div>
        </div>
    </div>      
</div>
@endsection