<?php
#******************************************************************************#
# ＠ぴあショッピング                                                           #
# 夏フェス特集                                                                 #
#------------------------------------------------------------------------------#
# 2010.07.20 新規作成                                                          #
#******************************************************************************#
################################################################################
# Include                                                                      #
################################################################################
	include_once("bc.php");

// おすすめ
	$feedPath = "shop";
	$fixedParam = array(
		'partner' => $partnerID,
		'num'     => '1'
	);

	$osusume = getOsusumeList('/home/webext/docs/www/shopping/osusume_frame_fes.csv');
	for ( $i = 0; $i < count( $osusume ); $i++ ){
		$fixedParam['q'] = urlencode( $osusume[$i]['kw'] );
		if ( !empty( $osusume[$i]["category"] ) ){
			$fixedParam['dir'] = $osusume[$i]["category"];
		}
		else{
			$fixedParam['dir'] = "";
		}
		$xml_data = getBecomeXML($feedPath,$fixedParam,"");
		$selectList[$i] = parseShopList($xml_data,"general");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="Description" content="話題のアイテムをcheck！" />
<meta name="Keywords" content="ショッピング,ランキング,おすすめアイテム,話題の商品" />
<meta name="author" content="ぴあ株式会社" />
<title>ショッピングサーチ／＠ぴあ</title>
<link rel="stylesheet" type="text/css" href="../css/import.css" media="screen, print" charset="Shift_JIS" />
<link rel="stylesheet" type="text/css" href="./css/style.css" media="screen" />
<link rel="stylesheet" type="text/css" href="./css/style2.css" media="screen" />
<link rel="start" href="/" title="トップページ" />
<link rel="index" href="/sitemap/" title="サイトマップ" />
<link rel="alternate" type="application/rss+xml" title="ROR" href="../sitemap.xml" />
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/function.js" charset="Shift_JIS"></script>
<script type="text/javascript" src="../js/rollover.js"></script>
<script type="text/javascript" src="../js/smoothscroll.js"></script>
</head>
<body>

<div id="box_fes">
<table border="0" cellpadding="0" cellspacing="0">
<?php
$item_max = 3;
for ( $col = 0, $idx = 0, $i = 0, $br = 0; $col < count( $selectList ) * $fixedParam["num"] / $item_max; $col++, $br = 0 ){
?>
<tr>
<?php
	for ( ; $idx < count( $selectList ); $idx++, $i = 0 ){
		for ( ; $i < count( $selectList[$idx]["result"] ); $i++ ){
			$item = $selectList[$idx]["result"][$i];
			if ( empty( $osusume[$idx]["category"] ) ){
				$cate = "";
			}else{
				$cate = "&dir=" . $osusume[$idx]["category"];
			}
?>
<td class="sp1"></td>
<td>
<p><?echo $osusume[$idx]["title"] ?></p>
<p class="ph"><a href="/shopping/shop.php?q=<?echo $osusume[$idx]["kw"] ?><?echo $cate ?>" target="_top"><img src="<?echo $item["image_url"] ?>" alt="" border="0" /></a></p>
</td>
<?php
			$all = $idx * $fixedParam["num"] + $i;
			if ( !(($all+1) % $item_max) ){
				$br = 1;
				$i++;
				break;
			}
		}
		if ( $br ){
			break;
		}
	}
	if ( !$br ){
		for ( $j = 0; $j < $item_max - (($all + 1) % $item_max); $j++ ){
?>
<td class="sp1"></td>
<td>
<p>&nbsp;</p>
<p class="ph">&nbsp;</p>
</td>
<?php
		}
	}
?>
</tr>
<?php
}
?>
</table>
</div>

</body>
</html>
