 <?php require_once('../Connections/BE2.php'); ?>
 <? 
 
mysql_select_db($database_BE2, $BE2);
$query_Rt3 = sprintf("SELECT * FROM webshop WHERE coid= 1 OR coid='%s' order by windex",$_SESSION['shop_id']) ; 
$Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error());
$row_Rt3 = mysql_fetch_assoc($Rt3);
$totalRows_Rt3 = mysql_num_rows($Rt3);
$arr1=array();
$i=0;
do {   
    if(($row_Rt3['coid']>1 )&& ($row_Rt3['wflag']>0)){ $i=$row_Rt3['windex']-1;}
    $arr1[$i][0]=$row_Rt3['wid']; 
	$arr1[$i][1]=$row_Rt3['coid'];
    $arr1[$i][2]=$row_Rt3['wtitle'];
	$arr1[$i][3]=$row_Rt3['wimg'].'.'.$row_Rt3['wimgext'];
	$arr1[$i][4]=$row_Rt3['wlink'];
	$i++;
 }  while ($row_Rt3 = mysql_fetch_assoc($Rt3));
 
//$arr1[0][4]='/showproducts/'.$_SESSION['shop_name'].'.html'; //醄醴敬妻泡菜.html
$arr1[0][4]='/shop/'.$_SESSION['shop_name'].'.html?li=Product';  //醄醴敬妻泡菜.html 我的商品
$arr1[1][4]='/shop/'.$_SESSION['shop_name'].'.html?li=Profile';  //醄醴敬妻泡菜.html 公司簡介
//$_SESSION['shop_name']
// Profile, Product
   for($i=0;$i<9;$i++){ ?>
       <div class="col-md-4 col-xs-4 col-sm-4">
       <div class="thumbnail">
          <a href="<?= ($arr1[$i][4]=="")?"#":$arr1[$i][4] ; ?>" target="_self"><img src="img/<?= $arr1[$i][3]?>" alt="<?= $arr1[$i][2];?>" title="<?= $arr1[$i][2];?>" /></a>
           
       </div>
            <div style="text-align:center"><?= $arr1[$i][2];?></div> 
       </div>
    <?
	  $c=$i+1;
	  if($c %3 ==0){ echo '<div class="clearfix"> </div>'; }
	
	 }   ?>     
         
        	 <div class="clearfix"> </div>
 
<?php
mysql_free_result($Rt3);

?>
      