<html>
    <head>
        <title>Invoice.</title>
    </head>
    <style>
      table,
      th,
      td {
        padding: 10px;
        border: 1px solid black;
        border-collapse: collapse;
      }
    </style>
    <body>
        <p>
            <span style='font-size: 9pt; font-family:Arial,sans-serif;'>
            <img src='http://www.thinking.fish/pay/img/tf-logo-small.png' alt='Thinking Fish'>
            </span>
        </p>
        <p><?php echo $data['customer_name'] ?> renewed following domain(s)
        </p>
         <table cellpadding='0' border='0' style="margin-top: 10px;">
            <tbody>
                <tr><td>domain name</td><td>renewed for year(s)</td><td>new expiry date</td><td>price</td></tr>
                <?php foreach ($data['renewal_request']->renew_data['domains'] as $key => $domain) { ?>
                    <tr>
                        <td>{{$key}}</td>
                        <td>{{$domain['period']}}</td>
                        <?php if( $domain['period'] != 'do_not_renew' ) { ?>
                        <?php $expiryDate = DateTime::createFromFormat('Y-m-d', $domain['expiry_date']); 
                            $expiryDate->modify('+'.$domain['period'].' year'); 
                        ?>
                        <td>{{  $expiryDate->format('d-m-Y') }}</td>
                        <?php } else { ?>
                        <td></td>
                        <?php } ?>
                        
                        <td>{{$domain['price']}}</td>
                    </tr>
                <?php } ?>
         </tbody>
        </table>
        <p><b>Total:</b> {{$data['renewal_request']->renew_data['total'] }}</p>
        @if( isset( $data['last_four'] ) )
            <p>paid by card ending {{ $data['last_four'] }}</p>
        @endif
        <p>Invoice: {{$data['new_invoice_number']}}</p>
        
    </body>
</html>