<?php 
	$this->display(tpl('head',true));
?>
<style>
	.layui-table thead tr th{
		text-align: center;
	}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  	<legend>短信平台管理</legend>
</fieldset>
<table class="layui-table" cellspacing="0" cellpadding="0" border="0"  lay-filter="demoEvent">
	<thead>
		<tr>
			<th width="100">平台名称</th>
			<th>平台描述</th>
			<th width="100">版本</th>
			<th width="100">状态</th>
			
			<th width="130">操作</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach($data AS $key=>$row) { ?>
		<tr>
			<td align="center"><?php echo $row['name'] ?></td>
			<td><?php echo $row['description'] ?></td>
			<td align="center"><?php echo $row['version'] ?></td>
			<td align="center">
				<?php if( $row['is_default'] ){?>
					<span  class="layui-btn layui-btn-primary layui-btn-sm">已默认</span>
				<?php }else{ ?>
					<a href="<?php echo admin_plugin_url ?>index/setdefault/id_<?php echo $row[id] ?>" class="layui-btn layui-btn-danger layui-btn-sm" >设置为默认</a>
				<?php } ?>
			</td>
			<td align="center">
				<?php if(!$row[is_install]) { ?>
					<a class="layui-btn layui-btn-sm layui-btn-warm" href="<?php echo admin_plugin_url ?>index/install/dir_<?php echo $row[initial_name] ?>">安装</a>
				<?php }else{ ?>
				<a class="layui-btn layui-btn-sm layui-btn-warm" href="<?php echo admin_plugin_url ?>index/edit/id_<?php echo $row[id] ?>">设置</a>
				<a class="layui-btn layui-btn-sm layui-btn-danger" href="<?php echo admin_plugin_url ?>index/uninstall/id_<?php echo $row[id] ?>">卸载</a>
				<?php } ?>
			</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<?php 
	$this->display(tpl('foot',true));
?>
