@extends('member.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;">Profile Edit</h5>
            </div>

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

                    <div class="row">
                        <div class="col-md-6">
                            <input style="margin-bottom: 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: 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: 10px;height: 38px;" class="form-control" type="text" name="mobile" value="{{$member_data->mobile}}" placeholder="Mobile Number" required>
                        </div> 

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

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

                        <div class="col-md-6">
                            <label style="color: #fff;">Profile Image:</label><br>
                            <input type="file" name="image" class="file">
                        </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('updatepass')}}" method="post">@csrf

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

                        <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>
                            <p style="text-align: left;font-style: italic;font-size: 12px;padding-top: 5px;" id="message"></p>
                        </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('pingenerate')}}" method="post">@csrf
                    <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>
                            <p style="text-align: left;font-style: italic;font-size: 12px;padding-top: 5px;" id="pinmessage"></p>
                        </div>

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

                </form>
                @else
                <form action="{{url('updatepin')}}" method="post">@csrf
                    <div class="row">
                        <div class="col-md-6">
                            <input style="margin-bottom: 10px;height: 38px;background: #fff" class="form-control" type="password" name="current_pin" id="current_pin" placeholder="Enter Exist PIN" required>
                        </div>

                        <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>
                            <p style="text-align: left;font-style: italic;font-size: 12px;padding-top: 5px;" id="pinmessage"></p>
                        </div>

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

                </form> 

                <div style="border: 2px dashed red;padding: 10px;">
                    <a style="color:#fff;padding-bottom: 10px;">Forgot Security PIN? Click the Button to Reset Now</a>.
                    <form action="{{url('secreset')}}" method="post">@csrf
                        <button type="submit" class="btn" style="margin-top: 10px;background: #00dab7;color: #000;">Reset Security PIN</button>
                    </form>
                </div>

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