<?php include_once( "../../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:shopping.category.LoadList}
{module:shopping.order.Cart}
{module:shopping.order.Optimize}
{preset:page_title 'ショップ管理 > ' . SHOPPING_LABEL_ORDER . '新規追加 オプション入力'}

	<div class="panc">
		<a href="../../../">管理パネルトップ</a>
		&gt; <a href="../../">ショップ管理</a>
		&gt; <a href="../">{write:SHOPPING_LABEL_ORDER}一覧</a>
		&gt; {write:SHOPPING_LABEL_ORDER}追加：{write:SHOPPING_LABEL_PRODUCT}選択とお届け先入力
	</div><br />

	<div class="admin_orderform">
	<h1><a name="pagetop" id="pagetop">{write:SHOPPING_LABEL_ORDER}追加:{write:SHOPPING_LABEL_PRODUCT}{write:SHOPPING_LABEL_ORDER}オプション入力</a></h1>
	
	{if:IS_ERROR}
	<ul class="error">
		{foreach:errors error}
			<li style="color:#ff0000;">{write:error}</li>
		{/foreach}
	</ul>

	{else-if:shopping.order.orderObject->getAllItemCount(request)>0}
	<form name="orderForm" action="./itemoptionsc.php" method="POST">	
		{foreach:shopping.order.orderObject::shoppingOrderAddressObjectArray addressOrder shoppingOrderAddressObject}
			{foreach:shoppingOrderAddressObject::shoppingOrderItemObjectArray itemOrder itemObject}
				{set:unitObject itemObject->'shoppingProductUnitObject'}
				{set:productObject unitObject->'shoppingProductObject'}
				{set:itemOptionArray itemObject->getOrderOptionObjectArray(request)}
				{if:count(itemOptionArray)>0}
				<h2>
					宛先{write:(addressOrder+1)}:
					{write:productObject->'product_name'}
					{write:unitObject->'unit_name'}
					の{write:SHOPPING_LABEL_ORDER}オプション
				</h2>
				<div style="width:95%;margin:0 auto">
					<div style="width:100px;float:left;">
						{set:fileIdArray productObject::fileIdArray}
						{if:strlen(fileIdArray[0])>0}
							<a href="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/shopping/product/unit/detail.php?shpdi={write:unitObject->'unit_id'}" target="_blank"
							><img src="/file/download.php?fi={write:fileIdArray[0]}&amp;w=80&amp;h=80" /></a><br />
						{else}
							<table style="width:80px;height:80px;margin:0 auto;">
							<tbody>
							<tr>
								<td style="vertical-align:middle;text-align:center;font-size:9px;"
									><a href="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/shopping/product/unit/detail.php?shpdi={write:unitObject->'unit_id'}" target="_blank"
									>画像<br />なし</a></td>
							</tr>
							</tbody>
							</table>
						{/if}
					</div>
					<table style="width:580px;">
					{foreach:itemOptionArray itemOptionObject}
					<tr>
						<th>{write:itemOptionObject->'option_name'}</th>
						<td>
							{set:formNameName 'item_option_names[' . addressOrder . '][' . itemOrder . ']'}
							{set:formNameValue 'item_option_values[' . addressOrder . '][' . itemOrder . ']'}
							{write:itemOptionObject->getInputForm(request, itemOptionObject->'option_value', '', formNameName, formNameValue ) noescape}
						</td>
					</tr>
					{/foreach}
					</table><br style="clear:left;" />
				</div>
				{/if}
			{/foreach}
		{/foreach}
		
		<p style="text-align:center;">
			<input type="submit" value="お支払方法のご指定へ" name="submit" style="padding:5px;text-align:center;background-color:#DFDFDF;border-style:solid;border-width:1px;" />
		</p>
		</form>
		
	{else}
		<p>
			{write:SHOPPING_LABEL_ORDER}{write:SHOPPING_LABEL_PRODUCT}を選択してください。
		</p>
	{/if}
	</div>