 <?php require_once('../Connections/BE2.php'); ?>
 <? 

$co1=isset($_GET['menu'])?$_GET['menu']:'';

if($co1<>''){

 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" ; 
 $query_Rt2 = sprintf("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 like '%s' AND  a.vzone like '%s'  order by a.vindex,a.vid,b.yindex" ,'%旅遊網%', '%'.$co1.'%') ; 
 
 $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 = sprintf("SELECT a.*,b.company_title,b.company_pic,b.mid FROM travel as a left join company as b on b.co_tb1=2 AND a.tb0=b.co_tb2 AND b.company_title<>'' AND b.co_tb3='%s' where a.tbc='旅遊網' AND a.tb3='Y' order by a.tbindex",$co1) ; 
 //$query_Rt3 = sprintf("SELECT a.*,b.company_title,b.company_pic,b.mid FROM company_kinds as a left join company as b on a.kid=b.co_tb2 AND b.company_title<>'' AND b.co_tb3='%s' WHERE a.kflag='Y' order by a.kindex",$co1); //b.company_kind>1  AND 

 $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
}
.divimg{
	position: relative; 
	width: 130px; 
	height: 108px; 
}

   /*div1下面 包含着1个图片和1段文字*/
     #div1{
                position: relative;/*相对定位*/
                width: 138px;
                height: 108px;
            }
            /*图片部分的设置*/
            #img1{
                /*position: static;默认定位,可以省略*/
                width: 100%;
                height: 100%;
            }
            /*文字的设置*/
            #span1{
                position: absolute;/*绝对定位*/
				background-color:#333;
                width: 95%;
                bottom: 0px;/*离底下0像素*/
                left: 0px;/*离左边0像素*/
                text-align: center;
                font-size: 16px;
				font-weight:bold;
				color: white;
				 filter: alpha(opacity=50); /* internet explorer */
                -khtml-opacity: 0.5;      /* khtml, old safari */
                -moz-opacity: 0.5;       /* mozilla, netscape */
                 opacity: 0.5;           /* fx, safari, opera */
            }  
</style> 


<div class="container"  style="margin-top:20">

 <? if($co1==''){ 
  include "../city_link.php";
 }  else { ?>
	 
<div id="divx"> 
<table cellspacing="1" >
 <?
// R2
 $i=0;
 $vid='';
   
   do {
     if($vid<>$row_Rt2['vid']){ 
	 $vid=$row_Rt2['vid']; 
     if($i>0){ echo '</tr>'; }
	 $logo_image=sprintf("%04d",$row_Rt2['vid']).$row_Rt2['vimg'].'.png';
	 ?>
     <tr align="center" valign="middle"> 
	 <td><? 
	  $a1='';
	  $a2='';
	 // if($row_Rt2['vlink']<>''){ $a1='<a href="'.$row_Rt2['vlink'].'">';  $a2= '</a>' ;}  
	  $a1='<a href="/discover/'.$row_Rt2['vdoc'].'.html">';  $a2= '</a>' ; 
	  echo $a1;?><img name="" src="/video_img/logo/<?= $logo_image; ?>" title="<?= $row_Rt2['vdoc']; ?>"/><?= $a2;?></td> 
      <? $i++;
	      }
		if($row_Rt2['ylink']<>''){
	 ?>
     <td width="150"><div id="div1">
     <? if($row_Rt2['video']=='Y'){?> 
         <div class="embed-responsive embed-responsive-16by9" style=" margin-right:15px; margin-top:20px">
          <iframe class= "embed-responsive-item"  width="90%" src="https://www.youtube.com/embed/<?= $row_Rt2['ylink']  ?>" allowfullscreen></iframe>
        </div><span style="font-size:0.875em"> <?= mb_substr($row_Rt2['ydoc'], 0, 5, "UTF-8") ; ?></span>
     <? } else{?>  
    <a href="<?= $row_Rt2['ylink']  ?>"><img src="/video_img/logo/<?= $row_Rt2['yimage'];?>"  title="<?= $row_Rt2['vdoc']?>" width="130" height="108" /></a>

    <? } ?>

</div>
       </td>
     <? }
  }  while ($row_Rt2 = mysql_fetch_assoc($Rt2));  

 mysql_free_result($Rt2); ?>
</table>
</div>
  <div class="clearfix"> </div> 
  
   <table>
<?  
$title=""; 
$i=0;  
  do { ?> 

<?  if($title<>$row_Rt3['tb0']){ 
     $title=$row_Rt3['tb0'];
     if($i>0){ echo '</tr>'; }  ?>
	 <tr>
     <td>
     <? 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'; }

	 ?>
     <img name="" src="/travel/trimg/<?= $logo_image; ?>" title="<?= $row_Rt3['tb2']  ?>" /></td> 
	 <?
	 $i++;
	 } 
	 
	 
	  if($row_Rt3['company_title']<>''){
	 ?>
      <td><a href="/shop/<?= $row_Rt3['company_title']?>.html"><img name="" src="/shopmap/images/logo_<?= $row_Rt3['mid'].".jpg" ?>"  title="<?= $row_Rt3['company_title']?>" /></a></td>
     <?   }?>
<? }  while ($row_Rt3 = mysql_fetch_assoc($Rt3)); 
mysql_free_result($Rt3);
 }
 ?>     
  
</table>  
  
        	 <div class="clearfix"> </div>

 
</div>
 