


<div class="container" style="padding-top:42px;">
	<div class="row">
		<div class="span12">
			<div class="page-header">
				<h1><i class="icon-cogs"></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>
					</div>
				</h1>
			</div>
			<div class="row">
				<div class="span3">
					<ul class="nav nav-tabs nav-stacked">
						<li>
							<a href="<?php echo base_url('index.php/emailsystem/settingGen'); ?>"><i class="icon-wrench"></i> 常规</a>
						</li>
						<!--
						<li><a href="/"><i class="icon-th-large"></i> 分组</a></li>
						<li><a href="/"><i class="icon-user"></i> 用户</a></li>-->
						<li class="active"><a href="<?php echo base_url('index.php/emailsystem/settingTemp'); ?>"><i class="icon-file"></i> 模板</a></li>
					</ul>
				</div>
				<div class="span9 settings">
					<div id="form-content" style="display: none;">
						<form class="form-horizontal" enctype="multipart/form-data" method="post" action="<?php echo base_url('index.php/emailsystem/settingTemp_pro'); ?>">
							<h4>添加一个新邮件模版</h4>
							<div class="control-group">
									<label class="control-label" for="name">模版名 </label>
									<div class="controls">
                						<input type="text" name="name" id="name" class="input-xlarge">
              						</div>
              						<div class="control-group">
										<label for="templ" class="control-label">上传模版文件(html)</label>
											<div class="controls">
												<input type="file" name="temp" id="temp" class="input-xlarge">
											</div>
									</div>
									<div class="form-actions">
										<button class="btn btn-primary" type="submit">创建</button>
									</div>
							</div>
						</form>
					</div>
					
					<table class="table table-bordered table-striped">
						<thead>
							<tr>
								<th class="span1">#</th>
								<th class="span1">浏览</th>
								<th>模版名</th>
								<th class="span2">操作</th>
							</tr>
						</thead>
						<tbody>
							<?php
								foreach($temp as $key=>$value){
							?>
							<tr>
								<td><?php echo $value->id; ?></td>
								<td><a class="btn btn-primary icon-eye-open" href="<?php echo base_url('index.php/emailsystem/settingTemp_view/'.$value->id); ?>"></a></td>
								<td><?php echo $value->tempname; ?></td>
								<td>
									<div class="btn-group">
                  						<a href="#" data-toggle="dropdown" class="btn btn-primary dropdown-toggle">操作<span class="caret"></span></a>
                  							<ul class="dropdown-menu">
                  	                    		<!-- dropdown menu links -->
                    							<li><a title="Edit" href="<?php echo base_url('index.php/emailsystem/settingTemp_edit/'.$value->id); ?>"><i class="icon-pencil"></i> 编辑</a></li>
                                                <li class="divider"></li>
                   								<li><a onclick="return confirm('你确定要删除这个模版?');" href="<?php echo base_url('index.php/emailsystem/settingTemp_del/'.$value->id); ?>"><i class="icon-remove-sign"></i> 删除</a></li>
                                      		</ul>
                                      	</a>
                					</div>
								</td>
							</tr>
							<?php
								}
							?>
					</tbody>
					</table>
					<div style="clear:both;"></div>
					<div class="pagination pagination-centered">
						<?php if(isset($this->pagination)){$this->pagination->show();} ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	$('#form').click(function() {
					$('#form-content').slideToggle('fast');
					return false;
	});	
</script>
</body>
</html>

