init
This commit is contained in:
368
app/admin/view/download_category/add.html
Executable file
368
app/admin/view/download_category/add.html
Executable file
@@ -0,0 +1,368 @@
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
新增下载分类
|
||||
</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/download_category/lists');?>"> 分类列表</a></li>
|
||||
<li class="active"> 分类</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<form class="form-horizontal" action="<?php echo url('/admin/download_category/create');?>" method="post">
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#navfirst" data-toggle="tab"><i class="fa fa-edit text-green"></i> 基本信息</a></li>
|
||||
<!-- <li><a href="#navsecond" data-toggle="tab">详细内容</a></li> -->
|
||||
<li><a href="#navthird" data-toggle="tab">图片信息</a></li>
|
||||
<li><a href="#navfourth" data-toggle="tab">SEO设置</a></li>
|
||||
<!-- <li><a href="#navfifth" data-toggle="tab">高级选项</a></li> -->
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="active tab-pane" id="navfirst">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">分类名称<em style="color:red;">*</em></label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="name" id="name" required>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(分类名称)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pid" class="col-sm-2 control-label">所属分类<em style="color:red;">*</em></label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control" name="pid" id="pid">
|
||||
<option value="0" selected="">默认值</option>
|
||||
<?php echo $categoryOptions;?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(所属分类)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="sort" class="col-sm-2 control-label">分类排序<em style="color:red;">*</em></label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" name="sort" id="sort" value="9999">
|
||||
</div>
|
||||
<div class="col-sm-5 col-sm-offset-3">
|
||||
<span class="help-block">(分类排序)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="isshow" class="col-sm-2 control-label">是否显示</label>
|
||||
<div class="col-sm-5">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isshow" value="1" checked> 是
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isshow" value="0"> 否
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(是否显示)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="recommend" class="col-sm-2 control-label">是否推荐</label>
|
||||
<div class="col-sm-5">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="recommend" value="1"> 是
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="recommend" value="0" checked> 否
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(是否推荐)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description" class="col-sm-2 control-label">分类描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="description" name="description"></textarea>
|
||||
</div>
|
||||
<div class="col-sm-10 col-sm-offset-2">
|
||||
<span class="help-block">(分类描述)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
|
||||
<div class="tab-pane" id="navsecond">
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">内容详情
|
||||
<small>放置主要内容</small>
|
||||
</h3>
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-info" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
||||
<i class="fa fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-info" data-widget="remove" data-toggle="tooltip" title="Remove">
|
||||
<i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
<!-- /.tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<textarea id="content" style="width: 100%;height:500px;" name="content" rows="10" cols="80" placeholder="请输入内容..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="navthird">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">分类图片</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-left">
|
||||
<a href="javascript:void(0);" id="download-category-image" data-toggle="image" class="img-thumbnail"><img class="img-responsive" src="/uploads/nopic.jpg"/></a>
|
||||
<input type="hidden" name="picture" value="/uploads/nopic.jpg" id="input-image" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-sm-5">
|
||||
<span class="help-block">(主要图片)</span>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="navfourth">
|
||||
<div class="form-group">
|
||||
<label for="seo_title" class="col-sm-2 control-label">SEO标题</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="seo_title">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(SEO标题)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seo_keyword" class="col-sm-2 control-label">SEO关键词</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="seo_keyword">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(SEO关键词)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seo_description" class="col-sm-2 control-label">SEO描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="seo_description" name="seo_description"></textarea>
|
||||
</div>
|
||||
<div class="col-sm-10 col-sm-offset-2">
|
||||
<span class="help-block">(SEO描述)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="navfifth">
|
||||
<?php if($administrator):?>
|
||||
<div class="form-group">
|
||||
<label for="tempindex" class="col-sm-2 control-label">封面页模板</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><a href="javascript:void(0);"><i class="fa fa-fw fa-file"></i></a></span>
|
||||
<input type="text" class="form-control" name="tempindex" id="tempindex">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" data-cod="tempindex">模板</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(封面页模板)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="templist" class="col-sm-2 control-label">列表页模板</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><a href="javascript:void(0);"><i class="fa fa-fw fa-file"></i></a></span>
|
||||
<input type="text" class="form-control" name="templist" id="templist">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" data-cod="templist">模板</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(列表页模板)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tempdetail" class="col-sm-2 control-label">内容页模板</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><a href="javascript:void(0);"><i class="fa fa-fw fa-file"></i></a></span>
|
||||
<input type="text" class="form-control" name="tempdetail" id="tempdetail">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" data-cod="tempdetail">模板</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(内容页模板)</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="form-group">
|
||||
<label for="classtype" class="col-sm-2 control-label">栏目类型</label>
|
||||
<div class="col-sm-5">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="classtype" value="1"> 封面
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="classtype" value="2" checked> 列表
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="classtype" value="3"> 外部链接
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(栏目属性)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url" class="col-sm-2 control-label">链接地址</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="url" id="url-input">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" id="url-btn"><i class="fa fa-globe"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(链接地址)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<!-- /.tab-content -->
|
||||
<div class="nav-footer row">
|
||||
<div class="col-sm-2 col-sm-offset-2">
|
||||
<p><button id="reset-btn" type="button" class="btn btn-warning btn-block">重置</button></p>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<p><button id="submit-btn" type="submit" class="btn btn-danger btn-block">提交</button></p>
|
||||
</div>
|
||||
<!-- /. row -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.nav-tabs-custom -->
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">快捷入口</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<a href="<?php echo url('/admin/download/lists');?>" class="btn btn-block btn-primary">下载列表</a>
|
||||
<a href="<?php echo url('/admin/download_category/lists');?>" class="btn btn-block btn-primary">下载分类</a>
|
||||
<a href="<?php echo url('/admin/download_category/add');?>" class="btn btn-block btn-primary">添加分类</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal-url" tabindex="0">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h5 class="modal-title blue">外部链接内容</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe id="urliframe" style="width:100%;height:400px;" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer"></div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<style>
|
||||
.table thead > tr > td, .table tbody > tr > td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<!-- /.content-wrapper -->
|
||||
<?php echo editor('#content');?>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#url-btn").click(function(e) {
|
||||
var urlObj = document.getElementById('url-input');
|
||||
var frameSrc = urlObj.value;
|
||||
if (isUrl(frameSrc)) {
|
||||
$("#urliframe").attr("src", frameSrc);
|
||||
$('#modal-url').modal({show: true, backdrop: 'static'});
|
||||
} else {
|
||||
alert('链接内容有误');
|
||||
urlObj.focus();
|
||||
}
|
||||
|
||||
});
|
||||
$("#reset-btn").click(function(e) {
|
||||
if (confirm('确认重置所有表单项吗?')) {
|
||||
this.form.reset();
|
||||
}
|
||||
});
|
||||
$("form.form-horizontal").submit(function(e) {
|
||||
var nameObj = document.getElementById('name');
|
||||
if (isNull(nameObj.value)) {
|
||||
alert('名称必须填写');
|
||||
nameObj.focus();
|
||||
return false;
|
||||
}
|
||||
var pidObj = document.getElementById('pid');
|
||||
if (isNaN(pidObj.value)) {
|
||||
alert('所属上级值无效');
|
||||
pidObj.focus();
|
||||
return false;
|
||||
}
|
||||
// var agree = $("input[name='agree']", this).prop('checked');
|
||||
// if (agree) {
|
||||
// alert("Submitted");
|
||||
// e.preventDefault();
|
||||
// } else {
|
||||
// e.preventDefault();
|
||||
// alert("请勾选确认");
|
||||
// }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var image_row = "<?php echo '0';?>";
|
||||
function addImage() {
|
||||
html = '<tr id="image-row' + image_row + '">';
|
||||
html += ' <td class="text-left"><a href="" id="thumb-image' + image_row + '"data-toggle="image" class="img-thumbnail"><img class="img-responsive" src="/uploads/nopic.jpg" alt="" title="" data-placeholder="/uploads/nopic.jpg" /></a><input type="hidden" name="product_image[' + image_row + '][image]" value="" id="input-image' + image_row + '" /></td>';
|
||||
html += ' <td class="text-right"><input type="text" name="product_image[' + image_row + '][sort_order]" value="" placeholder="排序" class="form-control" size="2"/></td>';
|
||||
html += ' <td class="text-left"><button type="button" onclick="$(\'#image-row' + image_row + '\').remove();" data-toggle="tooltip" title="删除" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
$('#images tbody').append(html);
|
||||
image_row++;
|
||||
}
|
||||
</script>
|
||||
51
app/admin/view/download_category/childcat.html
Executable file
51
app/admin/view/download_category/childcat.html
Executable file
@@ -0,0 +1,51 @@
|
||||
<?php if(!empty($list)):?>
|
||||
<table class="table table-hover table-bordered margin-bottom-none">
|
||||
<tbody>
|
||||
<?php foreach($list as $k=>$download_category):?>
|
||||
<tr>
|
||||
<td class="tcell1"><input type="checkbox" name="ids[]" value="<?php echo $download_category['id'];?>"></td>
|
||||
<td class="tcell2"><?php echo $download_category['id'];?></td>
|
||||
<td class="tcell3">
|
||||
<?php echo str_repeat('|---', $level); ?> <span class="fa fa-fw fa-plus-square" data-id="<?php echo $download_category['id'];?>" data-level="<?php echo $level;?>" data-cod="getchild"></span> <a href="<?php echo url('/admin/download_category/lists',['pid'=>$download_category['id']]);?>"><?php echo $download_category['name'];?></a>
|
||||
</td>
|
||||
<td class="tcell4"><input size="3" maxlength="7" value="<?php echo $download_category['sort'];?>" type="text" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/updatesort');?>" data-cod="sort"></td>
|
||||
<td class="tcell5">
|
||||
<span class="fa <?php if($download_category['isshow']):?>fa-check<?php else:?>fa-remove<?php endif;?>" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/toggleisshow');?>" data-cod="state"></span>
|
||||
</td>
|
||||
<td class="tcell6">
|
||||
<span class="fa <?php if($download_category['recommend']):?>fa-check<?php else:?>fa-remove<?php endif;?>" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/togglerecommend');?>" data-cod="state"></span>
|
||||
</td>
|
||||
<td class="tcell7"><img src="<?php echo getImage($download_category['picture'],110,110,1,'smallimg');?>" class="img-thumbnail" data-image="<?php echo $download_category['picture'];?>" data-toggle="preview-image"></td>
|
||||
<td class="tcell8">
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download_category/add',['pid'=>$download_category['id']]);?>">添加子分类</a>
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download/add',['cid'=>$download_category['id']]);?>">添加下载</a>
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download_category/edit',['id'=>$download_category['id']]);?>">编辑</a>
|
||||
<a class="btn btn-xs btn-info" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/delete');?>" data-cod="dowarn">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td id="catsun<?php echo $download_category['id'];?>" colspan="8" class="table-responsive no-padding" style="display: none;"></td></tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("[data-cod='sort']", "#catsun<?php echo $pid;?>").keyup(ajaxsort);
|
||||
$("[data-cod='dowarn']", "#catsun<?php echo $pid;?>").click(ajaxdowarn);
|
||||
$("[data-cod='state']", "#catsun<?php echo $pid;?>").click(togglestate);
|
||||
$("[data-cod='getchild']", "#catsun<?php echo $pid;?>").click(ajaxgetchild);
|
||||
$("[data-toggle='preview-image']", "#catsun<?php echo $pid;?>").each(function() {
|
||||
var element = $(this);
|
||||
element.popover({
|
||||
content: function() {
|
||||
return '<img src="' + element.attr('data-image') + '" style="max-width:200px;"/>';
|
||||
},
|
||||
placement: 'auto',
|
||||
trigger: 'click',
|
||||
html: true,
|
||||
container: 'body',
|
||||
delay: {show: 5, hide: 10}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif;?>
|
||||
371
app/admin/view/download_category/edit.html
Executable file
371
app/admin/view/download_category/edit.html
Executable file
@@ -0,0 +1,371 @@
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
编辑下载分类
|
||||
</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/download_category/lists');?>"> 分类列表</a></li>
|
||||
<li class="active"> 分类</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<form class="form-horizontal" action="<?php echo url('/admin/download_category/update');?>" method="post">
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#navfirst" data-toggle="tab"><i class="fa fa-edit text-green"></i> 基本信息</a></li>
|
||||
<!-- <li><a href="#navsecond" data-toggle="tab">详细内容</a></li> -->
|
||||
<li><a href="#navthird" data-toggle="tab">图片信息</a></li>
|
||||
<li><a href="#navfourth" data-toggle="tab">SEO设置</a></li>
|
||||
<!-- <li><a href="#navfifth" data-toggle="tab">高级选项</a></li> -->
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="active tab-pane" id="navfirst">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">分类名称<em style="color:red;">*</em></label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="name" id="name" required value="<?php echo $download_category['name'];?>">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(分类名称)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pid" class="col-sm-2 control-label">所属分类<em style="color:red;">*</em></label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control" name="pid" id="pid">
|
||||
<option value="0">默认值</option>
|
||||
<?php echo $categoryOptions;?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(所属分类)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="sort" class="col-sm-2 control-label">分类排序<em style="color:red;">*</em></label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" class="form-control" name="sort" id="sort" value="<?php echo $download_category['sort'];?>">
|
||||
</div>
|
||||
<div class="col-sm-5 col-sm-offset-3">
|
||||
<span class="help-block">(分类排序)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="isshow" class="col-sm-2 control-label">是否显示</label>
|
||||
<div class="col-sm-5">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isshow" value="1" <?php if($download_category['isshow']):?>checked=""<?php endif;?>/> 显示
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="isshow" value="0" <?php if(!$download_category['isshow']):?>checked=""<?php endif;?>/> 隐藏
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(是否显示)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="recommend" class="col-sm-2 control-label">是否推荐</label>
|
||||
<div class="col-sm-5">
|
||||
<label class="radio-inline">
|
||||
<input name="recommend" type="radio" value="1" <?php if($download_category['recommend']):?>checked=""<?php endif;?>/> 是
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input name="recommend" type="radio" value="0" <?php if(!$download_category['recommend']):?>checked=""<?php endif;?>/> 否
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(是否推荐)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description" class="col-sm-2 control-label">分类描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="description" name="description"><?php echo $download_category['description'];?></textarea>
|
||||
</div>
|
||||
<div class="col-sm-10 col-sm-offset-2">
|
||||
<span class="help-block">(分类描述)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
|
||||
<div class="tab-pane" id="navsecond">
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">内容详情
|
||||
<small>放置主要内容</small>
|
||||
</h3>
|
||||
<!-- tools box -->
|
||||
<div class="pull-right box-tools">
|
||||
<button type="button" class="btn btn-info" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
||||
<i class="fa fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-info" data-widget="remove" data-toggle="tooltip" title="Remove">
|
||||
<i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
<!-- /.tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<textarea id="content" style="width: 100%;height:500px;" name="content" rows="10" cols="80"><?php echo $download_category['content'];?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="navthird">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">分类图片</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-left">
|
||||
<a href="javascript:void(0);" id="download-category-image" data-toggle="image" class="img-thumbnail"><img class="img-responsive" src="<?php echo empty($download_category['picture'])?'/uploads/nopic.jpg':$download_category['picture'];?>" /></a>
|
||||
<input type="hidden" name="picture" value="<?php echo $download_category['picture'];?>" id="input-image" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-sm-5">
|
||||
<span class="help-block">(主要图片)</span>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="navfourth">
|
||||
<div class="form-group">
|
||||
<label for="seo_title" class="col-sm-2 control-label">SEO标题</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="seo_title" value="<?php echo $download_category['seo_title'];?>">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(SEO标题)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seo_keyword" class="col-sm-2 control-label">SEO关键词</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="seo_keyword" value="<?php echo $download_category['seo_keyword'];?>">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(SEO关键词)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seo_description" class="col-sm-2 control-label">SEO描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="seo_description" name="seo_description"><?php echo $download_category['seo_description'];?></textarea>
|
||||
</div>
|
||||
<div class="col-sm-10 col-sm-offset-2">
|
||||
<span class="help-block">(SEO描述)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
<div class="tab-pane" id="navfifth">
|
||||
<?php if($administrator):?>
|
||||
<div class="form-group">
|
||||
<label for="tempindex" class="col-sm-2 control-label">封面页模板</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><a href="javascript:void(0);"><i class="fa fa-fw fa-file"></i></a></span>
|
||||
<input type="text" class="form-control" name="tempindex" id="tempindex" value="<?php echo $download_category['tempindex'];?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" data-cod="tempindex">模板</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(封面页模板)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="templist" class="col-sm-2 control-label">列表页模板</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><a href="javascript:void(0);"><i class="fa fa-fw fa-file"></i></a></span>
|
||||
<input type="text" class="form-control" name="templist" id="templist" value="<?php echo $download_category['templist'];?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" data-cod="templist">模板</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(列表页模板)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tempdetail" class="col-sm-2 control-label">内容页模板</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><a href="javascript:void(0);"><i class="fa fa-fw fa-file"></i></a></span>
|
||||
<input type="text" class="form-control" name="tempdetail" id="tempdetail" value="<?php echo $download_category['tempdetail'];?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" data-cod="tempdetail">模板</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(内容页模板)</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="form-group">
|
||||
<label for="classtype" class="col-sm-2 control-label">栏目类型</label>
|
||||
<div class="col-sm-5">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="classtype" value="1" <?php if($download_category['classtype']==1):?>checked=""<?php endif;?>> 封面
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="classtype" value="2" <?php if($download_category['classtype']==2):?>checked=""<?php endif;?>> 列表
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="classtype" value="3" <?php if($download_category['classtype']==3):?>checked=""<?php endif;?>> 外部链接
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(栏目属性)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url" class="col-sm-2 control-label">链接地址</label>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="url" id="url-input" value="<?php echo $download_category['url'];?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" id="url-btn"><i class="fa fa-globe"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<span class="help-block">(链接地址)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<!-- /.tab-content -->
|
||||
<div class="nav-footer row">
|
||||
<input type="hidden" name="id" value="<?php echo $download_category['id'];?>">
|
||||
<input type="hidden" name="oldpid" value="<?php echo $download_category['pid'];?>">
|
||||
<div class="col-sm-2 col-sm-offset-2">
|
||||
<p><button id="reset-btn" type="button" class="btn btn-warning btn-block">重置</button></p>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<p><button id="submit-btn" type="submit" class="btn btn-danger btn-block">提交</button></p>
|
||||
</div>
|
||||
<!-- /. row -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.nav-tabs-custom -->
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">快捷入口</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<a href="<?php echo url('/admin/download/lists');?>" class="btn btn-block btn-primary">下载列表</a>
|
||||
<a href="<?php echo url('/admin/download_category/lists');?>" class="btn btn-block btn-primary">下载分类</a>
|
||||
<a href="<?php echo url('/admin/download_category/add');?>" class="btn btn-block btn-primary">添加分类</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="modal-url" tabindex="0">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h5 class="modal-title blue">外部链接内容</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe id="urliframe" style="width:100%;height:400px;" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer"></div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<style>
|
||||
.table thead > tr > td, .table tbody > tr > td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<!-- /.content-wrapper -->
|
||||
<?php echo editor('#content');?>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#url-btn").click(function(e) {
|
||||
var urlObj = document.getElementById('url-input');
|
||||
var frameSrc = urlObj.value;
|
||||
if (isUrl(frameSrc)) {
|
||||
$("#urliframe").attr("src", frameSrc);
|
||||
$('#modal-url').modal({show: true, backdrop: 'static'});
|
||||
} else {
|
||||
alert('链接内容有误');
|
||||
urlObj.focus();
|
||||
}
|
||||
|
||||
});
|
||||
$("#reset-btn").click(function(e) {
|
||||
if (confirm('确认重置所有表单项吗?')) {
|
||||
this.form.reset();
|
||||
}
|
||||
});
|
||||
$("form.form-horizontal").submit(function(e) {
|
||||
var nameObj = document.getElementById('name');
|
||||
if (isNull(nameObj.value)) {
|
||||
alert('名称必须填写');
|
||||
nameObj.focus();
|
||||
return false;
|
||||
}
|
||||
var pidObj = document.getElementById('pid');
|
||||
if (isNaN(pidObj.value)) {
|
||||
alert('所属上级值无效');
|
||||
pidObj.focus();
|
||||
return false;
|
||||
}
|
||||
// var agree = $("input[name='agree']", this).prop('checked');
|
||||
// if (agree) {
|
||||
// alert("Submitted");
|
||||
// e.preventDefault();
|
||||
// } else {
|
||||
// e.preventDefault();
|
||||
// alert("请勾选确认");
|
||||
// }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var image_row = "<?php echo '0';?>";
|
||||
function addImage() {
|
||||
html = '<tr id="image-row' + image_row + '">';
|
||||
html += ' <td class="text-left"><a href="" id="thumb-image' + image_row + '"data-toggle="image" class="img-thumbnail"><img class="img-responsive" src="/uploads/nopic.jpg" alt="" title="" data-placeholder="/uploads/nopic.jpg" /></a><input type="hidden" name="product_image[' + image_row + '][image]" value="" id="input-image' + image_row + '" /></td>';
|
||||
html += ' <td class="text-right"><input type="text" name="product_image[' + image_row + '][sort_order]" value="" placeholder="排序" class="form-control" size="2"/></td>';
|
||||
html += ' <td class="text-left"><button type="button" onclick="$(\'#image-row' + image_row + '\').remove();" data-toggle="tooltip" title="删除" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
$('#images tbody').append(html);
|
||||
image_row++;
|
||||
}
|
||||
</script>
|
||||
149
app/admin/view/download_category/listcategory.html
Executable file
149
app/admin/view/download_category/listcategory.html
Executable file
@@ -0,0 +1,149 @@
|
||||
<!-- 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/download_category/lists');?>"> 分类</a></li>
|
||||
<?php if($breadcrumb):foreach($breadcrumb as $k=>$bc):?>
|
||||
<?php if($pid==$bc['id']):?>
|
||||
<li class="active"> <?php echo $bc['name'];?></li>
|
||||
<?php else:?>
|
||||
<li><a href="<?php echo url('/admin/download_category/lists',['pid'=>$bc['id']]);?>"> <?php echo $bc['name'];?></a></li>
|
||||
<?php endif;?>
|
||||
<?php endforeach;endif;?>
|
||||
</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">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
||||
<i class="fa fa-fw fa-minus"></i>
|
||||
</button>
|
||||
</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 class="tcell1"> </th>
|
||||
<th class="tcell2">ID</th>
|
||||
<th class="tcell3">分类名称</th>
|
||||
<th class="tcell4">分类排序</th>
|
||||
<th class="tcell5">是否显示</th>
|
||||
<th class="tcell6">是否推荐</th>
|
||||
<th class="tcell7">图片</th>
|
||||
<th class="tcell8">操作</th>
|
||||
</tr>
|
||||
<?php foreach($list as $k=>$download_category):?>
|
||||
<tr>
|
||||
<td class="tcell1"><input type="checkbox" name="ids[]" value="<?php echo $download_category['id'];?>"></td>
|
||||
<td class="tcell2"><?php echo $download_category['id'];?></td>
|
||||
<td class="tcell3">
|
||||
<span class="fa fa-fw fa-plus-square" data-id="<?php echo $download_category['id'];?>" data-level="<?php echo $level;?>" data-cod="getchild"></span> <a href="<?php echo url('/admin/download_category/lists',['pid'=>$download_category['id']]);?>"><?php echo $download_category['name'];?></a>
|
||||
</td>
|
||||
<td class="tcell4"><input size="3" maxlength="7" value="<?php echo $download_category['sort'];?>" type="text" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/updatesort');?>" data-cod="sort"></td>
|
||||
<td class="tcell5">
|
||||
<span class="fa <?php if($download_category['isshow']):?>fa-check<?php else:?>fa-remove<?php endif;?>" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/toggleisshow');?>" data-cod="state"></span>
|
||||
</td>
|
||||
<td class="tcell6">
|
||||
<span class="fa <?php if($download_category['recommend']):?>fa-check<?php else:?>fa-remove<?php endif;?>" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/togglerecommend');?>" data-cod="state"></span>
|
||||
</td>
|
||||
<td class="tcell7"><img src="<?php echo getImage($download_category['picture'],110,110,1,'smallimg');?>" class="img-thumbnail" data-image="<?php echo $download_category['picture'];?>" data-toggle="preview-image"></td>
|
||||
<td class="tcell8">
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download_category/add',['pid'=>$download_category['id']]);?>">添加子分类</a>
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download/add',['cid'=>$download_category['id']]);?>">添加下载</a>
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download_category/edit',['id'=>$download_category['id']]);?>">编辑</a>
|
||||
<a class="btn btn-xs btn-info" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/delete');?>" data-cod="dowarn">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td id="catsun<?php echo $download_category['id'];?>" colspan="8" class="table-responsive no-padding" style="display: none;"></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">
|
||||
<!-- Check all button -->
|
||||
<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-cod="refresh">刷新</button>
|
||||
</div>
|
||||
<!-- /.btn-group -->
|
||||
<a href="<?php echo url('/admin/download_category/add');?>" class="btn btn-default btn-sm">添加</a>
|
||||
<div class="pull-right">
|
||||
<?php if(0):?>
|
||||
<?php echo $page;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<!-- /.pull-right -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<style>
|
||||
.table-responsive .table .tcell1{width:3.5rem;text-align:center;vertical-align: middle;}
|
||||
.table-responsive .table .tcell2{width:7.5rem;text-align:center;vertical-align: middle;}
|
||||
.table-responsive .table .tcell3{text-align: left;vertical-align: middle;}
|
||||
.table-responsive .table .tcell4{width:7.5rem;text-align:center;vertical-align: middle;}
|
||||
.table-responsive .table .tcell5{width:7.5rem;text-align:center;vertical-align: middle;}
|
||||
.table-responsive .table .tcell6{width:7.5rem;text-align:center;vertical-align: middle;}
|
||||
.table-responsive .table .tcell7{width:6rem;text-align:center;vertical-align: middle;}
|
||||
.table-responsive .table .tcell8{width:16.5rem;text-align:center;vertical-align: middle;}
|
||||
.table thead > tr > td, .table tbody > tr > td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<!-- Page Script -->
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("[data-cod='getchild']").click(ajaxgetchild);
|
||||
});
|
||||
function ajaxgetchild(event) {
|
||||
event = event ? event : window.event;
|
||||
var obj = event.srcElement ? event.srcElement : event.target;
|
||||
var val = (obj.className.match(/fa-plus-square/i)) ? 1 : 0;
|
||||
//var method = obj.getAttribute('data-method');
|
||||
//var url = obj.getAttribute('data-url');
|
||||
var id = obj.getAttribute('data-id');
|
||||
obj.className = val ? 'fa fa-fw fa-minus-square' : 'fa fa-fw fa-plus-square';
|
||||
var childcat = $('#catsun' + id);
|
||||
if (childcat.html().length < 10) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
data: {'pid': id, level: obj.getAttribute("data-level")},
|
||||
url: "<?php echo url('/admin/download_category/childcat');?>",
|
||||
dataType: 'html',
|
||||
success: function(data, status, xhr) {
|
||||
childcat.html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (val) {
|
||||
childcat.css('display', 'table-cell');
|
||||
} else {
|
||||
childcat.css('display', 'none');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
111
app/admin/view/download_category/lists.html
Executable file
111
app/admin/view/download_category/lists.html
Executable file
@@ -0,0 +1,111 @@
|
||||
<!-- 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/download_category/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"> </th>
|
||||
<th width="70rem" class="text-center">ID</th>
|
||||
<th>分类名称</th>
|
||||
<th width="75rem" class="text-center">分类排序</th>
|
||||
<th width="75rem" class="text-center">是否显示</th>
|
||||
<th width="75rem" class="text-center">是否推荐</th>
|
||||
<th width="60rem" class="text-center">图片</th>
|
||||
<th width="165rem">操作</th>
|
||||
</tr>
|
||||
<?php foreach($list as $k=>$download_category):?>
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="ids[]" value="<?php echo $download_category['id'];?>"></td>
|
||||
<td class="text-center"><?php echo $download_category['id'];?></td>
|
||||
<td>
|
||||
<?php if ($download_category['level']) echo str_repeat('|---', $download_category['level']); ?><a href="<?php echo url('/admin/download_category/edit',['id'=>$download_category['id']]);?>"><?php echo $download_category['name'];?></a>
|
||||
</td>
|
||||
<td class="text-center"><input size="3" maxlength="7" value="<?php echo $download_category['sort'];?>" type="text" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/updatesort');?>" data-cod="sort"></td>
|
||||
<td class="text-center">
|
||||
<span class="fa <?php if($download_category['isshow']):?>fa-check<?php else:?>fa-remove<?php endif;?>" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/toggleisshow');?>" data-cod="state"></span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="fa <?php if($download_category['recommend']):?>fa-check<?php else:?>fa-remove<?php endif;?>" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/togglerecommend');?>" data-cod="state"></span>
|
||||
</td>
|
||||
<td><img src="<?php echo getImage($download_category['picture'],110,110,1,'smallimg');?>" class="img-thumbnail" data-image="<?php echo $download_category['picture'];?>" data-toggle="preview-image"></td>
|
||||
<td>
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download_category/add',['pid'=>$download_category['id']]);?>">添加子分类</a>
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download/add',['cid'=>$download_category['id']]);?>">添加下载</a>
|
||||
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/download_category/edit',['id'=>$download_category['id']]);?>">编辑</a>
|
||||
<a class="btn btn-xs btn-info" data-id="<?php echo $download_category['id'];?>" data-url="<?php echo url('/admin/download_category/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">
|
||||
<!-- Check all button -->
|
||||
<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" id="pagerefresh">刷新</button>
|
||||
</div>
|
||||
<!-- /.btn-group -->
|
||||
<a href="<?php echo url('/admin/download_category/add');?>" class="btn btn-default btn-sm">添加</a>
|
||||
<div class="pull-right">
|
||||
<?php if(0):?>
|
||||
<?php echo $page;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<!-- /.pull-right -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<style>
|
||||
.table thead > tr > td, .table tbody > tr > td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<!-- Page Script -->
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
83
app/admin/view/download_category/subcolumn.html
Executable file
83
app/admin/view/download_category/subcolumn.html
Executable file
@@ -0,0 +1,83 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">副分类选择框</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php if(!empty($list)):?>
|
||||
<div class="row">
|
||||
<?php foreach($list as $k=>$category1):?>
|
||||
<div class="col-xs-12">
|
||||
<label class="checkbox-inline"><input type="checkbox" value="<?php echo $category1['id'];?>" <?php echo in_array($category1['id'], $columns) ? 'checked' : '';?>> <?php echo $category1['name'];?></label>
|
||||
<?php if($category1['haschild']):?>
|
||||
<div class="row">
|
||||
<?php foreach($category1['child'] as $k=>$category2):?>
|
||||
<div class="col-xs-11 col-xs-offset-1">
|
||||
<label class="checkbox-inline"><input type="checkbox" value="<?php echo $category2['id'];?>" <?php echo in_array($category2['id'], $columns) ? 'checked' : '';?>> <?php echo $category2['name'];?></label>
|
||||
<?php if($category2['haschild']):?>
|
||||
<div class="row">
|
||||
<?php foreach($category2['child'] as $k=>$category3):?>
|
||||
<div class="col-xs-10 col-xs-offset-2">
|
||||
<label class="checkbox-inline"><input type="checkbox" value="<?php echo $category3['id'];?>" <?php echo in_array($category3['id'], $columns) ? 'checked' : '';?>> <?php echo $category3['name'];?></label>
|
||||
<?php if($category3['haschild']):?>
|
||||
<div class="row">
|
||||
<div class="col-xs-9 col-xs-offset-3">
|
||||
<?php foreach($category3['child'] as $k=>$category4):?>
|
||||
<label class="checkbox-inline"><input type="checkbox" value="<?php echo $category4['id'];?>" <?php echo in_array($category4['id'], $columns) ? 'checked' : '';?>> <?php echo $category4['name'];?></label>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<!-- <button type="button" class="btn btn-default btn-sm pull-left" id="checkbox-suball">全选</button>-->
|
||||
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" id="checkbox-subcolumn">确定</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
<script type="text/javascript">
|
||||
$('#checkbox-subcolumn').click(function() {
|
||||
var state = false;
|
||||
var ids = new Array();
|
||||
var titles = new Array();
|
||||
$('#modal-subcolumn input[type=checkbox]').each(function(i) {
|
||||
if ($(this).prop("checked")) {
|
||||
state = true;
|
||||
ids.push($(this).val());
|
||||
titles.push($(this).parent().text());
|
||||
//titles.push($(this).data('title'));
|
||||
}
|
||||
});
|
||||
if (state == true) {
|
||||
$('#subcid').val(ids.join(','));
|
||||
console.log(titles.join(' '));
|
||||
//$('#adtitle').val(titles.join(' '));
|
||||
$('#modal-subcolumn').modal('hide');
|
||||
} else {
|
||||
if (confirm('确认清空此值吗?')) {
|
||||
$('#subcid').val('');
|
||||
//$('#adtitle').val('');
|
||||
$('#modal-subcolumn').modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#checkbox-suball').click(function() {
|
||||
$('#modal-subcolumn input[type=checkbox]').each(function(i) {
|
||||
$(this).prop("checked", true);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user