<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Member Profile</title>
    <style>
        .invoice-box {
            max-width: 800px;
            margin: auto;
            padding: 30px;
            border: 1px solid #eee;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
            font-size: 12px;
            line-height: 24px;
            font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
            color: #555;
        }

        .invoice-box table {
            width: 100%;
            line-height: inherit;
            text-align: left;
        }

        .invoice-box table td {
            padding: 5px;
            vertical-align: top;
        }



        .invoice-box table tr.top table td {
            padding-bottom: 20px;
        }

        .invoice-box table tr.top table td.title {
            font-size: 45px;
            line-height: 45px;
            color: #333;
        }

        .invoice-box table tr.information table td {
            padding-bottom: 40px;
        }

        .invoice-box table tr.heading td {
            background: #eee;
            border-bottom: 1px solid #ddd;
            font-weight: bold;
        }

        .invoice-box table tr.details td {
            padding-bottom: 20px;
        }

        .invoice-box table tr.item td {
            border-bottom: 1px solid #eee;
        }

        .invoice-box table tr.item.last td {
            border-bottom: none;
        }

        .invoice-box table tr.total td:nth-child(2) {
            border-top: 2px solid #eee;
            font-weight: bold;
        }

        @media only screen and (max-width: 600px) {
            .invoice-box table tr.top table td {
                width: 100%;
                display: block;
                text-align: center;
            }

            .invoice-box table tr.information table td {
                width: 100%;
                display: block;
                text-align: center;
            }
        }

        /** RTL **/
        .invoice-box.rtl {
            direction: rtl;
            font-family: Tahoma, 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
        }

        .invoice-box.rtl table {
            text-align: right;
        }

        .invoice-box.rtl table tr td:nth-child(2) {
            text-align: left;
        }
    </style>
