<?php
if (Auth('admin')->User()->dashboard_style == 'light') {
    $text = 'dark';
    $bg = 'light';
} else {
    $text = 'light';
    $bg = 'dark';
}
?>
@extends('layouts.app')
@section('content')
    @include('admin.topmenu')
    @include('admin.sidebar')
    <div class="main-panel ">
        <div class="content ">
            <div class="page-inner">
                <div class="mt-2 mb-5">
                    <h1 class="title1 d-inline ">{{ $withdrawal->first_name }} {{ $withdrawal->last_name }} Application </h1>
                    <div class="d-inline">

                    </div>
                </div>
            </div>
            <x-danger-alert />
            <x-success-alert />
            <div class=" p-5 ml-5 mb-4 row">
                <div class="col-lg-8 offset-lg-2 card p-md-4 p-2 m-4 col-sm-10 shadow">

                    <div class="">

                        <div class="mb-1 form-group">
                            <h5 class="">Name</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->yourname }}"
                                readonly>
                        </div>
                        <div class="mb-1 form-group">
                            <h5 class="">Email</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->email }}" readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Phone</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->phonenumber }}"
                                readonly>
                        </div>





                        <div class="mb-1 form-group">
                            <h5 class="">Birth Date</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->birthdate }}"
                                readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Pin code</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->pin }}" readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Amount</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->loanamount }}"
                                readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Income</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->income }}"
                                readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Period</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->loanyears }}"
                                readonly>
                        </div>



                        <div class="mb-1 form-group">
                            <h5 class="">Marital Status</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->martialstatus }}"
                                readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Number of dependents</h5>
                            <input type="text" class="form-control readonly  "
                                value="{{ $withdrawal->numberofdependents }}" readonly>
                        </div>



                        <div class="mb-1 form-group">
                            <h5 class="">House no</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->houseno }}"
                                readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Street</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->street }}"
                                readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">City</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->city }}" readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">State</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->state }}"
                                readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">country</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->country }}"
                                readonly>
                        </div>



                        <div class="mb-1 form-group">
                            <h5 class="">Length of Employment</h5>
                            <input type="text" class="form-control readonly  "
                                value="{{ $withdrawal->lengthemployment }}" readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Employment Status</h5>
                            <input type="text" class="form-control readonly  "
                                value="{{ $withdrawal->employer_status }}" readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Work number</h5>
                            <input type="text" class="form-control readonly  " value="{{ $withdrawal->worknumber }}"
                                readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">length of Employment</h5>
                            <input type="text" class="form-control readonly  "
                                value="{{ $withdrawal->lengthemployment }}" readonly>
                        </div>


                        <div class="mb-1 form-group">
                            <h5 class="">Puropse of laon</h5>
                            <textarea id="largeText" name="largeText" class="large-textarea form-control readonly" rows="5" readonly>{{ $withdrawal->purposeloan }}</textarea>
                        </div>




                    </div>

                </div>


            </div>
        </div>


        <script>
            let action = document.getElementById('action');

            $('#action').change(function() {
                if (action.value === "Reject") {
                    document.getElementById('emailcheck').classList.remove('d-none');
                } else {
                    document.getElementById('emailcheck').classList.add('d-none');
                    document.getElementById('emailtext').classList.add('d-none');
                    document.getElementById('dontsend').checked = true;
                    document.getElementById('subject').removeAttribute('required');
                    document.getElementById('message').removeAttribute('required');
                }
            });

            $('#sendemail').click(function() {
                document.getElementById('emailtext').classList.remove('d-none');
                document.getElementById('subject').setAttribute('required', '');
                document.getElementById('message').setAttribute('required', '');
            });

            $('#dontsend').click(function() {
                document.getElementById('emailtext').classList.add('d-none');
                document.getElementById('subject').removeAttribute('required');
                document.getElementById('message').removeAttribute('required');
            });
        </script>
    @endsection
