<!doctype html>
<html lang="en" data-layout="vertical" data-topbar="light" data-sidebar="dark" data-sidebar-size="lg" data-sidebar-image="none" data-preloader="disable">

<head>

    <meta charset="utf-8" />
    <title>APDC Homes</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
    <meta content="Themesbrand" name="author" />
    <!-- App favicon -->
    <link rel="shortcut icon" href="assets/images/favicon.ico">

    <!-- gridjs css -->
    <link rel="stylesheet" href="assets/libs/gridjs/theme/mermaid.min.css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">


    <!-- Layout config Js -->
    <script src="assets/js/layout.js"></script>
    <!-- Bootstrap Css -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Icons Css -->
    <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />
    <!-- App Css-->
    <link href="assets/css/app.min.css" rel="stylesheet" type="text/css" />
    <!-- custom Css-->
    <link href="assets/css/custom.min.css" rel="stylesheet" type="text/css" />

</head>

<body>

<!-- Begin page -->
<div id="layout-wrapper">

    @include('includes.header-topbar')

    <!-- ========== App Menu ========== -->
    @include('includes.sidebar-menu')
    <!-- Left Sidebar End -->
    <!-- Vertical Overlay-->
    <div class="vertical-overlay"></div>

    <!-- ============================================================== -->
    <!-- Start right Content here -->
    <!-- ============================================================== -->

    <!-- ============================================================== -->
    <!-- Start right Content here -->
    <!-- ============================================================== -->
    <div class="main-content">

        <div class="page-content">
            <div class="container-fluid">

                <!-- start page title -->
                <div class="row">
                    <div class="col-12">
                        <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                            <h4 class="mb-sm-0">View Applications</h4>

                            <div class="page-title-right">
                                <ol class="breadcrumb m-0">
                                    <li class="breadcrumb-item"><a href="javascript: void(0);">Applications</a></li>
                                    <li class="breadcrumb-item active">View Application</li>
                                </ol>
                            </div>

                        </div>
                    </div>
                </div>
                <!-- end page title -->

                <div class="row">
                    <div class="col-xxl-8">
                        <!--end card-->
                        <div class="card mb-3">
                            <div class="card-body">
                                @if(session('success'))
                                    <div class="alert alert-success mb-xl-0" role="alert">
                                        <strong> Application Form Modified Successfully</strong>
                                    </div>
                                @endif

                                    <form action="{{route('update-application')}}" method="post">
                                        @csrf
                                <div class="table-card">
                                    <table class="table mb-0">
                                        <tbody>
                                        <tr>
                                            <td class="fw-medium">Passport: <div class="col-auto">
                                                    <div class="avatar-lg">
                                                        <img src="{{ asset('storage/'.$offer->passport1_path) }}" alt="Passport Image" class="img-thumbnail" style="height: 100px;width: 100px">
                                                    </div>
                                                    <div class="avatar-lg">
                                                        <input type="hidden" name="passport1_image" value="{{$offer->passport1_path}}">
                                                        <input type="file" name="passport1_image">
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Serial NO:
                                                <input class="form-control" type="text" placeholder="" value="{{$offer->serial_no ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Name:
                                                <input class="form-control" type="text" placeholder=".form-control"  name="name" value="{{$offer->name ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Permanent Address:
                                                @if ($offer->address)
                                                    <div class="attachment-content">
                                                        <a href="storage/{{$offer->address}}" alt="Click to View">Click to View</a>
                                                    </div>
                                                @else
                                                    <p>No attachment available</p>
                                                @endif
                                            </td>

                                        </tr>

                                        <tr>
                                            <td class="fw-medium">Office Address:
                                                <input type="text" class="form-control" id="basiInput" name="office_address" value="{{$offer->office_address ?? ''}}">
                                            </td>

                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Occupation:
                                                <input type="text" class="form-control" id="basiInput" name="occupation" value="{{$offer->occupation ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Telephone:
                                                <input type="text" class="form-control" id="basiInput" name="telephone" value="{{$offer->telephone ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Email:
                                                <input type="text" class="form-control" id="basiInput" name="email" value="{{$offer->email ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Project:
                                                <input type="text" class="form-control" id="basiInput" name="project" value="{{$offer->project ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">House Type:
                                                <input type="text" class="form-control" id="basiInput" name="house_type" value="{{$offer->house_type ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Amount (₦):
                                                <input type="text" class="form-control" id="basiInput" name="amount" value="{{number_format($offer->amount) ?? ''}}">
                                            </td>
                                        </tr>
                                        <br>
                                        <br>
                                        <tr>
                                            <td class="fw-medium">Next Of Kin Passport:
                                                <div class="col-auto">
                                                    <div class="avatar-lg">
                                                        <img src="{{ asset('storage/'.$offer->passport2_path) }}" alt="Passport Image" class="img-thumbnail" style="width: 100px;height: 100px">
                                                    </div>
                                                </div>
                                                <div class="avatar-lg">
                                                    <input type="hidden" name="passport2_image" value="{{$offer->passport2_path}}">
                                                    <input type="file" name="passport2_image">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Next of Kin:
                                                <input type="text" class="form-control" id="basiInput" name="nok_name" value="{{$offer->nok_name ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Next of Kin's Address:
                                                <input type="text" class="form-control" id="basiInput" name="nok_address" value="{{$offer->nok_address ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-medium">Next of Kin's Email:
                                                <input type="text" class="form-control" id="basiInput" name="nok_email" value="{{$offer->nok_email ?? ''}}">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="fw-la">Next of Kin's Phone:
                                                <input type="text" class="form-control" id="basiInput" name="amount" value="{{$offer->nok_phone ?? ''}}">
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>

                                    <div class="hstack gap-2 justify-content-end d-print-none mt-4">
                                            <button type="submit" class="btn btn-primary">
                                                <i class="align-bottom me-1"></i> Update Application
                                            </button>
                                    </div>
                                    <br>
                                    <br>
                                    <!--end table-->
                                </div>
                                    </form>
                            </div>
                        </div>
                    </div>
                    <!---end col-->
                    <!--end col-->
                </div>
                <!--end row-->

                <!-- end modal -->

            </div>
            <!-- container-fluid -->
        </div>
        <!-- End Page-content -->

        @include('includes.footer')
    </div>
    <!-- end main content-->

