<?php include_once( "../../../../spider.inc.php" ); ?>
{charset:UTF-8}
{module:shopping.order.Cart}
{module:shopping.order.Optimize}

	{if:shopping.order.orderObject->'requireAddress'}
	{foreach:shopping.order.orderObject::shoppingOrderAddressObjectArray addressOrder orderAddressObject}
	<h2>宛先 {write:addressOrder+1}</h2>
	<div style="width:96%;margin:0 auto;">
		{write:SHOPPING_LABEL_ORDER}{write:SHOPPING_LABEL_PRODUCT}:
		{foreach:orderAddressObject::shoppingOrderItemObjectArray itemOrder itemObject}
		{set:unitObject itemObject->'shoppingProductUnitObject'}
		{set:productObject unitObject->'shoppingProductObject'}
		<span style="white-space:nowrap;">{write:productObject->'product_name'} {write:unitObject->'unit_name'} {write:itemObject->'order_count'}個</span>
		{/foreach}
	</div>
	{set:columnErrorHash orderAddressObject->'columnErrorHash'}
	<div style="width:96%;margin:0 auto;text-align:right;">
		<input type="button" value="{write:MEMBER_PERSONAL_LABEL}情報をコピー" onclick="shoppingOrderCopyAddress2Address({write:addressOrder})" />
	</div>
	<table>
	<tbody>
	<tr>
		<th>お名前<span class="required">*</span></th>
		<td style="padding:5px;vertical-align:top;">
			<input type="text" id="address-name-{write:addressOrder}" name="address_name[{write:addressOrder}]" size="50" value="{write:orderAddressObject->'address_name'}"
				{if:array_key_exists('address_name',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/><br />
			{if:array_key_exists('address_name',columnErrorHash)}
			<span style="color:#ff0000;font-size:x-small;">
			{foreach:columnErrorHash::address_name error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	<tr>
		<th>フリガナ</th>
		<td>
			<input type="text" id="address-kana-{write:addressOrder}" name="address_kana[{write:addressOrder}]" size="50" value="{write:orderAddressObject->'address_kana'}"
				{if:array_key_exists('address_kana',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/>
			{if:array_key_exists('address_kana',columnErrorHash)}
			<br /><span style="color:#ff0000;font-size:x-small;">
			{foreach:columnErrorHash::address_kana error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	<tr>
		<th>郵便番号<span class="required">*</span></th>
		<td>
			〒<input type="text" id="address-zip-code-pre-{write:addressOrder}" name="address_zip_code_pre[{write:addressOrder}]" size="3" value="{write:orderAddressObject->'zip_code_pre'}"
				{if:array_key_exists('zip_code_pre',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/>-<input type="text" id="address-zip-code-pst-{write:addressOrder}" name="address_zip_code_pst[{write:addressOrder}]" size="4" value="{write:orderAddressObject->'zip_code_pst'}"
				{if:array_key_exists('zip_code_pst',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/><br />
			{if:array_key_exists('zip_code_pre',columnErrorHash)}
			<span style="color:#ff0000;font-size:x-small;">
			{foreach:columnErrorHash::zip_code_pre error}{write:error}<br />{/foreach}</span>
			{/if}
			{if:array_key_exists('zip_code_pst',columnErrorHash)}
			<span style="color:#ff0000;font-size:x-small;">
			{foreach:columnErrorHash::zip_code_pst error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	<tr>
		<th>都道府県<span class="required">*</span></th>
		<td style="padding:5px;{if:array_key_exists('prefecture_number',columnErrorHash)}background-color:#ffa0a0;{/if}">
			<select name="address_prefecture_number[{write:addressOrder}]" id="address-prefecture-number-{write:addressOrder}">
				<option value="">選択必須</option>
				{foreach:PREFECTURE_HASH prefNumber prefName}
				<option value="{write:prefNumber}"{if:prefNumber==orderAddressObject->'prefecture_number'} selected{/if}>{write:prefName}</option>
				{/foreach}
			</select>&nbsp;都道府県を選択してください
			{if:array_key_exists('prefecture_number',columnErrorHash)}
			<br /><span style="color:#ff0000;font-size:x-small;">
			{foreach:columnErrorHash::prefecture_number error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	<tr>
		<th>住所・番地<span class="required">*</span></th>
		<td>
			<input type="text" id="address-address-{write:addressOrder}" name="address_address[{write:addressOrder}]" size="50" value="{write:orderAddressObject->'address'}"
				{if:array_key_exists('address',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/>
			{if:array_key_exists('address',columnErrorHash)}
			<br /><span style="color:#ff0000;font-size:x-small;">
			{foreach:columnErrorHash::address error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	<tr>
		<th>建物・部屋番号</th>
		<td>
			<input type="text" id="address-building-{write:addressOrder}" name="address_building[{write:addressOrder}]" size="50" value="{write:orderAddressObject->'building'}"
				{if:array_key_exists('building',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/>
			{if:array_key_exists('building',columnErrorHash)}
			<br /><span style="color:#ff0000;font-size:x-small;">
			{foreach:columnErrorHash::building error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	<tr>
		<th>お電話番号<span class="required">*</span></th>
		<td>
			<input type="text" id="address-telephone-number-area-{write:addressOrder}" name="address_telephone_number_area[{write:addressOrder}]" size="5" value="{write:orderAddressObject->'telephone_number_area'}"
				{if:array_key_exists('telephone_number',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/>-<input type="text" id="address-telephone-number-city-{write:addressOrder}" name="address_telephone_number_city[{write:addressOrder}]" size="5" value="{write:orderAddressObject->'telephone_number_city'}"
				{if:array_key_exists('telephone_number',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/>-<input type="text" id="address-telephone-number-local-{write:addressOrder}" name="address_telephone_number_local[{write:addressOrder}]" size="5" value="{write:orderAddressObject->'telephone_number_local'}"
				{if:array_key_exists('telephone_number',columnErrorHash)} style="background-color:#ffa0a0;"{/if}
			/>
			{if:array_key_exists('telephone_number',columnErrorHash)}
			<br /><span style="color:#ff0000;font-size:x-small;">
			{foreach:columnErrorHash::telephone_number error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	{if:strlen(shopping.order.deliveryWishfulDayStart)>0 && strlen(shopping.order.deliveryWishfulDayEnd)>0}
	<tr>
		<th>お届け希望日</th>
		<td>
			<select name="wishful_date[{write:addressOrder}]"{if:array_key_exists('wishful_date',orderAddressObject->'columnErrorHash')} style="background-color:#ffa0a0;"{/if}>
				<option value="指定なし"{if:array_key_exists('wishful_date',orderAddressObject->'columnErrorHash')} style="background-color:#ffa0a0;"{/if}>-- 指定なし --</option>
				<?php for( $i=$GLOBALS['shopping.order.deliveryWishfulDayStart']; $i<=$GLOBALS['shopping.order.deliveryWishfulDayEnd'];$i++){ $targetDate=date('Y年m月d日',strtotime($i.' day')); $request_object->setAttribute('target_date',$targetDate); ?>
					<option value="{write:target_date}"
						{if:orderAddressObject->'wishful_date'==target_date} selected{/if}
						{if:array_key_exists('wishful_date',orderAddressObject->'columnErrorHash')} style="background-color:#ffa0a0;"{/if}
						>{write:target_date}</option>
				<?php } ?>
			</select>
			{if:array_key_exists('wishful_date',columnErrorHash)}
			<div style="color:#ff0000;">{foreach:columnErrorHash::wishful_date error}{write:error}<br />{/foreach}</div>
			{/if}
		</td>
	</tr>
	{/if}
	{if:count(shopping.order.wishfulTimeArray)>0}
	<tr>
		<th>お届け希望時間帯</th>
		<td>
			<select name="wishful_time[{write:addressOrder}]"{if:array_key_exists('wishful_time',orderAddressObject->'columnErrorHash')} style="background-color:#ffa0a0;"{/if}>
				<option value="指定なし"{if:array_key_exists('wishful_time',orderAddressObject->'columnErrorHash')} style="background-color:#ffa0a0;"{/if}>-- 指定なし --</option>
				{foreach:shopping.order.wishfulTimeArray timeString}
				<option value="{write:timeString}"
					{if:orderAddressObject->'wishful_time'==timeString} selected{/if}
					{if:array_key_exists('wishful_time',orderAddressObject->'columnErrorHash')} style="background-color:#ffa0a0;"{/if}
					>{write:timeString}</option>
				{/foreach}
			</select>
			{if:array_key_exists('wishful_time',columnErrorHash)}
			<div style="color:#ff0000;">{foreach:columnErrorHash::wishful_time error}{write:error}<br />{/foreach}</div>
			{/if}
		</td>
	</tr>
	{/if}
	{if:count(shopping.order.deliveryRappingHash)>0}
	<tr>
		<th>包装</th>
		<td style="padding:5px;{if:array_key_exists('wrapping_type',orderAddressObject->'columnErrorHash')}background-color:#ffa0a0;{/if}">
			{foreach:shopping.order.deliveryRappingHash wrappingNumber wrappingInfo}
			{set:wrappingName wrappingInfo['name']}
			{if:wrappingName=='その他'}
				<br />
				<span style="white-space:nowrap;">
				<input type="radio" name="wrapping_type[{write:addressOrder}]" id="wrapping_type_{write:wrappingNumber}" value="{write:wrappingNumber}"{if:orderAddressObject->'wrapping_type'==wrappingNumber} checked{/if} />
				<label for="wrapping_type_{write:wrappingNumber}" style="cursor:pointer;">{write:wrappingName}</label>
				<input type="text" name="wrapping_words1[{write:addressOrder}]" size="30" value="{write:orderAddressObject->'wrapping_words1'}" />（全角）
				</span><br />
			{else}
				<span style="white-space:nowrap;">
				<input type="radio" name="wrapping_type[{write:addressOrder}]" id="wrapping_type_{write:wrappingNumber}" value="{write:wrappingNumber}"{if:orderAddressObject->'wrapping_type'==wrappingNumber} checked{/if} />
				<label for="wrapping_type_{write:wrappingNumber}" style="cursor:pointer;">{write:wrappingName}</label>
				</span>
			{/if}
			{/foreach}
			{if:array_key_exists('wrapping_type',columnErrorHash)}
			<br /><span style="color:#ff0000;">
			{foreach:columnErrorHash::wrapping_type error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	{if:shopping.order.viewWrappingFreeWord2}
	<tr>
		<th>包装の追加文言</th>
		<td style="padding:5px;">
			<input type="text" name="wrapping_words2[{write:addressOrder}]" size="30" value="{write:orderAddressObject->'wrapping_words2'}"
			{if:array_key_exists('wrapping_words2',orderAddressObject->'columnErrorHash')} style="background-color:#ffa0a0;"{/if} />（全角）
			{if:array_key_exists('wrapping_words2',columnErrorHash)}
			<br /><span style="color:#ff0000;">
			{foreach:columnErrorHash::wrapping_words2 error}{write:error}<br />{/foreach}</span>
			{/if}
		</td>
	</tr>
	{/if}
	{/if}
	<tr>
		<th>伝票番号</th>
		<td style="padding:5px;">
			{if:array_key_exists('delivery_code',columnErrorHash)}
			<span style="color:#ff0000;">
			{foreach:columnErrorHash::delivery_code error}{write:error}<br />{/foreach}</span>
			{/if}
			<textarea name="delivery_code[{write:addressOrder}]" cols="20" rows="3"
				{if:array_key_exists('delivery_code',orderAddressObject->'columnErrorHash')} style="background-color:#ffa0a0;"{/if}
				>{write:orderAddressObject->'delivery_code'}</textarea>
		</td>
	</tr>
	</tbody>
	</table><br />
	{/foreach}
	{/if}