<?php
    $rs = $db->findAll('tbbooking')->execute();
        function DateThai($strDate){
      $strYear = date("Y",strtotime($strDate))+543;
      $strMonth= date("n",strtotime($strDate));
      $strDay= date("j",strtotime($strDate));
      $strHour= date("H",strtotime($strDate));
      $strMinute= date("i",strtotime($strDate));
      $strSeconds= date("s",strtotime($strDate));
      $strMonthCut = Array("","ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.");
      $strMonthThai=$strMonthCut[$strMonth];
      return "$strDay $strMonthThai $strYear";
    }

          function DateGoBack($DateGo,$DateBack){
      $strYear = date("Y",strtotime($DateBack))+543;
      $strMonth= date("n",strtotime($DateBack));
      $strDay = date("j",strtotime($DateBack));
      $strDay2 = date("j",strtotime($DateGo));
      $strMonth2= date("n",strtotime($DateGo));
      $strYear2 = date("Y",strtotime($DateGo))+543;
      // $strMonthCut = Array("","มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม");
      $strMonthCut = Array("","ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.");
      $strMonthCut2 = Array("","ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.");
      $strMonthThai=$strMonthCut[$strMonth];
      $strMonthThai2=$strMonthCut2[$strMonth2];

      return "$strDay2-$strDay $strMonthThai $strYear";
    }

function DateDiff($strDate1,$strDate2)
   {
  return (strtotime($strDate2) - strtotime($strDate1))/  ( 60 * 60 * 24 );  // 1 day = 60*60*24
   }

