Files
orico-official-website-old/app/admin/view/ad/lists.html
2024-10-29 14:04:59 +08:00

137 lines
7.4 KiB
HTML
Executable File

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
广告管理
<small>广告列表</small>
</h1>
<ol class="breadcrumb">
<li><a href="<?php echo url('/admin/index/index');?>"><i class="fa fa-dashboard"></i> 首页</a></li>
<li><a href="<?php echo url('/admin/ad/lists');?>"> 广告</a></li>
<li class="active"> 广告列表</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">广告列表</h3>
<div class="box-tools pull-right">
<div class="input-group input-group-sm">
<input type="text" class="form-control pull-right" id="list-search-in" placeholder="Search Name" value="<?php echo $search['skeyword'];?>">
<div class="input-group-btn">
<button type="button" class="btn btn-default" id="list-search-btn"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body no-padding">
<?php if(!empty($list)):?>
<div class="table-responsive lists-table">
<table class="table table-hover table-bordered">
<tbody>
<tr>
<th width="35rem">&nbsp;</th>
<th width="60rem" class="text-center">ID</th>
<th>广告名称</th>
<th width="135rem" class="text-center">广告标识</th>
<th width="135rem" class="text-center">分类</th>
<th width="75rem" class="text-center">广告排序</th>
<th width="75rem" class="text-center">是否限时</th>
<th width="75rem" class="text-center">结束时间</th>
<th width="135rem">操作</th>
</tr>
<?php foreach($list as $k=>$ad):?>
<tr>
<td class="text-center"><input type="checkbox" name="ids[]" value="<?php echo $ad['id'];?>"></td>
<td class="text-center"><?php echo $ad['id'];?></td>
<td class="text-left">
<a href="<?php echo url('/admin/ad/edit',['id'=>$ad['id']]);?>"><?php echo $ad['name'];?></a>
</td>
<td class="text-center"><?php echo $ad['tags'];?></td>
<td class="text-center">
<?php echo $ad['typename'];?>
</td>
<td class="text-center"><input size="3" maxlength="7" value="<?php echo $ad['sort'];?>" type="text" data-id="<?php echo $ad['id'];?>" data-url="<?php echo url('/admin/ad/updatesort');?>" data-cod="sort"></td>
<td class="text-center">
<?php if ($ad['timeset'] == 0) {echo '不限时间';} else {echo '限定时间';}?>
</td>
<td class="text-center"><?php echo date('Y-m-d',$ad['endtime']);?></td>
<td>
<a class="btn btn-xs btn-info" data-id="<?php echo $ad['id'];?>" data-url="<?php echo url('/admin/ad/preview');?>" data-cod="preview-ad">预览</a>
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/ad/edit',['id'=>$ad['id']]);?>">编辑</a>
<a class="btn btn-xs btn-info" data-id="<?php echo $ad['id'];?>" data-url="<?php echo url('/admin/ad/delete');?>" data-cod="dowarn">删除</a>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<!-- /.table -->
</div>
<?php endif;?>
<!-- /.lists-table -->
</div>
<!-- /.box-body -->
<div class="box-footer no-padding">
<div class="mailbox-controls row">
<div class="col-sm-6">
<button type="button" class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></button>
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm" data-url="<?php echo url('/admin/ad/deletes');?>" data-cod="batch">删除</button>
<button type="button" class="btn btn-default btn-sm" data-url="<?php echo url('/admin/ad/clear_cache');?>" data-cod="clearcache">清除Ad缓存</button>
<button type="button" class="btn btn-default btn-sm" data-cod="refresh">刷新</button>
</div>
<!-- /.btn-group -->
<a href="<?php echo url('/admin/ad/add');?>" class="btn btn-default btn-sm">添加</a>
</div>
<div class="col-sm-6">
<div class="pull-right">
<?php if($page):?>
<?php echo $page;?>
<?php endif;?>
</div>
<!-- /.pull-right -->
</div>
</div>
</div>
</div>
<!-- /.box -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<style>
.table-responsive .table tbody > tr > th,.table-responsive .table thead > tr > td, .table-responsive .table tbody > tr > td {
vertical-align: middle;
}
</style>
<!-- Page Script -->
<script type="text/javascript">
$(function() {
$("[data-cod='preview-ad']").click(function(event) {
event = event ? event : window.event;
var obj = event.srcElement ? event.srcElement : event.target;
var param = {}, url, method;
method = obj.getAttribute('data-method');
param.id = obj.getAttribute('data-id');
url = obj.getAttribute('data-url');
$('#modal-adjs').remove();
$.ajax({
url: url,
data: param,
dataType: "html",
success: function(html) {
$('body').append('<div id="modal-adjs" class="modal fade">' + html + '</div>');
$('#modal-adjs').modal({show: true, backdrop: false, keyboard: false});
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
});
</script>