<{include file="file:admin_header.html"}>
<script type="text/javascript" charset="utf-8">
<{if $mode == 2}>
jQuery(function(){
  jQuery('#<{$dirname}>_policy_itemsort_editform :selected').attr('disabled', 'disabled');
});
<{/if}>
</script>
<form name="<{$dirname}>_policy_itemsort_editform" id="<{$dirname}>_policy_itemsort_editform" action="policy_itemsort.php?op=save" method="post">
<input type="hidden" name="op" value="">
<{$token_ticket}>
<table width="100%" cellspacing="1">
<tr><td>
<label for="itemsort_title"><{$smarty.const._AM_XOONIPS_POLICY_ITEMSORT_ITEM}></label>&nbsp
<input type="text" id="itemsort_title" name="itemsort_title" style="width:400px" value="<{$itemsort_sort.0.title}>" maxlength="50"/>
<input type="hidden" id="sort_id" name="sort_id" value="<{$itemsort_sort.0.sort_id}>" />
</td></tr>
</table>
<br />
<table width="100%" cellspacing="1" class="outer">
<tbody>
	<tr>
		<th style="width:30%; text-align:center;"><{$smarty.const._AM_XOONIPS_POLICY_ITEMSORT_ITEMTYPE}></th>
		<th style="width:70%; text-align:center;"><{$smarty.const._AM_XOONIPS_POLICY_ITEMSORT_SORTEDITEM}></th>
	</tr>
	<{foreach item=itemsort_detail_item from=$itemsort_detail_list}>
	<tr class="<{cycle values='odd,even'}>">
		<td style="width:30%; text-align:left;"><{$itemsort_detail_item[0].item_type_name}></td>
		<td style="width:70%; text-align:left;">
			<input type="hidden" id="itemsort_item_type_id" name="itemsort_item_type_id[]" value="<{$itemsort_detail_item[0].item_type_id}>" />
			<select id="itemsort_detail_item" name="itemsort_detail_item[]" style="width:200px">
				<{if $mode == 1}>
					<option value =""></option>
				<{/if}>
				<{foreach item=optiondata from=$itemsort_detail_item}>
				<{if $mode == 1}>
					<option value="<{$optiondata.item_field_detail_id}>" <{if isset($optiondata.selected_item_field_detail_id)}>selected="selected"<{/if}>><{$optiondata.item_type_group_name}>.<{$optiondata.item_type_detail_name}></option>
				<{elseif isset($optiondata.selected_item_field_detail_id)}>
					<option value="<{$optiondata.item_field_detail_id}>" <{if isset($optiondata.selected_item_field_detail_id)}>selected="selected"<{/if}>><{$optiondata.item_type_group_name}>.<{$optiondata.item_type_detail_name}></option>
				<{/if}>
				<{/foreach}>
			</select>
		</td>
	</tr>
	<{/foreach}>
	<{if count($itemsort_detail_list) == 0}>
	<tr><td class="odd" colspan="2" style="text-align: center;"><span style="color: red; font-weight: bold;"><{$smarty.const._AM_XOONIPS_POLICY_ITEMSORT_LIST_EMPTY}></span></td></tr>
	<{/if}>
</tbody>
</table>
<div style="text-align:center; margin-bottom: 15px;">
	<{if $mode == 1}>
		<input class="formButton" type="button" value="<{$smarty.const._AM_XOONIPS_LABEL_SAVE}>" onclick="this.form.op.value='save'; submit();"  />&nbsp;
	<{elseif $mode == 2}>
	 	<input class="formButton" type="button" value="<{$smarty.const._AM_XOONIPS_LABEL_DELETE}>" onclick="this.form.op.value='delete'; submit();"  />
	<{/if}>
</div>
</form>
<{include file="file:admin_footer.html"}>