</head>
<body>
    <div class="invoice-box">
        <table cellpadding="0" cellspacing="0">
            <tr class="top">
                <td colspan="2">
                    <table>
                        <tr>
                            <td class="title">
                                <img src="{{asset('admin/assets/img/logos/logo-new.png')}}" style="width: 100%; max-width: 180px" />
                            </td>
                            <td>
                                <center>
                                    <h3>Funeral Cover Application Form</h3>
                                    <?php
                                    echo date('l\, F jS\, Y '); ?> <br>
                                    Document Number:
                                    <?php
                                    echo mt_rand(10000000, 99999999);
                                    ?>
                                </center>
                            </td>

                            <td>
                                <p>515 Siteshi Rd Industrial Site <br>
                                    P.O.Box 477 Mbabane <br>
                                    Tel: +268 2404 2888 / 2404 3011 <br>
                                    Email: info@mbbs.co.sz</p>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr class="heading">
                <td>
                    <h3> A. PLICY HOLDER DETAILS</h3>
                </td>
                <td>
                    <h3>Policy No: {{$member->national_id}}</h3>
                </td>
            </tr>
            <tr class="details">
                <td width="50%">
                    <table>
                        <tr>
                            <td>Name: <br>
                                Surname: <br>
                                Birth Date: <br>
                                Nationality: <br>
                                Residential Address: </td>
                            <td>{{$member->name}} <br>
                                {{$member->surname}} <br>
                                {{$member->date_of_birth}} <br>
                                {{$member->nationality}} <br>
                                {{$member->residential_address}}
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    <table>
                        <tr>
                            <td>Gender: <br>
                                Reg. Date: <br>
                                Cell No: <br>
                            </td>
                            <td>{{$member->gender}} <br>
                                {{$member->registration_date}} <br>
                                {{$member->code}} {{$member->cell_number}}
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr class="heading">
                <td>
                    <h3> B. DEPENDANTS DETAILS</h3>
                </td>
                <td>
                    <h3></h3>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table>
                        <tr class="heading">
                            <td>Surname</td>
                            <td>Name</td>
                            <td>National ID</td>
                            <td>gender</td>
                            <td>DOB</td>
                            <td>Relationship</td>
                        </tr> @foreach ($dependants as $dependant)
                        <tr>
                            <td>{{$dependant->surname}}</td>
                            <td>{{$dependant->name}}</td>
                            <td>{{$dependant->national_id}}</td>
                            <td>{{$dependant->gender}}</td>
                            <td>{{$dependant->dob}}</td>
                            <td>{{$dependant->relationship}}</td>
                        </tr>
                        @endforeach
                    </table>
            </tr>
            <tr class="heading">
                <td>
                    <h3> C. BENEFICIARIES DETAILS</h3>
                </td>
                <td>
                    <h3></h3>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table>
                        <tr class="heading">
                            <td>Surname</td>
                            <td>Name</td>
                            <td>National ID</td>
                            <td>Cell</td>
                            <td>DOB</td>
                            <td>Relationship</td>
                        </tr> @foreach ($beneficiaries as $beneficiary)
                        <tr>
                            <td>{{$beneficiary->surname}}</td>
                            <td>{{$beneficiary->name}}</td>
                            <td>{{$beneficiary->national_id}}</td>
                            <td>{{$beneficiary->cell}}</td>
                            <td>{{$beneficiary->dob}}</td>
                            <td>{{$beneficiary->relationship}}</td>
                        </tr>
                        @endforeach
                    </table>
            </tr>


            <tr class="heading">
                <td>
                    <h3> D. FUNERAL PREMIUM DETAILS</h3>
                </td>
                <td>
                    <h3></h3>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table>
                        <tr class="heading">
                            <td>Cover Name</td>
                            <td>Amount</td>
                            <td>Monthly Premium</td>
                            <td>Waiting Period</td>
                        </tr> 
                        @foreach ($premia as $premium)
                        <tr>
                            <td>{{$premium->cover->name}}</td>
                            <td>E {{$premium->cover->sum_assured}}</td>
                            <td>E {{$monthly_payment}}</td>
                            <td>{{$premium->cover->waiting_period}}</td>
                        </tr>
                        @endforeach
                    </table>
            </tr>
            <tr>
                <td colspan="2">
                <br><strong> Policy: {{$premium->cover->monthly_pay}}</strong><br>
                        <br> Total Dependents: {{$totaldependents}} 
                        <br> Total Children: {{$totalchildren}} 
                        <br> Total Spouses: {{$totalspouses}} <br>
                <strong>Additional Benefits</strong>
                        <br> Airtime: {{$benefits->airtime}} 
                        <br> Cow: {{$benefits->cow}} 
                        <br> Grocery: {{$benefits->grocery}} <br>
                </td>
            </tr>


            <tr class="heading">
                <td colspan="2">
                    <h3> E. DECLARATION BY AUTHORIZED REPRESENTATIVE (Office Use Only)</h3>
                </td>

            </tr>
            <tr>
                <td colspan="2">
                    <table>
                        <tr>
                            <td></td>

                            <td></td>

                        </tr>
                        <tr>
                            <td>Consultants: {{$user->name}} {{$user->surname}} </td>

                            <td colspan="2">Signature: ____________________________</td>

                        </tr>


                    </table>
            </tr>


            <tr class="heading">
                <td>
                    <h3> F. DECLARATION BY POLICY HOLDER</h3>
                </td>
                <td>
                    <h3></h3>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table>
                        <tr>
                            <td></td>
                            <td></td>

                        </tr>
                        <tr>
                            <td colspan="2">I, the undersigned confirm that the information supplied on this is to the best of my
                                knowledge true and correct. I further acknowledge that the broker/underwritter and the authorized representative
                                accept no responsability for the accuracy of the information provided by myself. </td>
                        </tr>
                        <tr>
                            <td width="50%">&nbsp;</td>
                            <td><br> Signature: ___________________________________</td>

                        </tr>


                    </table>
            </tr>






        </table>

    </div>
</body>

</html>