<?php  
include '../b_end_2/include/db.php';
include '../b_end_2/include/connect.php';
$tlid = $_GET['tl'];
$trs = $db->findByPK('tbtourlead','tl_id',$tlid)->executeRow();

$tl2id = $_GET['tl2'];
$trss = $db->findByPK('tbtourlead','tl_id',$tl2id)->executeRow();

$agen = $_GET['agen'];
$agen_logo = $db->findByPK('tbagency','agency_id',$agen)->executeRow();
/* Start Date */
$start_explode = explode("/", $start_date);
$start_month = $start_explode[0];
$start_day = $start_explode[1];
$start_year = $start_explode[2];

$hotel = $rtp['trip_hotel'];
$hoteltel = $rtp['trip_hotel_tel'];
/* Expire Date */
$expire_explode = explode("/", $expire_date);
$expire_month = $expire_explode[0];
$expire_day = $expire_explode[1];
$expire_year = $expire_explode[2];
switch($start_month){
    case 1: $mn = 'JAN'; break;
    case 2: $mn = 'FEB'; break;
    case 3: $mn = 'MAR'; break;
    case 4: $mn = 'APR'; break;
    case 5: $mn = 'MAY'; break;
    case 6: $mn = 'JUN'; break;
    case 7: $mn = 'JUL'; break;
    case 8: $mn = 'AUG'; break;
    case 9: $mn = 'SEP'; break;
    case 10: $mn = 'OCT'; break;
    case 11: $mn = 'NOV'; break;
    case 12: $mn = 'DEC'; break;
}
switch($expire_month){
    case 1: $mt = 'JAN'; break;
    case 2: $mt = 'FEB'; break;
    case 3: $mt = 'MAR'; break;
    case 4: $mt = 'APR'; break;
    case 5: $mt = 'MAY'; break;
    case 6: $mt = 'JUN'; break;
    case 7: $mt = 'JUL'; break;
    case 8: $mt = 'AUG'; break;
    case 9: $mt = 'SEP'; break;
    case 10: $mt = 'OCT'; break;
    case 11: $mt = 'NOV'; break;
    case 12: $mt = 'DEC'; break;
} //.$rtp['programe_name'].
$i=0;
// $rs = $db->findorderid('tbbook,tbpassenger,tblogin,tbagency,tbadmin,tbroom','tblogin.u_agency = tbagency.agency_id && tblogin.u_id = tbbook.book_sale && tbbook.book_id = tbpassenger.pass_book && tbbook.book_admin = tbadmin.admin_id && tbpassenger.pass_room = tbroom.room_id && book_pass = 1 && book_status != 0 && book_cancel = 0 && book_trip',$_GET['id'],'book_id asc, pass_room')->execute();
// $rs_2 = $db->findorderid('tbbook,tbpassenger,tblogin,tbagency,tbadmin,tbroom','tblogin.u_agency = tbagency.agency_id && tblogin.u_id = tbbook.book_sale && tbbook.book_id = tbpassenger.pass_book && tbbook.book_admin = tbadmin.admin_id && tbpassenger.pass_room = tbroom.room_id && book_pass = 1 && book_status != 0 && book_cancel = 0 && book_trip',$_GET['id'],'book_id asc, pass_room')->execute();
// $rs_3 = $db->findorderid('tbbook,tbpassenger,tblogin,tbagency,tbadmin,tbroom','tblogin.u_agency = tbagency.agency_id && tblogin.u_id = tbbook.book_sale && tbbook.book_id = tbpassenger.pass_book && tbbook.book_admin = tbadmin.admin_id && tbpassenger.pass_room = tbroom.room_id && book_pass = 1 && book_status != 0 && book_cancel = 0 && book_trip',$_GET['id'],'book_id asc, pass_room')->execute();
// $rs_4 = $db->findorderid('tbbook,tbpassenger,tblogin,tbagency,tbadmin,tbroom','tblogin.u_agency = tbagency.agency_id && tblogin.u_id = tbbook.book_sale && tbbook.book_id = tbpassenger.pass_book && tbbook.book_admin = tbadmin.admin_id && tbpassenger.pass_room = tbroom.room_id && book_pass = 1 && book_status != 0 && book_cancel = 0 && book_trip',$_GET['id'],'book_id asc, pass_room')->execute();
// $ss = $db->findByPk('tbbook','book_trip',$_GET['id'])->execute();


// $rs = $db->findorderid('tbbook,tbpassenger,tblogin,tbagency,tbadmin,tbroom','tblogin.u_agency = tbagency.agency_id && tblogin.u_id = tbbook.book_sale && tbbook.book_id = tbpassenger.pass_book && tbbook.book_admin = tbadmin.admin_id && tbpassenger.pass_room = tbroom.room_id && book_pass = 1 && book_status != 0 && book_cancel = 0 && book_trip',$_GET['id'],'book_id asc, pass_room')->execute();

$rs = $db->findorderid('tbtag_group','tag_group',$_GET['id'],'tag_id asc, tag_id')->execute();

