	             <?
if(!empty($_GET['id'])){
    
    $id = $_GET['id'];
    $r = $db->findByPK('tb_wholesale','wholesale_id',$id)->executeRow();
    
}
?>	            
                                <section class="panel">
									<header class="panel-heading">
										<h2 class="panel-title bread-c"><a href="?url=wholesale">wholesale > </a>Create Wholesale :</h2>
									</header>
                                   
					<div class="panel-body">
						<form class="form-horizontal form-bordered" id="form_wholesale" name="form_wholesale" method="post" >
								<div class="row">
					
                                   <div class="col-md-6">
											<div class="form-group">
												<label class="col-md-3 control-label" for="inputDefault">Wholesale NAME</label>
												<div class="col-md-6">
													<input type=hidden name=id value='<? echo $id;?>'>
													<input type="text" class="form-control" id="inputDefault" id='name' name='name' value="<?echo $r['wholesale_name'];?>">
												</div>
											</div>
							
									
                                 <div class="col-md-12 text-center" style="margin-top: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>
								</section>


														<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>
							<div class="panel-body">
								<table class="table table-bordered table-striped mb-none" id="datatable-tabletools">
									<thead>
										<tr>
											<th>NO</th>
											<th>Pic</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();
                      if ($dbarr[programe_wholesale] == $_GET['id']) {
            				echo "<tr>";  $i++ ;
            				echo "    <td class='center'>$i</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'><span class='label label-table' style='width:120px;'>
            				$dbarr[programe_code]</span> : $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>




