 <?php require_once('../Connections/BE2.php'); ?>
 <? 

$co1=isset($_GET['menu'])?$_GET['menu']:'';

if($co1==''){  
 mysql_select_db($database_BE2, $BE2);
 $query_Rt1 = "SELECT * FROM city_img where 1 order by ctid" ; 
 $Rt1 = mysql_query($query_Rt1, $BE2) or die(mysql_error());
 $row_Rt1 = mysql_fetch_assoc($Rt1);
}else{

 mysql_select_db($database_BE2, $BE2);
 $query_Rt2 = "SELECT * FROM video_master as a left join youvideo as b on a.vid=b.ykid AND b.yflag='Y' where a.vflag='Y' AND a.vkid='旅遊網' order by vindex" ; 
 $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error());
 $row_Rt2 = mysql_fetch_assoc($Rt2);
 $totalRows_Rt2 = mysql_num_rows($Rt2);


 mysql_select_db($database_BE2, $BE2);
 $query_Rt3 = "SELECT * FROM travel where tbc='旅遊網' AND tb3='Y' order by tbindex" ; 
 $Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error());
 $row_Rt3 = mysql_fetch_assoc($Rt3);
 $totalRows_Rt3 = mysql_num_rows($Rt3);
 
 
}
$title=""; 
$i=0;
  ?>
<style> 
#divx{
 // border: 1px solid black;
  width: 100%;
  margin-bottom: 12px;
  overflow-x: auto; //hidden scroll visible auto
}
 
</style> 


<div class="container"  style="margin-top:20">

 <? if($co1==''){ ?>
 <div class="col-12 align-self-center"> 
 
 <? $i=0;
  do { ?>
    <div class="col-3 col-sm-3" style="padding:5;display: flex;float:left;">
 	<a href="<?=$row_Rt1['ctlink']?>.html">
	  <img class="img-fluid"  src="cityimg/<?= $row_Rt1['ctimg'] ?>.jpg" width="100%" title="<?= $row_Rt1['ctname'] ?>"/> 
    </a>  
    </div>
 <?  $i++; 
     if($i==19){?> <div class="clearfix"> </div>  <? } ?>
 	  
 <? }  while ($row_Rt1 = mysql_fetch_assoc($Rt1)); 
    
  mysql_free_result($Rt1);
  ?>
 
 
 </div>
 <? }  else { ?>
	 
	 
 <?  
 // R2
 $i=0;
 $vid='';
   
   do {
     if($vid<>$row_Rt2['vid']){ 
	 $vid=$row_Rt2['vid']; 
     $logo_image=sprintf("%04d",$row_Rt2['vid']).$row_Rt2['vimg'].'.png';
	 ?> <div class="clearfix"> </div>
	    <div class="col-xs-2 col-sm-2 mb-2"><img name="" src="/video_img/logo/<?= $logo_image; ?>" title="<?= $row_Rt2['vdoc']  ?>" /></div>
        <div class="col-xs-6 col-sm-6 mb-2"><? if($row_Rt2['ylink']<>''){?>
        <div class="embed-responsive embed-responsive-16by9">
      <iframe class= "embed-responsive-item" src=
"https://www.youtube.com/embed/<?= $row_Rt2['ylink']  ?>" allowfullscreen>
      </iframe>
</div>
        <?  } ?> </div>
	 <? } else{ ?>
		<div class="col-xs-6 col-sm-6 mb-2"> <? if($row_Rt2['ylink']<>''){?>
        <div class="embed-responsive embed-responsive-16by9">
      <iframe class= "embed-responsive-item" src=
"https://www.youtube.com/embed/<?= $row_Rt2['ylink']  ?>" allowfullscreen>
      </iframe>
</div> <? } ?>
        </div>
	 <?  }
 
  }  while ($row_Rt2 = mysql_fetch_assoc($Rt2));  

 mysql_free_result($Rt2); ?>

  <div class="clearfix"> </div>
 <?  // R3 
   
  do { 
 
  if($row_Rt3['tbimg']==''){
		  $logo_image='tr_bg_'.sprintf("%07d",$row_Rt3['tb0']).'.png';
		 }else{ $logo_image=sprintf("%04d",$row_Rt3['tb0']).$row_Rt3['tbimg'].'.png'; }
 
  ?>

 <div class="col-xs-2 col-sm-2 mb-2"><img name="" src="/travel/trimg/<?= $logo_image; ?>" title="<?= $row_Rt3['tb2']  ?>" /></div>
 <div class="clearfix"> </div>

  
<?  }  while ($row_Rt3 = mysql_fetch_assoc($Rt3));  

  
   mysql_free_result($Rt3);
 }
  ?>     
  
 
        	 <div class="clearfix"> </div>

 
</div>
 
<?php

?>  