@extends('emails.layout')
@section('salutation')
<span style="color:#24315E">ORDER INVOICE</span>
@endsection

@section('content')
<?php
$appInternalName = config('app.internalName');
$appConfig = config('constants.' . $appInternalName);
$selectedItems = $storeOrder->testsRequested();
?>
<table border="0" cellspacing="0" cellpadding="0" width="600" style="border-collapse:collapse;border-spacing:0;margin-bottom:30px;margin-top:0px;margin-inline:auto;">
    <tbody>
        <tr>
            <td>
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0;width:100%;color:rgb(51,51,51);font-size:12px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">
                    <tbody>
                        <tr height="24" style="background-color:rgb(250,250,250)">
                            <td colspan="5" valign="top" style="text-align:center;text-transform:uppercase;padding:10px;border-top-left-radius:3px;border-bottom-left-radius:3px">
                                <span style="font-size:15px;font-weight:600;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">Order Information</span>
                            </td>
                        </tr>
                        <tr height="15">
                            <td colspan="5"></td>
                        </tr>
                        <tr>
                            <td colspan="3" style="width:200px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">Date:
                                <?= date('F d, Y', strtotime($storeOrder->created_at)) ?>
                            </td>
                            <td colspan="2" align="right" valign="top" style="width:430px;padding:0 6px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">Order: #<a style="color:#000" href="" target="_blank">{{$storeOrder->orderNumber()}}</a></td>
                        </tr>
                        <tr height="15">
                            <td colspan="5"></td>
                        </tr>
                        <tr height="24" style="background-color:rgb(250,250,250)">
                            <td colspan="5" valign="top" style="text-align:center;text-transform:uppercase;padding:6px;border-top-left-radius:3px;border-bottom-left-radius:3px"><span style="font-size:15px;font-weight:600">Items For Delivery</span></td>
                        </tr>
                        <tr height="15">
                            <td colspan="5"></td>
                        </tr>
                        @foreach($selectedItems as $item)
                        <tr>
                            <td colspan="3" style="padding:0 0 10px 0px;vertical-align:top;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">
                                <span style="font-weight:300;"><a href="{{$appUrl .'/my-account'}}" style="color:#000;text-decoration:none;">{{config('constants.tests.'.$item)}}</a></span><br>
                            </td>
                            <td align="right" valign="top" style="padding:0 5px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">
                              <span style="font-weight:500;white-space:nowrap;display:block;">${{config('app.'.$item)}}</span>
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0;width:595px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">
                    <tbody>
                        <tr height="10">
                            <td colspan="3"></td>
                        </tr>
                        <tr height="10">
                            <td height="1" colspan="3">
                                <div style="line-height:1px;height:1px;background-color:rgb(238,238,238)"></div>
                            </td>
                        </tr>
                        <tr height="28">
                            <td align="right" style="color:#000;font-size:14px;font-weight:600;padding:0 30px 0 0;border-width:1px;border-color:rgb(238,238,238)">TOTAL</td>
                            <td width="1" style="background-color:rgb(238,238,238);width:1px"></td>
                            <td width="90" align="right" style="width:120px;font-size:16px;font-weight:600;white-space:nowrap">
                                ${{$storeOrder->total()}}
                            </td>
                        </tr>
                        <tr height="10">
                            <td height="1" colspan="3">
                                <div style="line-height:1px;height:1px;background-color:rgb(238,238,238)"></div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        <tr height="15">
            <td colspan="3"></td>
        </tr>
        <tr>
            <td>
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0;color:rgb(51,51,51);background-color:rgb(250,250,250);border-radius:3px;font-size:12px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">
                    <tbody>
                        <tr height="66">
                            <td width="620" rowspan="3" style="vertical-align:initial;padding:20px;font-size:14px;border-style:solid;border-color:white;border-left-width:0px;border-right-width:0px;border-top-width:0px;border-bottom-width:0px">
                                <span style="color:#000;font-size:14px;padding:5px 0;text-transform:uppercase;font-weight:600;">Lab Information</span><br> <br>
                                <span style="display:block;padding-bottom:8px">{{$storeOrder->lab()->name}}</span>
                                <span style="font-weight:300;" >{!! $storeOrder->lab()->address() !!}</span>
                            </td>
                            <td width="595" rowspan="3" style="vertical-align:initial;padding:20px;font-size:14px;border-style:solid;border-color:white;border-left-width:0px;border-right-width:0px;border-top-width:0px;border-bottom-width:0px">
                                <span style="color:#000;font-size:14px;padding:5px 0;text-transform:uppercase;font-weight:600;">Billing Information</span><br> <br>
                                <span style="font-weight:bold;">Bill To:</span> <br>
                                {{$storeOrder->client->displayName()}}<br>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </tbody>
</table>
@endsection