$todayisreal = date("m/d/Y");
   // $todays = date("m/d/Y");
   $todays = date("Y-m-d");

  $todays2 = date("Y-m-d");

  $todays10 = date("Y-m-d", strtotime("+10 day"));
  

  $todays1 = date("m/d/Y");

   $book_today = $db->findByAttributes('tbbooking',array('book_date =' => $todays1))->execute();


   if ($_SESSION['admin_status'] == 0 || $_SESSION['admin_status'] == 2 || $_SESSION['admin_id'] == 51) {
    $book_t = $db->findByAttributes('tbiv',array('iv_date =' => $todays))->execute();
    $rs = $db->findAll('tbiv')->execute();
    $rstime = $db->findorderid('tbiv', 'iv_status_2','0','str_to_date(pro_datego,"%m/%d/%Y") asc, iv_id')->execute();
    $book_dep = $db->findByAttributes('tbiv',array('mus_date =' => $todays))->execute(); 
    $rstime2 = $db->findorderid('tbiv', 'iv_status_2','0','str_to_date(pro_datego,"%m/%d/%Y") asc, iv_id')->execute();
    // $rstime = $db->findAll('tbiv')->execute();
    // $rstime = $db->findorder('tbiv','iv_status_2 = 0','str_to_date(pro_datego,"%Y-%m-%d") asc,pro_datego')->execute();  
    // $rstime = $db->findorderid('tbiv','iv_status_2','0','str_to_date(pro_datego,"%Y-%m-%d") asc, pro_datego')->execute();
    $diss = 'disabled';
 
   }else{
    // $book_t = $db->findByAttributes('tbiv',array('iv_date =' => $todays))->execute();
    if($_SESSION['admin_id'] == 49){
    $admintest = 'เฟิร์น';
    $book_t = $db->findByAttributes('tbiv',array('iv_date =' => $todays, 'iv_admin =' => 'เฟิร์น'))->execute();
    $book_t2 = $db->findByAttributes('tbiv',array('iv_date =' => $todays, 'iv_admin =' => $admin_id))->execute();
    $book_ad = $db->findByAttributes('tbiv',array('admin_nickname =' => $admin_id))->execute();
    $rs = $db->findByAttributes('tbiv',array('iv_admin =' => 'เฟิร์น'))->execute();
    $rs2 = $db->findByAttributes('tbiv',array('iv_admin =' => $admin_id))->execute();
    $rstime = $db->findByAttributes('tbiv',array('iv_admin =' => 'เฟิร์น'))->execute();
    $rstime2 = $db->findByAttributes('tbiv',array('iv_admin =' => 'เฟิร์น'))->execute();
    $book_dep = $db->findByAttributes('tbiv',array('mus_date =' => $todays, 'iv_admin =' => 'เฟิร์น'))->execute();
    $book_dateline = $db->findByAttributes('tbiv',array('date_line =' => $todays, 'iv_admin =' => 'เฟิร์น'))->execute();
    // $rstime = $db->findorderdesc('tbiv','iv_admin','เฟิร์น','pro_datego asc, pro_datego')->execute();

    }else if($_SESSION['admin_id'] == 51){
    // $book_t = $db->findByAttributes('tbiv',array('iv_date =' => $todays, 'iv_admin =' => 'หนุงหนิง'))->execute();
    // $book_t2 = $db->findByAttributes('tbiv',array('iv_date =' => $todays, 'iv_admin =' => $admin_id))->execute();
    // $book_ad = $db->findByAttributes('tbiv',array('admin_nickname =' => $admin_id))->execute();
    // $rs = $db->findByAttributes('tbiv',array('iv_admin =' => 'หนุงหนิง'))->execute();
    // $rs2 = $db->findByAttributes('tbiv',array('iv_admin =' => $admin_id))->execute();
    // $rstime = $db->findByAttributes('tbiv',array('iv_admin =' => 'หนุงหนิง'))->execute();
    // $book_dep = $db->findByAttributes('tbiv',array('mus_date =' => $todays, 'iv_admin =' =>'หนุงหนิง'))->execute();
    // $book_dateline = $db->findByAttributes('tbiv',array('date_line =' => $todays, 'iv_admin =' => 'หนุงหนิง'))->execute();
          $book_ad = $db->findAll('tbiv')->execute();
    $rs = $db->findByAttributes('tbiv',array('admin_id =' => $admin_id))->execute();
     $book_dateline = $db->findByAttributes('tbiv',array('date_line =' => $todays))->execute();

    }else if($_SESSION['admin_id'] == 52){
    $book_t = $db->findByAttributes('tbiv',array('iv_date =' => $today, 'iv_admin =' => 'Patra'))->execute();
    $book_t2 = $db->findByAttributes('tbiv',array('iv_date =' => $today, 'iv_admin =' => $admin_id))->execute();
    $book_ad = $db->findByAttributes('tbiv',array('admin_nickname =' => $admin_id))->execute();
    $rs = $db->findByAttributes('tbiv',array('iv_admin =' => 'Patra'))->execute();
    $rs2 = $db->findByAttributes('tbiv',array('iv_admin =' => $admin_id))->execute();
    $rstime = $db->findByAttributes('tbiv',array('iv_admin =' => 'Patra'))->execute();
        $book_dep = $db->findByAttributes('tbiv',array('mus_date =' => $todays, 'iv_admin =' =>'Patra'))->execute();
        $book_dateline = $db->findByAttributes('tbiv',array('date_line =' => $todays, 'iv_admin =' => 'Patra'))->execute();
    }else if($_SESSION['admin_id'] == 53){
    $book_t = $db->findByAttributes('tbiv',array('iv_date =' => $today, 'iv_admin =' => 'เล็ก'))->execute();
    $book_t2 = $db->findByAttributes('tbiv',array('iv_date =' => $today, 'iv_admin =' => $admin_id))->execute();
    $book_ad = $db->findByAttributes('tbiv',array('admin_nickname =' => $admin_id))->execute();
    $rs = $db->findByAttributes('tbiv',array('iv_admin =' => 'เล็ก'))->execute();
    $rs2 = $db->findByAttributes('tbiv',array('iv_admin =' => $admin_id))->execute();
    $rstime = $db->findByAttributes('tbiv',array('iv_admin =' => 'เล็ก'))->execute();
        $book_dep = $db->findByAttributes('tbiv',array('mus_date =' => $todays, 'iv_admin =' =>'เล็ก'))->execute();
        $book_dateline = $db->findByAttributes('tbiv',array('mus_date =' => $todays, 'iv_admin =' => 'เล็ก'))->execute();
        $rstime2 = $db->findByAttributes('tbiv',array('iv_admin =' => 'เล็ก'))->execute();
    }else{
    // $book_ad = $db->findByAttributes('tbiv',array('admin_id =' => $admin_id))->execute();
    $book_ad = $db->findAll('tbiv')->execute();
    $rs = $db->findByAttributes('tbiv',array('admin_id =' => $admin_id))->execute();
     $book_dateline = $db->findByAttributes('tbiv',array('date_line =' => $todays))->execute();
   }

   }





