
<div class="container" style="padding-top:42px;">
	<div class="row">
		<div class="span12">
			<div class="page-header">
				<h1><i class="icon-group"></i>分组<div class="pull-right btn-group"><a id="form" class="btn btn-primary" href="javascript:void(0);"><i class="icon-plus-sign icon-white"></i>添加分组</a></h1>
			</div>
			<div id="form-content" style="display: none;">
				<form class="form-horizontal" method="post" action="<?php echo base_url('index.php/emailsystem/group_add/'); ?>">
					<h4>添加一个新的分组</h4>
					<div class="control-group">
						<label class="control-label" for="name">分组名</label>
						<div class="controls">
							<input id="name" type="text" placeholder="新建分组" value="" name="name">
						</div>
					</div>
					<div class="form-actions">
						<button class="btn btn-primary" type="submit">添加分组</button>
					</div>
				</form>
			</div>
			<table class="table table-bordered table-striped">
				<thead>
					<tr>
						<th class="span1">#</th>
						<th>分组名</th>
						<th class="span2">发件总数</th>
						<th class="span2">操作</th>
					</tr>
				</thead>
				<tbody>
					<?php
						foreach($groups as $key=>$val){
					?>
					<tr>
						<td><?php echo $val->id; ?></td>
						<td><a href="?group_users=<?php echo $val->id; ?>"><?php echo $val->name; ?></a></td>
						<td><label class="center">45</label></td>
						<td>
							<div class="btn-group">
								<a class="btn btn-primary dropdown-toggle" href="javascript:void(0);" data-toggle="dropdown">操作<span class="caret"></span></a>
								<ul class="dropdown-menu">
									<li><a title="Editar" href="<?php echo base_url('index.php/emailsystem/edit_group') ?>/<?php echo $val->id; ?>"><i class="icon-pencil"></i>编辑</a></li>
									<li><a title="Email list" href="?users=all&group=<?php echo $val->id; ?>"><i class="icon-group"></i>邮件列表</a></li>
									<li class="divider"></li>
									<li><a onclick="return confirm('你确定要删除该分组？');" href="<?php echo base_url('index.php/emailsystem/del_group'); ?>/<?php echo $val->id; ?>"><i class="icon-remove-sign"></i>删除</a></li>
								</ul>
							</div>
						</td>
					</tr>
					<?php
						}
					?>
				</tbody>
			</table>
			<div class="pagination pagination-centered">
				<?php if(isset($this->pagination)){$this->pagination->show();} ?>
			</div>
			
			</div>
		</div>
	</div>
</div>
<script>
	$(function(){
		$('#form').click(function() {
			$('#form-content').slideToggle('fast');
			return false;
		});	
	});
	
</script>



</body>
</html>