?>
<!DOCTYPE html>
<html>
<head>
    <title></title>
        <!-- Bootstrap core CSS -->
    <link href="https://www.bestindochina.com/css/bootstrap.css?v=1.37" rel="stylesheet">
    <style>
    @import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600&display=swap');
        body {
        margin: 0;
        padding: 0;
        background-color: #FAFAFA;
      /*  font-family: 'Prompt' !important;*/
    }
    * {
        box-sizing: border-box;
        -moz-box-sizing: border-box;
    }
     .page {
        width: 120mm;
        min-height: 80mm;
        height:  80mm;
        padding: 0cm;
        margin: 0cm auto;
        border: 0px #D3D3D3 solid;
        border-radius: 0px;
     /*   background: black;*/
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      /*  page-break-after: always;*/
    /*background-image: url(https://www.bestindochina.com/img/jp_card-off-03.jpg);*/
                     background-position: center center;
                     background-repeat: no-repeat;
                     background-size: cover;
    }
    .subpage {
        padding: 1cm;
        border: 3px red solid;
        height: 256mm;
        outline: 2cm #eee solid;
    }
    
    @page {
   /*     size: A4;*/
        margin: 0;
    }
    @media print {
        .page {
            margin: 0;
            border: initial;
            border-radius: initial;
            width: initial;
            min-height: initial;
            box-shadow: initial;
            background: initial;
            page-break-after: always;
        }
    }

 /*@media print {

  body {
    margin: 0;
    color: #000;
    background-color: #fff;
  }

}*/

/*    p{
        font-size:0.6rem;
    }*/
    h2{
      font-size:1.3rem;
    }
    .bg-danger {
    background-color: #e9292a !important;
    border-color: #e9292a !important;
        background-image: linear-gradient(1deg,#e9292a 10%,#8e0e00);
    }
    .box_nb{
     background: #e9292a !important;
    border-radius: 10px;
    color: white;
    padding: 2px;
    }
    .text-danger{
     color: #e9292a !important;
    }
    .btn-dark{
      background: #4c4c4c;
    color: white;
    }
    body{
        color:blue;
        font-size:11pt;
        font-weight:400;
    }
</style>
</head>
<body>
<div class="book">
       <div class="controls">
  <?$i=0; while($db = mysql_fetch_array($rs)){?> 
                  <?
                    $namecode = $rtp['programe_code'];
                    $pob = $db['pass_birth_place'];
                    $pob_explode = explode(", ", $pob);
                    $pob1 = $pob_explode[0];
                    $pob2 = $pob_explode[1];
                    $datebrit = $db['tag_name_th'];
                    $mm2 = date("d/m/Y", strtotime($datebrit));
                    $month23 = date("Ymd", strtotime($datebrit));

                       $date = strtotime($db['tag_name_th']);
                       $new_date = date('Ymd', $date);


                    //      if ($rtp['programe_time'] == '7 วัน 4 คืน'){
                    //   $time = '4 Days';
                    // }else if($rtp['programe_time'] == '5 วัน 3 คืน'){
                    //   $time = '3 Days';
                    // }else if($rtp['programe_time'] == '6 วัน 4 คืน'){
                    //   $time = '4 Days';
                    // }else if($rtp['programe_time'] == '4 วัน 3 คืน'){
                    //   $time = '3 Days';
                    // }else{
                    //   $time = $rtp['programe_time'];
                    // }
                  ?>
    <div class="page" style="position:relative;"><?$i++?>
   <!--   <span style="position:absolute;right:20px;top:25px;font-weight:bolder;"><?=$i;?></span> -->
<!--     <div style="padding-top:20px;padding-left:400px;">
       <p style="position: sticky;">
         <sapn style="font-weight:bold;color:red;">X</sapn>
        </p>
       </div> -->
        <div style="padding-top:8px;padding-left:420px;">
       <p style="margin-bottom:0px;">
         <sapn style="font-weight:bold;color:blue;"><?=$i;?></sapn>
         <sapn style="position: absolute;top:10px;left:16px;font-weight:500;font-size:0.7rem;">BUS2</sapn>
        </p>
       </div>
      <div style="padding-top:26px;padding-left:20px;">
       <p style=" position: sticky;"><sapn style="width:150px;display:inline-block;"><?=$db['tag_lastname_th'];?></sapn><span style="padding-left:0px;"></span>&nbsp;&nbsp;
        <sapn style="width: 150px;display: inline-block;"><?=$db['tag_name_eg'];?></sapn>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<?if($db['tag_num'] == 'MR'){?>
    <sapn style="position: absolute;top: -16px;font-weight: bold;">X</sapn>
    <?}else{?>
    <sapn style="position: absolute;top: 1px;font-weight: bold;">X</sapn>
    <?}?> 
        </p>
      </div>
        <div style="padding-top: 5px;padding-left:20px;    line-height:0.8;">
         <sapn style="">THAI</sapn>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <sapn style="letter-spacing:13px;"><?=$month23;?></sapn>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <sapn style=""></sapn>
        </p>
       </div> 

        <div style="padding-top:5px;padding-left:315px;    line-height: 1.2;">
       <p style="position: sticky;">
       <sapn>(+82) 31 448 6671</sapn> 
        </p>
       </div>

        <div style="padding-top:2px;padding-left:50px;    line-height: 1.2;">
       <p style="position: sticky;">
        <sapn>SAMWON OLAZA HOTEL</sapn> 
        </p>
       </div>


        <div style="padding-top:43px;padding-left:20px;    line-height: 1.2;">
       <p style="position: sticky;">
        <sapn>X</sapn> 
        </p>
       </div>



            </div>
<?}?>



</div>

</body>
</html>