?>

<div class="row d-none">
  <div class="col-md-4 col-lg-3">
  <section class="panel panel-danger" style="">
  <div class="panel-body">
  <form  class="form-horizontal form-bordered" style="margin:0;" method="post" action="?url=maindatabase">
            <div class="form-group row m-auto" style="margin:auto;">
                        <label class="col-md-12 control-label" for="inputDefault"><h5 style="margin:0;font-size: 18px;line-height: 3;text-align:center;">ค้นหาใบจองของคุณที่เดินทาง</h5></label>
                        <div class="col-md-12">
                          <label>วันเริ่มต้น</label>
                         <input class="form-control" type="date" id="m1" name="m1" value="" style="margin-bottom:5px;">
                        </div>
                        <div class="col-md-12">
                          <label>วันสินสุด</label>
                         <input class="form-control" type="date" id="m2" name="m2" value="" style="margin-bottom:5px;">
                        </div>
                      <div class="col-md-12">
                <div class="form-actions">
                  <button type="submit" id="PackageBT" class="btn btn-danger btn-block" style="line-height: 3;margin-top: 20px;margin-bottom: 20px;">ค้นหาใบจองง <i class="fa-solid fa-magnifying-glass"></i></button>
                </div>
                </div>
            </div>
   </form>
          </div>
</section>
  </div>
    <div class="col-md-5"></div>
  <div class="col-md-3">
<a href="?url=iv_form" data-link="?url=iv_form" class="btn btn-success with-shadow-success btn-block">ออก INVOICE ใหม่</a><br>
  </div>
</div>


  <section class="panel">
<!-- <h5 class="text-semibold text-dark text-uppercase mb-md mt-lg">BOOKING</h5> -->
<div class="row m-auto" style="display: ;">

<div class="col-xl-3 col-md-4"> 
<div class="panel panel-default">
  <div class="panel-body">
    <a href="?url=iv_travel" data-link="?url=iv_travel" class="btn btn-dark with-shadow-dark btn-block">
    <i class="fa-solid fa-plane fa-3x"></i> <br><br>
    ใบจองของคุณที่ยังไม่ออกเดินทาง
  </a>
  </div>
</div>
</div>


<div class="col-xl-3 col-md-4"> 
<div class="panel panel-default">
  <div class="panel-body">
    <a href="?url=iv_nopay" data-link="?url=iv_nopay" class="btn btn-dark with-shadow-dark btn-block">
    <i class="fa-solid fa-rectangle-xmark fa-3x"></i> <br><br>
    ใบจองที่ยังไม่ชำระ
  </a>
  </div>
</div>
</div>

<div class="col-xl-3 col-md-4"> 
<div class="panel panel-default">
  <div class="panel-body">
    <a href="?url=iv_form" data-link="?url=iv_form" class="btn btn-success with-shadow-success btn-block">
    <i class="fa-solid fa-file-invoice fa-3x"></i> <br><br>
    ออกอินวอย
  </a>
  </div>
</div>
</div>
  </div>

<div class="row">
<!-- <?=$allbook;?> -->
<div class="col-md-8">

  <section class="panel panel-danger">
