 <?php require_once('../Connections/BE2.php'); ?>
 <? //shop
 
mysql_select_db($database_BE2, $BE2);
$query_Rt3 = sprintf("SELECT * FROM webshop WHERE coid= 1 OR coid='%s' order by coid,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);

// if (  $_SERVER['REMOTE_ADDR']=='220.130.43.118'){  
//      echo $query_Rt3."<br>" ;
	 
 // } 

$arr1=array();
$arr2=array();
$arr2[0][0]=0;
$arr2[0][0]=0; 
$arr2[0][1]=0;
$arr2[0][2]='';
$arr2[0][3]='/products/000830284715.jpg';
$arr2[0][4]='';
$arr2[0][5]='Y'; // can edit upload 
$arr2[0][6]='Y'; // can edit upload 
 
$coid=$row_Rt3['coid'];
$i=0;
do {   
    //if($row_Rt3['coid']==1){$i=$row_Rt3['windex']-1;} 
	
	if($row_Rt3['windex']==0){
	  $arr2[0][0]=0;
      $arr2[0][0]=$row_Rt3['wid']; 
      $arr2[0][1]=$row_Rt3['coid'];
      $arr2[0][2]=$row_Rt3['wtitle'];
      $arr2[0][3]='/shop/img/'.$row_Rt3['wimg'].'.'.$row_Rt3['wimgext'];
      $arr2[0][4]=$row_Rt3['wlink'];
      $arr2[0][5]=$row_Rt3['wuse']; // can edit upload 
      $arr2[0][6]=$row_Rt3['wflag']; // can edit upload 		
		
	
	}else{
	 $i=$row_Rt3['windex']-1; 
	//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'];
	 $arr1[$i][5]=$row_Rt3['wuse']; // can edit upload 
	 $arr1[$i][6]=$row_Rt3['wflag']; // can edit upload 
	 $coid=max($coid,$row_Rt3['coid']);
	}
 }  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 公司簡

mysql_select_db($database_BE2, $BE2);
$query_Rt4 = sprintf("SELECT * FROM shop5 WHERE si10b='%s' ",$coid) ; 
$Rt4 = mysql_query($query_Rt4, $BE2) or die(mysql_error());
$row_Rt4 = mysql_fetch_assoc($Rt4);
$totalRows_Rt4 = mysql_num_rows($Rt4);

$aad=($row_Rt4['si13']%2==0)?"雙號側":"單號側"; 
$arr1[4][4]='/search.html?search2=街道網店商城&keyword='.$row_Rt4['si6a'].$aad."#".$row_Rt4['si5'] ;//#天空商城; //醄醴敬妻泡菜.html

//$_SESSION['shop_name']
// Profile, Product
?>
  <div class="clearfix"> </div>
  <div class="col-12"><img name="" src="<?=$arr2[0][3] ?>" width="100%" alt="" /> </div>
  <div class="clearfix"> </div>
<?
   for($i=0;$i<9;$i++){ 
    if( $arr1[$i][6]>0){
   ?>
       <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="/shop/img/<?= $arr1[$i][3]?>" alt="<?= $arr1[$i][2];?>" title="<?= $arr1[$i][2];?>" /></a>
           
       </div>
            <div style="text-align:center;font-size:14px"><?= $arr1[$i][2];?></div> 
       </div>
    <?
	  $c=$i+1;
	  if($c %3 ==0){ echo '<div class="clearfix"> </div>'; }
	
	  } // end wflag>0 
	}   ?>     
         
        	 <div class="clearfix"> </div>
        
 
<?php
  mysql_free_result($Rt3);
 include "index_block9_2.php";
  ?>  
  
  <div class="clearfix"> </div>      