{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{if $paging !=""} paging{/if}">

		{if $paging !=""}
		<div class="page-controls">
			{$paging}
		</div>
		{/if}

		<div class="rightdetail_admin">
			{if is_array($data)}
			<div class="general_table_border">
				<table id="generlist" class="general_table" cellspacing="0" cellpadding="0" border="0">
					<thead>
						<tr>
							<th>{$lang.name}</th>
							<th>{$lang.email}</th>
							<th width="150">{$lang.unsubscribe}</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.subname}</td>
							<td>{$d.email}</td>
							<td>
								{if $d.bulletin_subscribe == 'false'}
									<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>
								{if $d.bulletin_subscribe == 'false'}
								<a href="?m={$smarty.get.m}&c=emails&subscribe={$d.id}" title="{$lang.subscribe}"><i class="fa fa-edit text-success m-r-xs"></i> {$lang.subscribe}</a>
								{else}
								<a href="?m={$smarty.get.m}&c=emails&unsubscribe={$d.id}" title="{$lang.unsubscribe2}"><i class="fa fa-edit text-success m-r-xs"></i> {$lang.unsubscribe2}</a>
								{/if}
								<a class="deletebtn" ajax-url="{$root_server}/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> {$lang.delete}</a>
							</td>
						</tr>
						{/foreach}
					</tbody>
				</table>
			</div>
			{literal}
			<script type="text/javascript">
			seajs.use(["modules/ajax/btns"], function(aj){
			  aj.deletebtninit("#generlist .deletebtn", "ajax-url", "item-id", {'deleteSEmail':true,'id':''}, "deleteRow");
			});
			</script>
			{/literal}
			{else}
			{$lang.no_records}
			{/if}
		</div>

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