<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    @font-face {
      font-family: "AGENCY";
      src: url("./fonts/AGENCY.TTF");
    }
    .page{
      background-image: url(/img/check_in_car.png);
      background-size: 100% 100%;
      width: 203mm;
      height: 82mm;
      margin: 0 auto;
    }
    table{
      font-family: "AGENCY";
    }
    .tb1{
      position: relative;
    }
    .tb1 .pl{
      padding-left: 27%;
    }
    .tb1 .pb{
      padding-bottom: 3%;
    }
    .tb2 .pb{
      padding-bottom: 9%;
    }
    .tb2{
      padding: 0 6px 0 4px;
      position: relative;
    }
    .tb2 td {
      text-align: center;
    }
    .bc1{
      position: absolute;
      height: 45px;
      bottom: 50px;
      right: 30px;
      width: 160px;
    }
    .bc2{
      position: absolute;
      height: 35px;
      bottom: 0px;
      left: 2px;
      width: 100px;
    }
  </style>
</head>
<body>
  <div class="page">
    <table class="tb1" style="width: 72%; float: left" >
      <tr>
        <td style="padding-top: 52px ;" class="pl pb" colspan="2">{{ $boardingPass->ticket->called.' '.$boardingPass->ticket->fullName}}</td>
      </tr>
      <tr>
        <td class="pl pb" colspan="2">{{ $boardingPass->ticket->segment->cruise->originPort->country}}/{{ $boardingPass->ticket->segment->cruise->originPort->name }}</td>
      </tr>
      <tr>
        <td class="pl pb" colspan="2">{{ $boardingPass->ticket->segment->cruise->destinationPort->country}}/{{ $boardingPass->ticket->segment->cruise->destinationPort->name }}</td>
      </tr>
      <tr>
        <td class="pl pb" colspan="2">{{  date('j M Y h:i a', strtotime($boardingPass->ticket->segment->cruise->departure_date_time)) }}</td>
      </tr>
      <tr>
        <td style="padding-left: 15%;width: 42%">{{$ticket->car->type }}</td>
        <td style="font-size: 12px">{{ $ticket->details['car_number'] }}
          <canvas class="bc1 barcode"></canvas>
        </td>
      </tr>
      <tr>
          <td colspan="2" style="padding-top: 2%; padding-left: 11%">
            <table style="width: 100%; font-size: 12px">
                <tr>
                    <td style="width: 21%">{{ $ticket->details['color'] }}</td>
                    <td style="width: 20%">{{ $ticket->car->model}}</td>
                    <td>{{$boardingPass->ticket->segment->cruise->ship->name}}</td>
                </tr>
            </table>
          </td>
      </tr>
      <tr>
        <td colspan="3" style="padding-left: 15%;padding-top: 25px">
          {{$boardingPass->code}}
        </td>
      </tr>
    </table>
    <table class="tb2" style="width: 25%;" >
      <tr>
        <td  colspan="3" style="padding-left: 17%; padding-top: 7px ; padding-bottom: 24px;">{{$boardingPass->ticket->segment->cruise->name.$boardingPass->ticket->segment->cruise->cruise_number}}</td>
      </tr>
      <tr>
        <td class="pl pb" colspan="3">{{ $boardingPass->ticket->called.' '.$boardingPass->ticket->fullName}}</td>
      </tr>
      <tr>
        <td class="pl pb" colspan="3">{{ $boardingPass->ticket->segment->cruise->originPort->country}}/{{ $boardingPass->ticket->segment->cruise->originPort->name }}</td>
      </tr>
      <tr>
        <td class="pl pb" colspan="3">{{ $boardingPass->ticket->segment->cruise->destinationPort->country}}/{{ $boardingPass->ticket->segment->cruise->destinationPort->name }}</td>
      </tr>
      <tr>
            <td  colspan="3" style="padding-left: 10%;">
                <table style="width: 100%;">
                    <tr>
                        <td style="text-align: left;width: 50px;font-size: 12px" >{{ $ticket->car->type }}</td>
                        <td style="text-align: center;font-size: 12px">{{$ticket->details['color'] }}</td>
                        <td style="text-align: right;font-size: 12px">{{ $ticket->car->model}}</td>
                    </tr>
                </table>
            </td>
      </tr>
      <tr>
        <td  colspan="3" style="padding-left: 10%; padding-top: 7%">
            <table style="width: 100%;">
                <tr>
                    <td style="width: 38%;font-size: 10px" >{{ $ticket->details['car_number'] }}</td>
                    <td style="font-size: 10px">{{  date('h:i a', strtotime($boardingPass->ticket->segment->cruise->departure_time)) }} </td>
                    <td style="font-size:8px">{{ $boardingPass->ticket->segment->cruise->ship->name}}</td>
                </tr>
            </table>
        </td>
      </tr>
      <tr>
        <td colspan="3" style="text-align: right;padding-top: 20px;padding-right: 15px"> {{  date('h:i a', strtotime($boardingPass->ticket->segment->cruise->departure_time)) }} </td>
      </tr>
      <tr>
        <td colspan="3" style="padding-top: 10%;text-align: right;padding-bottom: 5px;font-size: 12px">
          {{$boardingPass->code}}
          <canvas class="bc2 barcode"></canvas>
        </td>
      </tr>
      <tr>
        
      </tr>
    </table>
  </div>
</body>

<script src="/js/JsBarcode.all.min.js"></script>
<script>
 JsBarcode(".barcode",'{{$boardingPass->code}}',{
  background: 'transparent'
 } );
 </script>
</html>