<?php include_once( "../../../../spider.inc.php" ); ?>{charset:UTF-8}{module:system.login.Check}{module:shopping.category.LoadList}{module:shopping.product.LoadList}

	{if:is_array(shopping.product.category_id_array) && count(shopping.product.category_id_array)>0}
		{set:selectedCategoryObject shopping.category.objectHash[shopping.product.category_id_array[0]]}
	{/if}

	<!-- ページング -->
	<div style="font-size:x-small;">
	{write:shopping.product.total_count}件
	{write:shopping.product.total_page}ページ中{write:shopping.product.page_number}ページ目
	{if:shopping.product.total_page>1}
	{write:(shopping.product.page_number-1)*shopping.product.page_rows+1}-{if:(shopping.product.page_number*shopping.product.page_rows)<shopping.product.total_count}{write:(shopping.product.page_number)*shopping.product.page_rows}{else}{write:shopping.product.total_count}{/if}件目を表示
	{/if}
	</div>
	
	{if:IS_ERROR}
	<ul class="error">
		{foreach:errors error}
			<li style="color:#ff0000;">{write:error}</li>
		{/foreach}
	</ul>
	{/if}

	{foreach:shopping.product.product_array productObject}
	<table class="list" style="margin:0 auto;width:100%;">
	<tbody>
	<tr>
		<th colspan="2" style="text-align:left;">
			<a href="../../product/detail.php?{if:!is_null(selectedCategoryObject)}shpci={write:selectedCategoryObject->'category_id'}&amp;{/if}shpdi={write:productObject->'product_id'}" target="_blank"
				>{write:productObject->'product_id'} : {write:productObject->'product_name'}</a>
		</th>
	</tr>
	<tr>
		<td class="list" style="font-size:x-small;vertical-align:top;text-align:center;width:60px;">
			{set:fileIdArray productObject::fileIdArray}
			{if:strlen(fileIdArray[0])>0}
				<a href="../../product/detail.php?{if:!is_null(selectedCategoryObject)}shpci={write:selectedCategoryObject->'category_id'}&amp;{/if}shpdi={write:productObject->'product_id'}" target="_blank"><img src="/file/download.php?fi={write:fileIdArray[0]}&amp;w=50&amp;h=50" /></a><br />
			{else}
				<table style="width:50px;height:50px;margin:0 auto;">
				<tbody>
				<tr>
					<td style="vertical-align:middle;text-align:center;"><a href="../../product/detail.php?{if:!is_null(selectedCategoryObject)}shpci={write:selectedCategoryObject->'category_id'}&amp;{/if}shpdi={write:productObject->'product_id'}" style="font-size:x-small;" target="_blank">画像なし</a></td>
				</tr>
				</tbody>
				</table>
			{/if}
		</td>
		<td class="list" style="font-size:x-small;vertical-align:top;padding:0px;">
			<!-- 管理パネルでは直接オーダー表示	-->
			<table class="shopping-order-product-unit">
			<tbody>
			{foreach:productObject::unitObjectArray unitObject}
			<tr>
				<td style="border-bottom:dotted 1px #d0d0d0;white-space:nowrap;width:20%;">
					{write:unitObject->'unit_name'}
				</td>
				<td style="border-bottom:dotted 1px #d0d0d0;white-space:nowrap;text-align:right;width:30%;">
					&yen;{write:number_format(unitObject->'price_sell')}-
				</td>
			</tr>
			<tr>
				<td colspan="2" style="border-bottom:solid 1px #808080;">
					<form name="order_{write:productObject->'product_id'}_{write:unitObject->'unit_id'}" method="post">
					<input type="hidden" name="command" value="add" />
					<input type="hidden" name="address_order" value="0" />
					<input type="hidden" name="unit_id" value="{write:unitObject->'unit_id'}" />
					<input type="hidden" name="buying_flag" value="" />
					{if:900<=unitObject->'delivery_type'}
					<div style="text-align:right;">
						<input type="hidden" name="order_count" value="1" />
						<input type="button" value="予約する" onclick="shoppingOrderViewCalendarPanel('{write:productObject->'product_id'}','{write:unitObject->'unit_id'}','calendar')" />
					</div>
					{else-if:200<=unitObject->'delivery_type'}
					<div style="text-align:right;">
						<input type="hidden" name="order_count" value="1" />
						<input type="button" value="予約する" onclick="shoppingOrderViewCalendarPanel('{write:productObject->'product_id'}','{write:unitObject->'unit_id'}','timetable')" />
					</div>
					{else}
					<div style="width:3em;white-space-nowrap;float:left;">
						{if:unitObject->'stock'==-1}
							無制限
						{else-if:unitObject->'stock_view'==0}
							<span style="color:#ff0000;">在庫切</span>
						{else}
							残{write:unitObject->'stock_view'}個
						{/if}
					</div>
					<div style="text-align:right;">
						&yen;<input type="text" name="price_unit" size="8" value="{write:unitObject->'price_sell'}" style="text-align:right;" />で
						{if:unitObject->'stock'==0}
						{else}
						<input type="text" name="order_count" size="1" value="1"
						 />個<input type="button" value="{write:SHOPPING_LABEL_ORDER}する" onclick="shoppingOrderCartAdd(document.order_{write:productObject->'product_id'}_{write:unitObject->'unit_id'})" />
						{/if}
					 </div>
					 {/if}
					</form>
				</td>
			</tr>
			{/foreach}
			</table>
			</form>
		</td>
	</tr>
	</tbody>
	</table>
	<div class="shopping-hr"></div>
	{/foreach}

	<!-- ページング -->
	<div class="shopping-list-paging" style="width:100%;font-size:x-small;">
	{if:shopping.product.total_page>1}
	{if:shopping.product.page_navi_array[0] > 10}<span class="other-page"
	><a href="javascript:shoppingOrderListPageJump({write:shopping.product.page_navi_array[0]-1})"
		title="前の10ページ：{write:shopping.product.page_number-10}-{write:shopping.product.page_number-1}ページ"
	>&lt;&lt;</a></span>{/if}{foreach:shopping.product.page_navi_array page.pageNavi}{if:page.pageNavi==shopping.product.page_number}<span class="current-page"
			>{write:page.pageNavi}</span>{else}<span class="other-page"><a href="javascript:shoppingOrderListPageJump({write:page.pageNavi})"
				title="{write:page.pageNavi}ページ目を表示"
			>{write:page.pageNavi}</a></span>{/if}{/foreach}{if:page.pageNavi+1<=shopping.product.total_page}<span class="other-page"
	><a href="javascript:shoppingOrderListPageJump({write:page.pageNavi+1})"
		title="次の10ページ：{write:page.pageNavi+1}-{if:page.pageNavi+10 > shopping.product.total_page}{write:shopping.product.total_page}{else}{write:page.pageNavi+10}{/if}ページ"
	>&gt;&gt;</a></span>{/if}
	{/if}
	</div>
