<?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']);
$start=stripslashes($_GET['start']);

$tmp_items = explode("_","$n");
$this_item = $tmp_items[0];
$mother_item = $tmp_items[1];
$top_flg = "YES";
if($mother_item == "")
	{
		$mother_item = $this_item;
		$top_flg = "NO";
	}

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

//-------------------------------------------------------------------------------------------
/*表示定義ファイルからその他のカテゴリー情報を取得しておく*/
$list_url = $pass."list.xml";
$list_data = new myclass_data($list_url);
if($mother_item != "")
	{
		$get_id = $list_data->get_id($mother_item,"item");
		$other_category = $get_id["category"];
		$show_flg = $get_id["show"];
	}
else
	{
		$get_id = $list_data->get_id($this_item,"item");
		$other_category = $get_id["category"];
		$show_flg = $get_id["show"];
	}

$list_data->deletion();//オブジェクトの削除

//-------------------------------------------------------------------------------------------
/*その他のカテゴリーを作る*/
$other_category_link = "";
if($other_category != "")
	{
		$other_category_link .= '<strong>その他のカテゴリー</strong><br>'."\n";
	}
$other_categorys = explode(",","$other_category");
foreach ($other_categorys as $value)
	{
		//画像名、商品名を取得
		$tmp_url = $pass.$value.".xml";
		$tmp_data = new myclass_data($tmp_url);
		//情報の取得
		$get_data_line = $tmp_data->get_linenumber(0);
		$other_category_link .= '<a href="goods_list.php?n='.$value.'_'.$mother_item.'">'.$get_data_line["name"].'</a>　'."\n";
		$tmp_data->deletion();//オブジェクトの削除
	}

//-------------------------------------------------------------------------------------------
/*リストデータを取得*/
$mother_url = $pass.$this_item.".xml";
$mother_data = new myclass_data($mother_url);
$get_data_line = $mother_data->get_linenumber(0);

//タイトル、説明、itemIDを取得しておく
$mother_name = $get_data_line["name"];
$mother_note = $get_data_line["note"];
$mother_img = $get_data_line["img"];
$mother_items = $get_data_line["data"];
$mother_data->deletion();//オブジェクトの削除

//-------------------------------------------------------------------------------------------
/*商品一覧を作る*/
/*
$mother_item_list = "";
$hr_number = 0;
$items = explode(",","$mother_items");
//表示件数を決定する
$url = "goods_list.php?n=".$this_item."_".$mother_item;//リンク先のアドレス
$limit = "20";//表示したい全部の行数
$file_nammber = count($items)-1;//表示したい全部の行数
if($start == "")
	{
		$start = 0;
	}
$output = array_slice($items,$start,$limit);
$page_scroll = $my_class->my_pagescroll_short_cut($start,$file_nammber,$url,$limit);
*/
$output = explode(",","$mother_items");
foreach ($output as $value)
	{
		//画像名、商品名を取得
		$tmp_url = $pass.$value.".xml";
		$tmp_data = new myclass_data($tmp_url);
		//情報の取得
		$get_data_line = $tmp_data->get_linenumber(0);
		//画像名の決定
		$title_imgs = explode(",",$get_data_line["img"]);
		$title_img = '<img src="../img_photo/'.$title_imgs[0].'" border="0">';
		$mother_item_list .= '<div class="imgbox">'."\n";
		$mother_item_list .= '<a href="goods_details.php?n='.$value.'_'.$this_item.'">'.$title_img.'</a>'."\n";
		$mother_item_list .= '<p>'.$get_data_line["name"].'</p>'."\n";
		$mother_item_list .= '</div>'."\n";
		if($hr_number == 3)
			{
				$mother_item_list .= '<hr>'."\n";
				$hr_number = 0;
			}
		else
			{
				$hr_number++;
			}
		$tmp_data->deletion();//オブジェクトの削除
	}

//-------------------------------------------------------------------------------------------
/*パンクズリストを作る*/
if($top_flg != "NO")
	{
		$list_url = $pass.$mother_item.".xml";
		$list_data = new myclass_data($list_url);
		$get_data_line = $list_data->get_linenumber(0);
		$category_name = $get_data_line["name"];
		$h3_list = '<h3><a href="index.php">商品カテゴリー</a> > <a href="goods_list.php?n='.$mother_item.'">'.$category_name.'</a> > '.$mother_name.'</h3>'."\n";
		$list_data->deletion();//オブジェクトの削除
	}





?>
<!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 $mother_name?> | <?php print $category_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>
<h1><?php print $c_name?> | <?php print $m_name_title?> かね宇陶器</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="hedbox">
<h2><?php print $mother_name?></h2>
<?php print $h3_list?>
</div>
<!--========= hed area:end =========-->

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

<p class="linebox">
<?php print $mother_note?><br>
<br>
<!--その他のカテゴリー-->
<?php print $other_category_link?>
</p>

<!--商品一覧-->
<?php print $mother_item_list?>
<hr>

<br>
<br>

<!--ページ送り-->
<p class="linebox">
<?php print $page_scroll?>
</p>





<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>