<header class="panel-heading panel-default" style="background: #4a4a4a;">
<div class="panel-actions">
<a href="#" class="fa fa-caret-down"></a>
</div>
<h2 class="panel-title">สถานะใบจองก่อนเดินทางก่อน 10 วัน (<?=$_SESSION['admin_nickname'];?>) <?=DateGoBack($todays,$todays10);?></h2>
</header>
<div class="panel-body text-dark">
  <div style="overflow-x: auto;">



                    <table class="table table-bordered table-striped mb-none datatable maindata" id="example" style="width:100:">
                      <thead>
                          <tr style="text-align:center;">
                            <th style="width:380px;">ชื่อรายการทัวร์</th>
                            <th style="text-align:center;width:270px;">วันที่เดินทาง</th>
                            <th style="text-align:center;width:220px;">ใบนัดหมาย</th>
                            <th style="text-align:center;width:80px;">จำนวน</th>
                            <th style="text-align:center;">STATUS</th>
                            <th style="text-align:center;">#</th>
                          </tr>
                      </thead>
                          <tbody>
                       <?php
              while($dbarr= mysql_fetch_array($rstime2)){ 
             $datediff = DateDiff($todayisreal,$dbarr['pro_datego']);
            $g_date = $dbarr['pro_datego'];
            $g_explode = explode("-", $g_date);
            $g_year = $g_explode[0];
            $g_month = $g_explode[1];
            $g_day = $g_explode[2];
            $book_all = $dbarr['adult_num']+$dbarr['c_num']+$dbarr['nb_num'];
             ?>
             <?if($dbarr['iv_status_2'] == '0'){?>
             <?if($g_date >= $todays && $g_date <= $todays10){
              $payin = $db->findByPK('tbpayment','payment_iv',$dbarr['iv_id'])->executeRow();?>
                          <tr>
                            <td style="line-height:1.6;vertical-align:middle;">
                            <span style="font-size:1.2rem;">รหัสทัวร์ : <?=$dbarr[iv_codepro];?></span><br>
                            <span style="font-size:1.2rem;"><?=$dbarr[iv_namepro];?></span><br>
                             <span style="font-size:1.2rem;">ชื่อลูกค้า : คุณ <?=$dbarr[cus_name];?></span><br>
                              <span>INVOICE : </span><a href="https://www.imaginetourservice.com/ivnew.php?id=<?=$dbarr[iv_id];?>" target="_blank">IM<?=$dbarr['iv_id'];?></a><br>
                              <span style="font-size:1rem;font-weight:400;" class="label label-dark">BOOKTIME : <?=DateThai($dbarr[iv_date]);?></span>
                            </td>
                            <td style="text-align:center;line-height:1.4;"><?=DateGoBack($dbarr['pro_datego'],$dbarr['pro_dateback']);?> <br>
                              <span style="color:red;font-size:1rem;"><?=$datediff;?>วันออกเดินทาง</span>
                          </td>
                          <td style="text-align:center;">
   <?if(!empty($dbarr['iv_status_work4'])){?>
  <span  class="text-success d-block" style="line-height: 1;
    background: #03c94b;
    color: #ffff !important;font-size:1.1rem;
    border-radius: 6px;
    padding-left: 4px;
    padding-right: 4px;"><?=$dbarr['iv_status_work4'];?></span> 
  <?}else{?>
  <span  class="text-danger d-block" style="line-height: 1;
    background: #575757;
    color: #ffff !important;font-size:1.1rem;
    border-radius: 6px;
    padding-left: 4px;
    padding-right: 4px;">ยังไม่มีการดำเนินการ</span> 
  <?}?>
   <?if(!empty($dbarr['iv_status_work4'])){?>
  <a class="btn btn-danger btn-block app_status" style="font-size:0.8rem;margin-top:5px;"  id="<?=$dbarr[iv_id];?>" status="" <?=$diss;?>>เปลี่ยนสถานะ</a>
    <?}else{?>
      <a class="btn btn-danger btn-block app_status"  style="font-size:0.8rem;margin-top:5px;" id="<?=$dbarr[iv_id];?>" status="ส่งให้ลูกค้าแล้ว" <?=$diss;?>>เปลี่ยนสถานะ</a>
    <?}?>
                          </td>
                            <td style="text-align:center;font-weight:bold;font-size:1.5rem;"><?=$book_all;?></td>
                            <?if ($payin['payment_iv'] == $dbarr['iv_id']) {
                            echo "<td style='line-height:2;text-align:center;'  class='text-danger'>
                             <a class='btn btn-primary' href='?url=maindatabase_update&id=$dbarr[iv_id]'  style='font-size:0.8rem;display:block;' target='_blank'>มีการขำระเงิน</a>
                             ";
  $gp222 = $db->findByPK('tbpayment','payment_iv',$dbarr['iv_id'])->execute();
while($gpm2 = mysql_fetch_array($gp222)){
          $re_custom = $db->findByPK('tbreceipt','receipt_pay',$gpm2['payment_id'])->executeRow();
          if($gpm2['payment_type'] == 'DEP'){
            $paytype = '<span class="text-primary" style="font-weight: 500;font-size:0.8rem;">งวดมัดจำ </span>';
          }else if($gpm2['payment_type'] == 'PAY'){
            $paytype = '<span class="text-success" style="font-weight: 500;font-size:0.8rem;">งวดยอดทั้งหมด </span>';
          }else{
            $paytype = '<span class="text-warning" style="font-weight: 500;font-size:0.8rem;">งวดส่วนที่เหลือ </span>';
          }
          echo $paytype;
              }
              echo "</td>";
                            }else{
                            echo "<td style='line-height:21pt;text-align:center;'  class='text-danger'>
                             <a class='btn btn-dark' href='?url=maindatabase_update&id=$dbarr[iv_id]' style='font-size:0.8rem;display:block;' target='_blank'>ยังไม่มีการชำระ</a>
                             </td>";
                            } ?>
                            <td style="text-align:center;"> <a class='btn btn-danger' href='?url=maindatabase_update&id=<?=$dbarr[iv_id];?>' target="_blank"><i class="fa fa-edit"></i></a></td>

                          </tr>

                         <? }}}?>

                         </tbody>
      </table>


    </div>
