
<?
$num = $_POST['num_p'];
$code = $_POST['code'];

$num_day = $_POST['num_day'];
$numday  = $num_day - 1;

$ads = $_POST['price'];
$ci_b = $_POST['size'];
?>  
<style>
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  border: 1px solid #ddd;
}

th, td {
  text-align: center;
  padding: 8px;
}

tr:nth-child(even){background-color: #f2f2f2}
</style>

            <section class="panel">
              <header class="panel-heading"  style="margin-bottom:20px;">
                <h2 class="panel-title">ช่วงเวลา &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  
              </header>

  <div class="row">   
        <div class="col-xl-12">
        <form class="form-horizontal" name="form_period" id="form_period" method="post" code="<?=$code;?>">
  <table>
    <tr style="    background: #e0331e;">
      <th align="center">วันเดินทาง</th>
      <th align="center">ราคาเริ่มต้น</th>
      <th align="center">ผู้เดินทาง</th>
    </tr>
            <?
             $x =1;
      while($x <= $num) {
      ?>
    <tr>
      <td>
        <div class="input-daterange input-group"  style="    margin: auto;">
       <span class="input-group-addon">
         <i class="fa fa-calendar"></i>
         </span>
      <!--  <input type="text" class="form-control" id="datego<?=$x?>" name="datego<?=$x?>" autocomplete="off"> -->
        <input type="text" name="datego<?=$x?>" id="datego" class="form-control" onchange="date_add(this.value,'-','dmy','dateback<?=$x?>',<?=$numday?>,null)" 
        autocomplete="off">
       <span class="input-group-addon">TO</span>
      <input type="text" name="dateback<?=$x?>" id="dateback<?=$x?>" class="form-control" readonly="">
       </div>
     </td>
       <td> <input class="form-control" type="text" id="price-ad<?=$x?>" name="price-ad<?=$x?>" value="<?=$ads?>"></td>
      <td><input class="form-control" type="text" id="price-c<?=$x?>" name="price-c<?=$x?>" value="<?=$ci_b?>"></td>
    </tr>
    <? $x++ ?> <? } ?>
  </table>
           
                <input class="text" type="hidden" id="allx" type="text" name="allx" style="text-transform:uppercase" value="<?=$x-1?>">
                <input class="text" type="hidden" id="code" type="text" name="code" style="text-transform:uppercase" value="<?=$code?>">
                
               <!--  <div class="form-actions" style="float:right;">
                  <button type="submit" id="PeriodBT" class="btn">Submit</button>
                  <button type="reset" onclick="window.history.back();return false;" class="btn">Cancel</button>
              </div> -->
               <div class="col-md-12 text-center p-5 mb-5" style="margin-top:20px;margin-bottom: 20px;">
                <div class="form-actions">
                  <button type="submit" id="PackageBT" class="btn btn-danger"><i class="fa fa-save"></i> บันทึก</button>
                  <button type="reset" onclick="window.history.back();return false;" class="btn btn-cancel-color">ยกเลิก</button>
                </div>
                </div>
            </form>
      
        </div><!--/span-->
      
      </div>
</section>

