<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>KGCMS企业应用管理平台 - Powered by KGCMS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<!-- <meta http-equiv="cache-control" content="no-siteapp" /> -->
<link rel="stylesheet" href="{{ kg['tpl_url'] }}style/ad_manage.css">
<script src="{{ kg['tpl_url'] }}script/jquery.min.js"></script>
<script src="{{ kg['server']['HTTP_HOST'] }}/tools/amazeui/js/amazeui.min.js"></script>
<script src="{{kg['tpl_url']}}script/common.js"></script>
<script src="{{kg['tpl_url']}}script/ad_manage.js"></script>
</head>
<body data-type="generalComponents" style="overflow-y: hidden;">
	{% include 'component_header.tpl' %}
	<div class="tpl-page-container tpl-page-header-fixed">
		<div class="scrollbar-wrap">
		{% include 'component_left.tpl' %}
		<div class="tpl-content-wrapper">
			<div class="tpl-content-page-title">
				广告管理
			</div>
			<ol class="am-breadcrumb">
				<li><a href="./" class="am-icon-home">首页</a></li>
				<li class="am-active">广告管理</li>
			</ol>
			<div class="tpl-portlet-components">
				<div class="portlet-title">
					<div class="caption font-green bold"><span class="am-icon-code"></span>&nbsp;广告管理</div>
					<div class="tpl-portlet-input tpl-fz-ml am-no-margintop ">
						<div class="portlet-input input-small input-inline">
							<div class="input-icon right am-fr">
								<div class="am-btn-group am-btn-group-xs">
									<a class="am-btn am-btn-default am-btn-success am-edit am-btn-xs am-btn-add" href="ad_update">
										<span class="am-icon-plus"></span>&nbsp;添加广告
									</a>
								</div>
							</div>
							<div class="am-cf"></div>
						</div>
					</div>
				</div>
				<div class="am-g">
					<div class="am-u-sm-12 ngALL-AFenyeFu-marginT ngco-No-paddingR">
						<form class="am-form">
							<table class="am-table am-table-striped am-table-hover table-main ngco-Esz-mgibdr">
								<thead>
									<tr>
										<th class="id">ID</th>
										<th class="table-title">广告识别码</th>
										<th class="table-title">广告名称</th>
										<th class="table-title">广告点击数</th>
										<th class="table-title">状态</th>
										<th class="table-title">是否启用广告</th>
										<th class="table-set">操作</th>
									</tr>
								</thead>

								<tbody>
									{%- for row in list %}
									<tr>
										<td>{{row['id']}}</td>
										<td>{{row['aid']}}</td>
										<td>{{row['title']}}</td>
										<td>{{row['click']}}</td>
										<td>{% if row['expir'] %}{{row['status']}}{% else %}永不过期{% endif %}</td>
										<td>
											<div class="tpl-switch">
												<a href="ad_manage?action={% if row['enable'] %}unenable{% else %}enable{% endif %}&id={{row['id']}}">
													<input name="is_default" {% if row['enable'] %}checked="checked"{% endif %}  id="default{{loop.index}}" type="checkbox" class="ios-switch bigswitch tpl-switch-btn input_Nstyle">
													<div class="tpl-switch-btn-view title title3div" title="已经启用，点击取消启用">
														<div></div>
													</div>
												</a>
											</div>
										</td>
										<td>
											<div class="am-btn-toolbar">
												<div class="am-btn-group am-btn-group-xs">
													<a href="ad_update?ad_id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-default am-hide-sm-only title2div" title="编辑广告">
														<span class="am-icon-pencil-square-o"></span>&nbsp;编辑
													</a>
													<a href="ad_manage?action=del&id={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-danger ngro-Jclick-shanchubi title2div" title="删除广告">
														<span class="am-icon-trash-o"></span>&nbsp;删除
													</a>
												</div>
											</div>
										</td>
									</tr>
									{%- endfor %}
								</tbody>
							</table>
							{%- if not list %}<div class="no-data"><ul>没有相关数据</ul></div>
								{%- endif %}
							{% if page_data['total_page'] > 1 %}
							{{ pagehtml }}
							{% endif %}
						</form>
					</div>
				</div>
			</div>
			{% include 'component_footer.tpl' %}
		</div>
		</div><!-- /.scrollbar-wrap -->
	</div>
	<script>
		kg.title2div('title2div');	 //调用此方法， 把该元素的title属性替换成div
	</script>
</body>
</html>