 <?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='VIP會員網' 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" ,'%VIP會員網%', '%'.$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 = "SELECT a.*,b.mem_user2,b.mem_auto,b.mem_logo2,b.scode FROM travel as a left join member as b on a.tb0=b.adkind where a.tbc='廣告會員網' AND tb3='Y' order by a.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
}
.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']; ?> f"/><?= $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" src=
"https://www.youtube.com/embed/<?= $row_Rt2['ylink']  ?>" allowfullscreen>
      </iframe>
</div><span style="font-size:0.875em"> <?= $row_Rt2['ydoc']  ?></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> 
 
<div id="divx">

<table cellpadding="1">
  
<? 
// R3
$title=""; 
$i=0;
$arrext=array('gif','jpeg','jpg','png');
do { 

  if($title<>$row_Rt3['tb0']){ 
     $title=$row_Rt3['tb0'];
     if($i>0){ echo '</tr>'; } 
	 
	 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'; }
	 
	  ?>
	 <tr> 
	 <td><img name="" src="/adkind/trimg/<?= $logo_image; ?>" title="<?= $row_Rt3['tb2']  ?>"  /> </td> 
    <?
	 $i++;
	 } 
	
	 $ck=(in_array($row_Rt3['mem_logo2'],$arrext))?true:false; //圖檔檢查 
	 //if($row_Rt3['mem_logo2']<>'')
	 if(($row_Rt3['mem_logo2']<>'') &&( $ck) ){
	 ?>
     <td><a href="/adecard/<?= $row_Rt3['scode']?>">
     <div id="div1">
     <img src="/ecard/img/<?= "user_".sprintf("%07d",$row_Rt3['mem_auto']).'.'.$row_Rt3['mem_logo2']; ?>" width="130" height="108" title="<?=  $row_Rt3['mem_user2'].$row_Rt3['scode'] ?>">
 
     <span id="span1"><? 
	  $s1=(mb_strlen($row_Rt3['mem_user2'])>8)?substr($row_Rt3['mem_user2'],0,8):$row_Rt3['mem_user2'];
	  echo $s1."<br>".$row_Rt3['scode']?></span>
     
     </div></a>
       </td>
     <? }?>
<? }  while ($row_Rt3 = mysql_fetch_assoc($Rt3));
mysql_free_result($Rt3);

  ?>     
  
</table> 
</div> 
<? } ?>

 
 
</div>
</div>