</div>
</section>


</div>




<div class="col-md-4">
<section class="panel panel-success">
<header class="panel-heading">
<div class="panel-actions">
<a href="#" class="fa fa-caret-down"></a>
</div>
<h2 class="panel-title">ใบจองที่ออกใหม่วันนี้</h2>
</header>
<div class="panel-body text-dark">
    <div class="task medium">
        <div class="desc">
            <?
                    while($qrc= mysql_fetch_assoc($book_t)){
                      $payin_bd = $db->findByPK('tbpayment','payment_iv',$qrc['iv_id'])->executeRow();
                         if ($qrc['iv_status_2'] == '0') {
                            }else{
                             $iv_can = 'background: #00000045;';
                            $iv_status = "<span class='label label-dark' style='font-weight:400;'>ยกเลิกแล้ว</span>";
                            }
                        if ($payin_bd['payment_iv'] == $qrc['iv_id']) {
                          $pay_status = "<span class='btn btn-primary btn btn-success float-right' style='font-weight:400;font-size:0.8rem;'>มีการขำระเงิน</span>";
                        }else{
                          $pay_status = "<span class='btn btn-primary btn btn-dark float-right' style='font-weight:400;font-size:0.8rem;'>ยังไม่มีการชำระ</span>";
                        }
                        $adminsale = $qrc['iv_admin'];
                        echo '<div class="row" style="'.$iv_can.'">';
                        echo '<div class="col-md-12 col-xs-12 text-dark">';
                        echo '<a href="https://www.imaginetourservice.com/ivnew.php?id='.$qrc['iv_id'].'" class="btn btn-danger float-right" style="padding: 2px 17px;float:right;" target="_blank"><i class="fa fa-file-pdf-o"></i> INVOICE</a>';
                        echo '<a href="https://www.imaginetourservice.com/back_end/index?url=maindatabase_update&id='.$qrc['iv_id'].'" class="btn btn-primary float-right" style="margin-right:2px;padding: 2px 17px;float:right;" target="_blank"><i class="fa fa-file-pdf-o"></i> PAYMENT</a>'.$pay_status.'';
                        echo '<h4 class="title text-success mb-0">'.$iv_status.' IM'.$qrc['iv_id'].' <span style="font-size:8pt;" class="font-header text-black">('.$adminsale.') : '.number_format($qrc['adult_num']).' PAX</sapn></h4>';
                        echo '<div style="font-size:0.9rem;">'.$qrc['iv_namepro'].'</div>';
                        echo '</div>';
                        echo '</div>';
                        echo '<hr>';
                    }
                    ?>
</div>
</section>        
</div>


