friendlylink_list.html 3.77 KB
<% 
	var headContent = {
	include("/pages/template/head.html"){}
%>

<script type="text/javascript">
var oper;
jQuery(function($) {
	// 页面方法
	oper = {
		width : 400,
		height : 480,
		form : document.form1,
		list : function() {
			var url = 'admin/friendlylink/list';
			this.form.action = url;
			this.form.submit();
		},
		view : function(id) {
			var url = 'admin/friendlylink/view/'+id;
			var title = '查看友情链接';
			Iframe(url, this.width, this.height, title, false, false, false, EmptyFunc);
		},
		add : function() {
			var url = 'admin/friendlylink/add';
			var title = '添加友情链接';
			Iframe(url, this.width, this.height, title);
		},
		edit : function(id) {
			var url = 'admin/friendlylink/edit/'+id;
			var title = '修改友情链接';
			Iframe(url, this.width, this.height, title);
		},
		del : function(id) {
			var url = 'admin/friendlylink/delete/'+id;
			var title = '确认要删除该友情链接信息?';
			Confirm(title, function() {
				form1.action = url;
				form1.submit();
			});
		}
	};
	//显示Menu索引
	showMenu('page_friendlylink');
});

//分页
var paginator = function(page) {
	oper.list();
};

</script>

<%
};

var bodyContent = {
%>
	<form name="form1" action="" method="post"  class="form-inline" role="form">
		<!-- 菜单 -->
		<% include("/pages/template/menu.html"){} %>

		<div class="tableSearch">
			<%  //查询列表 %>
						<div class="form-group">
					<input class="form-control" type="text" name="attr.name" value="${attr.name!''}" 
						placeholder="请输入名称"  />
			</div>
			
			<button type="button" class="btn btn-default" onclick="oper.list();" name="search">
			 		<span class="glyphicon glyphicon-search"></span> 查 询
			</button>
			<button type="button" class="btn btn-default" onclick="resetForm();">
			 		<span class="glyphicon glyphicon-refresh"></span> 重 置
			</button>
			<button type="button" class="btn btn-default" onclick="oper.add();">
			 		<span class="glyphicon glyphicon-plus"></span> 新 增
			</button>
		</div>
		
		<!-- 数据列表 -->
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>序号</th>
					<%  // 列表头部 %>
					<th name="name" class="sorting">名称</th> 
					<th name="url" class="sorting">URL</th> 
					<th name="type" class="sorting">类型</th>
					<th name="sort" class="sorting">排序号</th> 
					<th name="state" class="sorting">是否显示</th> 
					<th>站点</th> 
					<th>备注</th> 
 					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			<% for(item in page.list){ %>
				<tr>
				<td>${itemLP.index }</td>
				<%  // 列表内容 %>
					<td>${item.name}</td> 
				<td title="${item.url}">
				<% if (strutil.length(item.url) > 20) { %>
					${strutil.subStringTo(item.url, 0, 20)}...
				<% 	} else { %>
					${item.url}
				<%  } %>
				</td> 
				<td>${flyfox.dictValue(item.type!'' )  }</td>
				<td>${item.sort}</td> 
				<td>
				<% if(item.state==1) { %>
				显示
				<%	} %>
				<% if(item.state==2) { %>
				不显示
				<%	} %>
				</td>  
				<td>${item.siteName!'全部'}</td>
				<td title="${item.remark}">
				<% if (strutil.length(item.remark) > 6) { %>
					${strutil.subStringTo(item.remark, 0, 6)}...
				<% 	} else { %>
					${item.remark}
				<%  } %>
				</td> 
				<td>
				<a href="javascript:void(0);" class="btn btn-sm btn-success" onclick="oper.view(${item.id});">查看</a> 
				<a href="javascript:void(0);" class="btn btn-sm btn-primary" onclick="oper.edit(${item.id});">修改</a> 
				<a href="javascript:void(0);" class="btn btn-sm btn-danger" onclick="oper.del(${item.id});">删除</a>
				</td>
				</tr>
			<% } %>
			</tbody>
		</table>
		<%include("/pages/includes/paginator.html"){} %>
	</form>
<%}; %>


<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>