</div>
<!-- END layout-wrapper -->



<!--start back-to-top-->
<button onclick="topFunction()" class="btn btn-danger btn-icon" id="back-to-top">
    <i class="ri-arrow-up-line"></i>
</button>
<!--end back-to-top-->

<!--preloader-->
<div id="preloader">
    <div id="status">
        <div class="spinner-border text-primary avatar-sm" role="status">
            <span class="visually-hidden">Loading...</span>
        </div>
    </div>
</div>

<div class="customizer-setting d-none d-md-block">
    <div class="btn-info rounded-pill shadow-lg btn btn-icon btn-lg p-2" data-bs-toggle="offcanvas" data-bs-target="#theme-settings-offcanvas" aria-controls="theme-settings-offcanvas">
        <i class='mdi mdi-spin mdi-cog-outline fs-22'></i>
    </div>
</div>


<!-- JAVASCRIPT -->
<script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/libs/simplebar/simplebar.min.js"></script>
<script src="assets/libs/node-waves/waves.min.js"></script>
<script src="assets/libs/feather-icons/feather.min.js"></script>
<script src="assets/js/pages/plugins/lord-icon-2.1.0.js"></script>
<script src="assets/js/plugins.js"></script>

<!-- prismjs plugin -->
<script src="assets/libs/prismjs/prism.js"></script>

<!-- gridjs js -->
<script src="assets/libs/gridjs/gridjs.umd.js"></script>
<!-- gridjs init -->
<script src="assets/js/pages/gridjs.init.js"></script>

<!-- App js -->
<script src="assets/js/app.js"></script>
</body>


</html>