<div class="col-md-4">
<section class="panel panel-primary">
<header class="panel-heading">
<div class="panel-actions">
<a href="#" class="fa fa-caret-down"></a>
</div>
<h2 class="panel-title">ใบจองที่กำหนดชำระมัดจำวันนี้</h2>
</header>
<div class="panel-body text-dark">
    <div class="task medium">
        <div class="desc">
            <?
                    while($qrc= mysql_fetch_assoc($book_dep)){
                       $payin_dep = $db->findByPK('tbpayment','payment_iv',$qrc['iv_id'])->executeRow();
                      if ($qrc['iv_status_2'] == '0') {
                          $iv_can = '';
                            $iv_status = "";
                            }else{
                             $iv_can = 'background: #00000045;';
                            $iv_status = "<span class='label label-dark' style='font-weight:400;'>ยกเลิกแล้ว</span>";
                            }
                        if ($payin_dep['payment_iv'] == $qrc['iv_id']) {
                          $pay_status = "<span class='btn btn-primary btn btn-success float-right' style='font-weight:400;font-size:0.8rem;'>มีการขำระเงิน</span>";
                        }else{
                          $pay_status = "<span class='btn btn-primary btn btn-dark float-right' style='font-weight:400;font-size:0.8rem;'>ยังไม่มีการชำระ</span>";
                        }
                        $adminsale = $qrc['iv_admin'];
                        echo '<div class="row" style="'.$iv_can.'">';
                        echo '<div class="col-md-12 col-xs-12 text-dark">';
                        echo '<a href="https://www.imaginetourservice.com/ivnew.php?id='.$qrc['iv_id'].'" class="btn btn-danger float-right" style="padding: 2px 17px;float:right;" target="_blank"><i class="fa fa-file-pdf-o"></i> INVOICE</a>';
                        echo '<a href="https://www.imaginetourservice.com/back_end/index?url=maindatabase_update&id='.$qrc['iv_id'].'" class="btn btn-primary float-right" style="margin-right:2px;padding: 2px 17px;float:right;" target="_blank"><i class="fa fa-file-pdf-o"></i> PAYMENT</a>'.$pay_status.'';
                        echo '<h4 class="title text-primary mb-0">'.$iv_status.' IM'.$qrc['iv_id'].' <span style="font-size:8pt;" class="font-header text-black">('.$adminsale.') : '.number_format($qrc['adult_num']).' PAX</sapn></h4>';
                        echo '<div style="font-size:0.9rem;">'.$qrc['iv_namepro'].'</div>';
                        echo '</div>';
                        echo '</div>';
                        echo '<hr>';
                    }
                    ?>
</div>
</section>        
</div>


<div class="col-md-4">
<section class="panel panel-warning">
<header class="panel-heading">
<div class="panel-actions">
<a href="#" class="fa fa-caret-down"></a>
</div>
<h2 class="panel-title">ใบจองที่กำหนดชำระทั้งหมดวันนี้</h2>
</header>
<div class="panel-body text-dark">
    <div class="task medium">
        <div class="desc">
            <?
                    while($qrccc= mysql_fetch_assoc($book_dateline)){
                      $payin_full = $db->findByPK('tbpayment','payment_iv',$qrccc['iv_id'])->executeRow();
                        if ($qrccc['iv_status_2'] == '0') {
                             $iv_can2 = '';
                            $iv_status2 = "";
                            }else{
                             $iv_can2 = 'background: #00000045;';
                            $iv_status2 = "<span class='label label-dark' style='font-weight:400;'>ยกเลิกแล้ว</span>";
                            }
                        if ($payin_full['payment_iv'] == $qrccc['iv_id']) {
                          $pay_status = "<span class='btn btn-primary btn btn-success float-right' style='font-weight:400;font-size:0.8rem;'>มีการขำระเงิน</span>";
                        }else{
                          $pay_status = "<span class='btn btn-primary btn btn-dark float-right' style='font-weight:400;font-size:0.8rem;'>ยังไม่มีการชำระ</span>";
                        }
                        $adminsale = $qrccc['iv_admin'];
                        echo '<div class="row" style="'.$iv_can2.'">';
                        echo '<div class="col-md-12 col-xs-12 text-dark">';
                        echo '<a href="https://www.imaginetourservice.com/ivnew.php?id='.$qrccc['iv_id'].'" class="btn btn-danger float-right" style="padding: 2px 17px;float:right;" target="_blank"><i class="fa fa-file-pdf-o"></i> INVOICE</a>';
                        echo '<a href="https://www.imaginetourservice.com/back_end/index?url=maindatabase_update&id='.$qrccc['iv_id'].'" class="btn btn-primary float-right" style="margin-right:2px;padding: 2px 17px;float:right;" target="_blank"><i class="fa fa-file-pdf-o"></i> PAYMENT</a>'.$pay_status.'';
                        echo '<h4 class="title text-warning mb-0">'.$iv_status2.' IM'.$qrccc['iv_id'].' <span style="font-size:8pt;" class="font-header text-black">('.$adminsale.') : '.number_format($qrccc['adult_num']).' PAX</sapn></h4>';
                        echo '<div style="font-size:0.9rem;">'.$qrccc['iv_namepro'].'</div>';
                        echo '</div>';
                        echo '</div>';
                        echo '<hr>';
                    }
                    ?>
