						<section class="panel" style="color:red;">
							<header class="panel-heading">
									<!-- <a href="#" class="fa fa-caret-down"></a>
									<a href="#" class="fa fa-times"></a -->
								<a href="?url=programe_form" data-link="?url=program" class="btn btn-success with-shadow-success" style="position: absolute;right: 16px;top: 10px;">เพิ่มรายการทัวร์</a>
						
								<h1 class="panel-title">Program Tour (ต่างประเทศ)</h1>
							</header>
                         <header class="panel-heading">
            <div class="row">
            <div class="col-md-3">
                <label>ประเทศ :</label>
                <select data-plugin-selectTwo  id='programe_wholesale' name="programe_wholesale"  data-rel="chosen" class="form-control populate placeholder date-dropdown">
             <!--    <select class="form-control date-dropdown"> -->
                <option value="">All</option>
                <?$rc = $db->findAll('tbcountry')->execute();while($dbarr= mysql_fetch_array($rc)){?>
                <option value="<?=$dbarr[country_name];?>"><?=$dbarr[country_name];?></option>
                <?}?>
              </select>
            </div>
            <div class="col-md-3">
              <label>สถานะ :</label><br>
             <label data-target="#tophead" class="btn btn-success"> <input type="checkbox" class="filter-checkbox" value="เปิดการขาย"/> เปิดการขาย </label>
             <label data-target="#tophead" class="btn btn-danger"> <input type="checkbox" class="filter-checkbox" value="ปิดการขาย"/>  ปิดการขาย </label>
            </div>
          </div>
          </header>
							<div class="panel-body">

								<table class="table table-bordered table-striped mb-none" id="datatable-iv">
									<thead>
										<tr>
											<th>NO</th>
											<!-- <th>Pic</th> -->
                      <th>รหัสทัวร์</th>
											<th>Program Tour</th>
											<th>Country</th>
											<th>Wholesale</th>
											<th>Status</th>
											<th>Actions</th>
										</tr>
									</thead>
									<tbody>
								<?php
						   $rs = $db->findorder('tb_programe,tbcountry,tbairline','
                           tb_programe.programe_country = tbcountry.country_id && tb_programe.programe_airline = tbairline.airline_id','programe_id asc,programe_code')->execute();
                			$i=0;
                		  while($dbarr= mysql_fetch_array($rs)){ 
     						      $file = $dbarr[programe_file];
                      $id = $dbarr[programe_wholesale];
                      $rp = $db->findByPK('tb_wholesale','wholesale_id',$id)->executeRow();
            				echo "<tr>";  $i++ ;
            				echo "    <td class='center'>$i</td>";
                    echo "    <td class='center'>$dbarr[programe_code]</td>";
            				// echo "    <td class='center'><img src='../upload/$dbarr[programe_img]' width='80'></td>";
            				echo "    <td><a href='https://www.imaginetourservice.com/newimagine/programdetail-$dbarr[programe_code].html' style='text-decoration: none;'  target='_blank'>$dbarr[programe_name]&nbsp;$dbarr[programe_time] </a> </td>";
            				echo "    <td class='center'>$dbarr[country_name]</td>"; 
                    echo "    <td class='center' style='color:red;font-size:12pt;'>$rp[wholesale_name]</td>"; 
            				// echo "    <td class='center'><a data-toggle='modal' data-target='#modalBootstrap'><span class='label label-success'>เพิ่ม PERIOD</span></a></td>";
            				echo "<td class='center'>";
            					 if($dbarr[programe_status] == '1'){
            					 	echo "<span class='label label-success'>เปิดการขาย</span>";
            					 } else {
            					 	echo "<span class='label label-table'>ปิดการขาย</span>";
            					 }
            				echo "</td>";
            				echo "    <td class='center'>
            							<a class='btn btn-edit-color' href='?url=program_edit&id=$dbarr[programe_id]'>
										<i class='fa fa-edit fa-x'></i>  </a>";
							echo "		<a class='btn btn-danger delete-confirm' id='$dbarr[programe_id]' data-item-del='$dbarr[programe_name]&nbsp;$dbarr[programe_time]'>
										<i class='fa fa-trash-o fa-x'></i> 
										</a></td></tr>";
		
            			
                        
          
        				}//mysql_close($link);
       
                		?> 
									</tbody>
								</table>
							</div>
						</section>


<!--       <div class="modal fade" id="modalBootstrap2" 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>
       <h4 class="modal-title" id="myModalLabel">คุณต้องการที่จะลบ PERIOD <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-danger period_del" data-dismiss="modal">Delete</a>
    </div>
              </div>
              </div>
              </div> -->


    <?php
      include('../inc/connect.php'); 
      $strSql2="SELECT * FROM tb_programe,tbairline,tbtrip where tb_programe.programe_id = tbtrip.trip_programe_code
       && tb_programe.programe_airline = tbairline.airline_id && programe_id = '".$_GET["pid"]."' ";
      $rss = mysql_query($strSql2,$conn) or die("Error : ".mysql_error());
      $r = mysql_fetch_array($rss);
       ?> 


                  <div class="modal fade" id="modalBootstrap" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="color:black;">
                    <form class="form-horizontal"  method="post" action="?url=period_addall">
                    <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>
                          <h4 class="modal-title" id="myModalLabel">เลือกจำนวน period ที่ต้องการ</h4>
                        </div>
    <div class="modal-body" style="height: 350px;">
      <center>
        <input class="form-control" type="text" id="code" name="code" value="<?php echo $code;?>" readonly><br><br>

    <!--   <select class="form-control" id="num_day" data-rel="chosen" name="num_day"> -->
      	<select data-plugin-selectTwo name='num_day' id='num_day' data-rel="chosen" class="form-control populate placeholder">
        <option value="0">-- เลือก จำนวนวัน --</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
      </select> <br><br>

      	<select data-plugin-selectTwo name='num_p' id='num_p' data-rel="chosen" class="form-control populate placeholder">
        <option value="0">-- เลือก จำนวนแถว--</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
        <option value="13">13</option>
        <option value="14">14</option>
        <option value="15">15</option>
        <option value="16">16</option>
        <option value="17">17</option>
        <option value="18">18</option>
        <option value="19">19</option>
        <option value="20">20</option>
        <option value="21">21</option>
        <option value="22">22</option>
        <option value="23">23</option>
        <option value="24">24</option>
        <option value="25">25</option>
        <option value="26">26</option>
        <option value="27">27</option>
        <option value="28">28</option>
        <option value="29">29</option>
        <option value="30">30</option>
        <option value="31">31</option>
        <option value="32">32</option>
      </select> <br><br>

       <div class="form-group">
                        <label class="col-md-3 control-label" for="inputDefault">ราคาเริ่มต้น</label>
                        <div class="col-md-6">
                          <input class="form-control" type="text" class="form-control" id="inputDefault" name="price">
                        </div>
                      </div>
        <div class="form-group">
                        <label class="col-md-3 control-label" for="inputDefault">ผู้เดินทาง</label>
                        <div class="col-md-6">
                          <input class="form-control" type="text" class="form-control" id="inputDefault" name="size">
                        </div>
                      </div>
    </div>
    <br><br><br>
      <div class="modal-footer">
      <button type="submit" id="PeriodBT" class="btn">Submit</button>
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
                      </div>
                    </div>
                  </form>
                  </div>
                </div>