<?php include_once( "../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:shopping.category.LoadList}
{module:shopping.category.Confirm}
{preset:page_title 'ショップ管理 > ' . SHOPPING_LABEL_PRODUCT . 'カテゴリ管理 > ' . SHOPPING_LABEL_PRODUCT . 'カテゴリの追加・編集 入力確認'}

	<div class="panc">
		<a href="../../">管理パネルトップ</a>
		&gt; <a href="../">ショップ管理</a>
		&gt; <a href="./">{write:SHOPPING_LABEL_PRODUCT}カテゴリ管理</a>
		{if:strlen(shopping.category.category_object->'category_number')>0}
		&gt; {write:shopping.category.category_object->'category_name'}の編集
		{else}
		&gt; カテゴリ新規作成
		{/if}
		入力確認
	</div>

	<h1>
		ショップ管理
		&gt; {write:SHOPPING_LABEL_PRODUCT}カテゴリ管理
		{if:strlen(shopping.category.category_object->'category_number')>0}
		&gt; {write:shopping.category.category_object->'category_name'}の編集
		{else}
		&gt; カテゴリ新規作成
		{/if}
		入力確認
	</h1>
	
{if:IS_ERROR}

	<ul class="error">
	{foreach:errors error}
		<li>{write:error}</li>
	{/foreach}
	</ul>

	<p style="text-align:center;">
		<input type="button" value="戻る"
			onclick="history.back();"
		/>
	</p>
{else}
	{set:contentUploader shopping.category.category_object->'contentUploader'}
	{set:contentFileObjectArray contentUploader->'contentFileObjectArray'}
	<form name="cform" action="./execute.php?shpcn={write:shopping.category.category_object->'category_number'}" method="post">
	<p style="text-align:center;">
		下記のカテゴリを{if:strlen(shopping.category.category_object->'category_number')>0}編集{else}作成{/if}します。よろしければ<br />
		「{if:strlen(shopping.category.category_object->'category_number')>0}編集{else}作成{/if}する」ボタンをクリックしてください。<br />
		<br />
		
	</p>
	<table class="detail" style="width:96%;margin:0 auto;">
	<tbody>
	<tr>
		<th style="width:12em;">カテゴリID</th>
		<td>{write:shopping.category.category_object->'category_id'}</td>
	</tr>
	<tr>
		<th style="width:12em;">カテゴリ名</th>
		<td>
			<span style="font-size:1.3em;color:#0000FF;font-weight:bold;">{write:shopping.category.category_object->'category_name'}</span>
		</td>
	</tr>
	<tr>
		<th style="width:12em;">カテゴリ<br />フリガナ</th>
		<td>{write:shopping.category.category_object->'category_kana'}</td>
	</tr>
	<tr>
		<th style="width:12em;">親カテゴリ</th>
		<td>
			{foreach:shopping.category.data_array num category}
			{set:child_category_array category->'child_category_object_array'}
					{if:category->'category_id'==shopping.category.category_object->'parent_id'}{write:category->'category_name'}<br />{/if}
					{foreach:child_category_array child_category_object}
						{if:child_category_object->'category_id'==shopping.category.category_object->'parent_id'} - {write:child_category_object->'category_name'}<br />{/if}
				{/foreach}
			{/foreach}
		</td>
	</tr>
	<tr>
		<th style="width:12em;">表示順序</th>
		<td>{write:shopping.category.category_object->'order_number'}</td>
	</tr>
	<tr>
		<th style="width:12em;">カテゴリ説明</th>
		<td>{write:shopping.category.category_object->'description'}</td>
	</tr>
	<tr>
		<th>アイコン画像</th>
		<td>
			{if:shopping.category.category_object->getImageURI(request, 0)}
				<img src="{write:shopping.category.category_object->getImageURI(request, 0)}" /><br />
			{/if}
			{if:isset(contentFileObjectArray) && isset(contentFileObjectArray[0])}
				=>
				<img src="{write:contentFileObjectArray[0]->'tmpFileUri'}" />
			{/if}
		</td>
	</tr>
	<?php for( $GLOBALS['num']=1; $GLOBALS['num']<10; $GLOBALS['num']++ ){ ?>
	<tr>
		<th>イメージ画像</th>
		<td>
			{if:shopping.category.category_object->getImageURI(request, num)}
				<img src="{write:shopping.category.category_object->getImageURI(request, num)}" style="width:320px;" /><br />
			{/if}
			{if:isset(contentFileObjectArray) && isset(contentFileObjectArray[num])}
				=>
				<img src="{write:contentFileObjectArray[num]->'tmpFileUri'}" style="width:320px;" />
			{/if}
		</td>
	</tr>
	<?php } ?>
	</tbody>
	</table>
	<p style="text-align:center;">
		<input type="submit" value="{if:strlen(shopping.category.category_object->'category_number')>0}編集{else}作成{/if}する"
		/><input type="button" value="戻る"
			onclick="history.back();"
		/>
	</p>
	</form>

{/if}
	<hr style="width:96%;margin:0 auto;margin-top:1em;" />
	<div style="width:96%;margin:0 auto;text-align:right;">
		<a href="./">&gt;&gt; カテゴリ管理へ戻る</a>
	</div>