</div>
</section>        
</div>


<div class="col-md-4 d-none">
<section class="panel panel-success">
<header class="panel-heading">
<div class="panel-actions">
<a href="#" class="fa fa-caret-down"></a>
</div>
<h2 class="panel-title">ใบจองใหม่วันนี้</h2>
</header>
<div class="panel-body text-dark">
    <div class="task medium">
        <div class="desc">
            <?
                    while($qrc= mysql_fetch_assoc($book_today)){
                        $adminsale = $qrc['iv_admin'];
                        echo '<div class="row" style="">';
                        echo '<div class="col-md-12 col-xs-12 text-dark">';
                        echo '<div style="font-size:1rem;">รหัสทัวร์ '.$qrc['programe_code'].'</div>';
                        echo '<div style="font-size:1rem;">Period '.$qrc['book_period'].'</div>';
                        echo '<div style="font-size:1rem;">ลูกค้า '.$qrc['book_name'].'</div>';
                        echo '<div style="font-size:1rem;">TEL '.$qrc['book_tel'].'</div>';
                        echo '<div style="font-size:1rem;">LINE '.$qrc['book_line'].'</div>';
                        echo '<div style="font-size:1rem;">'.$qrc['book_etc'].'</div>';
                        echo '</div>';
                        echo '</div>';
                        echo '<hr>';
                    }
                    ?>
</div>
</section>        
</div>




</div>
</div>



     <div class="modal fade" id="modalBootstrap3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
     <div class="modal-content">
     <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <div class="swal-icon swal-icon--warning">
    <span class="swal-icon--warning__body">
      <span class="swal-icon--warning__dot"></span>
    </span>
  </div>
       <h4 class="modal-title text-danger text-center"  id="myModalLabel">คุณต้องการเปลี่ยนสถานะ<span class="del-item"></span></h4>
      </div>
    <div class="modal-footer" style="margin-top: 0;">
      <a href="#" class="mb-xs mt-xs mr-xs btn btn-default" data-dismiss="modal">Cancel</a>
      <a href="?url=period_delete" class="mb-xs mt-xs mr-xs btn btn-success app_status app_status2" data-dismiss="modal">เปลี่ยน</a>
    </div>
              </div>
              </div>
              </div>

<!-- <div class="col-md-6">
                      <div class="widget-twitter-profile">
                  <div class="profile-info">
                    <div class="profile-picture"> 
            <img src="https://www.best-consortium.com/static/img/bestconsortium_logo.5487bad.svg">                    </div>
          <h2 class="stat text-uppercase header-form text-semibold" style="text-align:center;color: #c70101;">
          TEAM SALE BEST</h2>
          </div>
                                   <div class="progress progress-xl progress-squared m-md">
                                              <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="48" aria-valuemin="0" aria-valuemax="20" style="width:48%;">เอ๋ 48                   </div>
                  </div>
                                  <hr>
            </div>
          </div> -->


   </div>

</section>

