{include file="$admin_template_path/html/header.html"}
</head>
<body>
{include file="$admin_template_path/html/pagetops.html"}
{if $errorMessage}
<div id="errormsg">
<div class="msg">
  <div class="closebtn"><i data-icon="" class="icon-close"></i></div>
  {$errorMessage}
</div>
</div>
{literal}
<script type="text/javascript">
seajs.use(["modules/pageui/msg"], function(msg){
    msg.msginit("#errormsg");
});
</script>
{/literal}
{/if}

<div class="pagebg">
	<div class="mcontent pagemain clr">
	    {include file="$admin_template_path/html/leftmenu.html"}
	    <div class="pagemainconent headtools{if $paging !=""} paging{/if}">

		<div class="headtool b-b clr">
			<div class="toolbtns clr">
				<button class="btns btntheme btnsize" onclick="window.location='?m={$smarty.get.m}&c=add';" type="button"><i class="fa fa-plus"></i> {$lang.add_new}</button>
			</div>
		</div>
		{if $paging !=""}
		<div class="page-controls">
			{$paging}
		</div>
		{/if}
		<div class="rightdetail_admin">
			{if is_array($data)}
			<div class="general_table_border">
				<table id="attributelist" class="general_table" cellspacing="0" cellpadding="0" border="0">
					<thead>
						<tr>
							<th>名称</th>
							<th>类型</th>
							<th width="150">可见</th>
							<th width="150">排序</th>
							<th width="250">操作</th>
						</tr>
					</thead>
					<tbody>
						{foreach from=$data item=d}
						<tr id="row{$d.id}" class="{cycle values="no,alt"}">
							<td>{$d.name}</td>
							<td>
							{if $d.type == 'select'}
							单选列表
							{elseif $d.type == 'multiple'}
							多选列表（不建议）
							{elseif $d.type == 'check'}
							多选框
							{elseif $d.type == 'radio'}
							单选钮
							{else}
							手动输入
							{/if}
							</td>
							<td>
							{if $d.visible == 'true'}
							<img src="{$template_data}/admin/images/icons/24x24/accept.png" alt="" class="middle" />
							{else}
							<img src="{$template_data}/admin/images/icons/24x24/delete.png" alt="" class="middle" />
							{/if}
							</td>
							<td>
							<a href="?m={$smarty.get.m}&c=list&down={$d.id}&p={$smarty.get.p}" title="上"><img class="middle" src="{$template_data}/admin/images/icons/16x16/up.png" /></a>
							<a href="?m={$smarty.get.m}&c=list&up={$d.id}&p={$smarty.get.p}" title="下"><img class="middle" src="{$template_data}/admin/images/icons/16x16/download1.png" /></a>
							</td>
							<td>
							{if $d.type != 'input'}
							<a href="?m={$smarty.get.m}&c=attr&id={$d.id}" title="{$lang.attributes}"><img class="middle" src="{$template_data}/admin/images/icons/16x16/attachment.png" /> 属性</a>
							{/if}
							<a href="?m={$smarty.get.m}&c=edit&id={$d.id}&p={$smarty.get.p}" title="{$lang.edit}"><i class="fa fa-edit text-success m-r-xs"></i> 编辑</a>
							<a class="deletebtn" ajax-url="/apps/{$smarty.get.m}/ajax/delete.php" item-id="{$d.id}" href="javascript:void(0);" title="{$lang.delete}"><i class="fa fa-trash-o text-danger m-r-xs"></i> 删除</a>
							</td>
						</tr>
						{/foreach}
					</tbody>
				</table>
			</div>
			{literal}
			<script type="text/javascript">
			seajs.use(["modules/ajax/btns"], function(aj){
			  aj.deletebtninit("#attributelist .deletebtn", "ajax-url", "item-id", {'delete':true,'id':''}, "deleteRow");
			});
			</script>
			{/literal}
			{else}
			无记录
			{/if}
		</div>

    	</div>
	</div>
</div>
</body>
</html>