<?php include_once( "../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:shopping.category.LoadList}
{module:shopping.category.Form}
{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>
	
	<form name="cform" action="./confirm.php?shpcn={write:shopping.category.category_object->'category_number'}" method="post" enctype="multipart/form-data">
	<p style="text-align:center;">
		フォームに入力して{if:strlen(shopping.category.category_object->'category_number')>0}編集{else}作成{/if}するボタンをクリックしてください。<br />
	</p>
	<table class="detail" style="width:96%;margin:0 auto;">
	<tbody>
	<tr>
		<th style="width:12em;">カテゴリID</th>
		<td><input type="text" name="category_id" size="30" value="{write:shopping.category.category_object->'category_id'}" /></td>
	</tr>
	<tr>
		<th style="width:12em;">カテゴリ名<span class="required">※</span></th>
		<td><input type="text" name="category_name" size="30" value="{write:shopping.category.category_object->'category_name'}" /></td>
	</tr>
	<tr>
		<th style="width:12em;">カテゴリ<br />フリガナ</th>
		<td><input type="text" name="category_kana" size="30" value="{write:shopping.category.category_object->'category_kana'}" /></td>
	</tr>
	<tr>
		<th style="width:12em;">親カテゴリ</th>
		<td>
			<select name="parent_id">
			<option value="">なし</option>
			{foreach:shopping.category.data_array num category}
			{set:child_category_array category::child_category_object_array}
				<option value="{write:category->'category_id'}"
					{if:category->'category_id'==shopping.category.category_object->'parent_id'} selected{/if}
					>{write:category->'category_name'}</option>
					{foreach:child_category_array child_category_object}
					<option value="{write:child_category_object->'category_id'}"
						{if:child_category_object->'category_id'==shopping.category.category_object->'parent_id'} selected{/if}
						> - {write:child_category_object->'category_name'}</option>
				{/foreach}
			{/foreach}
			</select>
		</td>
	</tr>
	<tr>
		<th style="width:12em;">表示順序</th>
		<td><input type="text" name="order_number" size="3" value="{write:shopping.category.category_object->'order_number'}" /></td>
	</tr>
	<tr>
		<th style="width:12em;">カテゴリ説明</th>
		<td><textarea name="description" cols="40" rows="3">{write:shopping.category.category_object->'description'}</textarea></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}
			<input type="file" name="upfile[0]" size="50" value="" /><br />
			<span class="form_attention">※24x24ピクセル以下</span>
		</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}
			<input type="file" name="upfile[<?php echo $GLOBALS['num']; ?>]" size="50" value="" /><br />
		</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}する" />
	</p>
	<p style="text-align:center;">
	</p>
	</form>
	<br />

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