<?php

//ファンクションファイルを読み込み
include '../mng/class/myclass_config.php';
include '../mng/class/myclass_html.php';
include '../mng/class/myclass_data.php';//データクラス

//HTMLオブジェクトを作る
$my_class = new myclass_html();

//-------------------------------------------------------------------------------------------
//フォームから送られた情報
$n = stripslashes($_GET['n']);
$tmp_items = explode("_","$n");
$this_item = $tmp_items[0];
$mother_item = $tmp_items[1];

//-------------------------------------------------------------------------------------------
//共通変数
$pass = "../xml/";

//-------------------------------------------------------------------------------------------
/*商品情報を取得*/
$this_url = $pass.$this_item.".xml";
$this_data = new myclass_data($this_url);
$get_data_line = $this_data->get_linenumber(0);

$this_name = $get_data_line["name"];
$this_note = $get_data_line["note"];
$this_img = $get_data_line["img"];
$this_price = number_format($get_data_line["price"]);
$this_goodsid = $get_data_line["goodsid"];
$this_data->deletion();//オブジェクトの削除

//画像名を作る
$this_imgs = explode(",","$this_img");
$this_imgs_big = ereg_replace("small","",$this_imgs[0]);
$main_img = '<a href="../img_photo/'.$this_imgs_big.'" target="_blank"><img src="../img_photo/'.$this_imgs[0].'" border="0" width="120"></a>';

//その他の画像を作る
if($this_imgs[1] != "")
	{
		$oher_title = "<br><br><h3>関連画像</h3><br>";
		$imgs_big = ereg_replace("small","",$this_imgs[1]);
		$img1 = '<div class="imgbox"><a href="../img_photo/'.$imgs_big.'" target="_blank"><img src="../img_photo/'.$this_imgs[1].'" border="0" width="120"></a></div>'."\n";
	}
if($this_imgs[2] != "")
	{
		$imgs_big = ereg_replace("small","",$this_imgs[2]);
		$img2 = '<div class="imgbox"><a href="../img_photo/'.$imgs_big.'" target="_blank"><img src="../img_photo/'.$this_imgs[2].'" border="0" width="120"></a></div>'."\n";
	}
if($this_imgs[3] != "")
	{
		$imgs_big = ereg_replace("small","",$this_imgs[3]);
		$img3 = '<div class="imgbox"><a href="../img_photo/'.$imgs_big.'" target="_blank"><img src="../img_photo/'.$this_imgs[3].'" border="0" width="120"></a></div>'."\n";
	}
if($this_imgs[4] != "")
	{
		$imgs_big = ereg_replace("small","",$this_imgs[4]);
		$img4 = '<div class="imgbox"><a href="../img_photo/'.$imgs_big.'" target="_blank"><img src="../img_photo/'.$this_imgs[4].'" border="0" width="120"></a></div>'."\n";
	}

//-------------------------------------------------------------------------------------------
/*パンクズリストを作る*/
//親カテゴリーか調べる
$mother_url = $pass."list.xml";
$mother_data = new myclass_data($mother_url);
$number = $mother_data->data_number();
$item = "";
for($i=0; $i<$number; $i++)
	{
		$get_data_line = $mother_data->get_linenumber($i);
		if(preg_match("/$mother_item/",$get_data_line["category"]))
			{
				$item = $get_data_line["item"];
				break;
			}
	}
$mother_data->deletion();//オブジェクトの削除

//親カテゴリーの商品情報の場合の親情報取得
if($item == "")
	{
		$mother_url = $pass.$mother_item.".xml";
		$mother_data = new myclass_data($mother_url);
		$get_data_line = $mother_data->get_linenumber(0);
		$mother_name = $get_data_line["name"];
		$mother_data->deletion();//オブジェクトの削除
		$h3_link = '<h3><a href="index.php">商品カテゴリー</a> > <a href="goods_list.php?n='.$mother_item.'">'.$mother_name.'</a> > '.$this_name.'</h3>';
	}

