<!doctype html>
<html dir="{-:*_LD_-}">
<head>
<meta charset="utf-8" />
<title>{-:@MANAGE-}</title>
{-include:../meta-}
<script>
var GV = {
	_LD_ : '{-:*_LD_-}',
	LANG_NAME : '{-:*LANG_NAME-}'
};
</script>
</head>

<body>
<div class="container margin">

<form id="formSearch" action="" method="post">
<div class="alert">
	<label><select name="as_alias" class="control-input input-inline">
		<option value="0">{-:@AD_SPACE-}</option>
	{-foreach:$_ASL,$as-}
		<option value="{-:$as['as_alias']-}"{-if:$as['as_alias']==ARequest::get('as_alias')-} selected="selected"{-:/if-}>{-:$as['as_name']-}</option>
	{-:/foreach-}
	</select></label>
	<label><span class="btn submit" action="{-url:admin@ad/list_ad-}" to="#formSearch">{-:@SEARCH-}</span></label>
	<label><span class="btn submit" action="{-url:admin@ad/add_ad-}" to="#formSearch">{-:@ADD_AD-}</span></label>
</div><!--/.mainFilter-->
</form>

<form id="formList" action="" method="post">
<ul class="subnav subnav-tab">
	<li class="active"><a href="#">{-:@AD_LIST-}</a></li>
</ul>
<div id="tabContent">
	{-if:empty($_AL)-}
		<div class="placeholder text-center margin">{-:@LIST_EMPTY-}</div>
	{-else:-}
		<table class="table table-hover">
			<tr>
				<th scope="col" width="18"><input type="checkbox" class="select_all" to="ad_id"></th>
				<th scope="col" width="70">{-:@DISPLAY_ORDER-}</th>
				<th scope="col">{-:@NAME-}</th>
				<th scope="col">{-:@AD_SPACE-}</th>
				<th scope="col">{-:@TIME_LIMIT-}</th>
				<th scope="col">{-:@MANAGE-}</th>
			</tr>
			{-foreach:$_AL,$a-}
			<tr>
				<td><input type="checkbox" name="ad_id[{-:$a['ad_id']-}]" value="{-:$a['ad_id']-}"></td>
				<td><input type="text" name="a_display_order[{-:$a['ad_id']-}]" validate="/\S+/" value="{-:$a['a_display_order']-}" class="control-input input-inline input-sm" size="4" maxlength="5"></td>
				<td>{-:$a['a_name']-}</td>
				<td>{-:$a['as_name']-}</td>
				<td>
				{-if:0 == $a['a_time_limit']-}
					{-:@NOT_LIMIT-}
				{-elseif:1 == $a['a_time_limit']-}
					{-:$a['a_start_time']|date~C('APP.TIME_FORMAT'),@me-} ~ {-:$a['a_end_time']|date~C('APP.TIME_FORMAT'),@me-}
				{-:/if-}
				</td>
				<td><a href="{-url:admin@ad/edit_ad?ad_id={$a['ad_id']}-}">{-:@EDIT-}</a> | <a href="{-url:admin@ad/delete_ad_do?ad_id={$a['ad_id']}&timeKey={$_TK['timeKey']}&token={$_TK['token']}-}" class="delete_confirm">{-:@DELETE-}</a></td>
			</tr>
			{-:/foreach-}
		</table>
	{-:/if-}
</div>
<div id="operation" class="margin">
	<input name="timeKey" type="hidden" value="{-:$_TK['timeKey']-}">
	<input name="token" type="hidden" value="{-:$_TK['token']-}">
	<span class="btn submit" action="{-url:admin@ad/update_ad_do-}" to="#formList">{-:@UPDATE_SELECTED-}</span>
	<span class="btn submit" action="{-url:admin@ad/delete_ad_do-}" to="#formList">{-:@DELETE_SELECTED-}</span>
	<input class="btn" type="reset" value="{-:@RESET-}">
	<a class="btn" href="{-url:admin@ad_space/list_space-}">{-:@AD_SPACE_LIST-}</a>
</div><!--/#operation-->
</form>

</div>
<script src="{-:*__RES__-}js/loga.js"></script>
<script src="{-:*__RES__-}js/jquery.js"></script>
<script src="{-:*__RES__-}fea/js/fea.min.js"></script>
<script src="{-:*__STYLE__-}js/common.js"></script>
<script src="{-:*__STYLE__-}js/admin.js"></script>
<script src="{-:*__STYLE__-}js/ad.js"></script>
</body>
</html>