//小カテゴリーの商品情報の場合の親情報取得
if($item != "")
	{
		//小カテゴリー情報の取得
		$mother_url = $pass.$mother_item.".xml";
		$mother_data = new myclass_data($mother_url);
		$get_data_line = $mother_data->get_linenumber(0);
		$mother_name = $get_data_line["name"];
		$mother_data->deletion();//オブジェクトの削除
		//大カテゴリーの取得
		$mother_url = $pass.$item.".xml";
		$mother_data = new myclass_data($mother_url);
		$get_data_line = $mother_data->get_linenumber(0);
		$item_name = $get_data_line["name"];
		$mother_data->deletion();//オブジェクトの削除
		$h3_link = '<h3><a href="index.php">商品カテゴリー</a> > <a href="goods_list.php?n='.$item.'">'.$item_name.'</a> > <a href="goods_list.php?n='.$mother_item.'_'.$item.'">'.$mother_name.'</a> > '.$this_name.'</h3>';
	}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
<meta name="content-language" content="ja">
<title><?php print $this_name?> | <?php print $mother_name?> | 商品カテゴリー | かね宇陶器</title>
<link rel="stylesheet" href="../css/default.css" type="text/css" media="screen">
<link rel="stylesheet" href="../css/defaultprint.css" type="text/css" media="print">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script language="JavaScript" src="../js/default.js"></script>
<script type="text/javascript" src="../acslog/js/access.js"></script>
</head>
<body>
<a name="top"></a>
<div id="container">

<div id="htmlbody">

<!--========= flash area:start =========-->
<!--<div id="flash">
<script language="JavaScript">
<!--
<!--pageflash();-->
//-->
<!--</script>-->

<!-- miki add code Start -->
<div class="slide" id="flash">
    <img src="../img_galleryimg/1550125045.jpg">
    <img src="../img_galleryimg/1550108166.jpg">
    <img src="../img_galleryimg/1314678634.jpg">
    <img src="../img_galleryimg/1314678650.jpg">
    <img src="../img_galleryimg/1550108177.jpg">
    <img src="../img_galleryimg/1550124774.jpg">
    <img src="../img_galleryimg/1550815503.jpg">
</div>
<!-- miki add code End -->

<noscript>this_name
<h1><?php print $this_name?> | <?php print $mother_name?> | 商品カテゴリー | かね宇陶器</h1>
</noscript>
</div>
<!--========= flash area:end =========-->

<!--========= menu area:start =========-->
<div id="menu">
<div class="menu01"><a href="../about/index.html">かね宇陶器について</a></div>
<div class="menu07"><a href="../shigaraki/index.html">信楽狸について</a></div>
<div class="menu02On"><a href="../category/index.php">商品カテゴリー</a></div>
<div class="submenu"><a href="javascript:openwin('price.php','600','600');">商品価格表</a></div>
<div class="menu03"><a href="../news/index.php">新着情報</a></div>
<div class="menu04"><a href="../map/index.html">地図&交通機関</a></div>
<div class="menu05"><a href="../calendar/index.php">カレンダー</a></div>
<div class="menu06"><a href="../mail/index.html">お問合せ</a></div>
<div class="top"><a href="../index.html">トップページに戻る</a></div>
</div>
<!--========= menu area:end =========-->


<div id="textbody">

<!--========= hed area:start =========-->
<div id="detail">
<h2><?php print $this_name?></h2>
<?php print $h3_link?><br>
</div>
<!--========= hed area:end =========-->

<!--========= textbody:start =========-->
<div id="textbox">



<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" valign="top">
<div class="imgbox">
<?php print $main_img?>
</div>
</td>
<td valign="top">
<?php print $this_note?><br>
<br>
価　格　：<?php print $this_price?>円（税込）<br>
商品番号：<?php print $this_goodsid?>
</td>
</tr>
</table>

<!--その他の画像-->
<?php print $oher_title?>

<?php print $img1?>
<?php print $img2?>
<?php print $img3?>
<?php print $img4?>

<br>
<br clear="all">


<div class="pagetop"><a href="#top">PAGE TOP</a></div>
</div>
<!--========= textbody:end =========-->

</div>

</div>
<div id="foot"><script type="text/javascript">copy();</script></div>
</div>
</body>
</html>