This commit is contained in:
2024-10-29 14:04:59 +08:00
commit 48bf3e6f33
2839 changed files with 762707 additions and 0 deletions

View File

@@ -0,0 +1,218 @@
<!-- 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/product_series/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/product_series/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> -->
</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 $product_series['name'];?>">
</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 $product_series['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($product_series['isshow']):?>checked=""<?php endif;?>/> 显示
</label>
<label class="radio-inline">
<input type="radio" name="isshow" value="0" <?php if(!$product_series['isshow']):?>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 $product_series['description'];?></textarea>
</div>
<div class="col-sm-10 col-sm-offset-2">
<span class="help-block">(系列描述)</span>
</div>
</div>
<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="p-series-image" data-toggle="image" data-folder="product" class="img-thumbnail"><img class="img-responsive" src="<?php echo empty($product_series['picture'])?'/uploads/nopic.jpg':$product_series['picture'];?>" /></a>
<input type="hidden" name="picture" value="<?php echo $product_series['picture'];?>" id="input-image" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- <div class="col-sm-5">
<span class="help-block">(主要图片)</span>
</div>-->
</div>
<div class="form-group">
<label for="image1" class="col-sm-2 control-label">图标</label>
<div class="col-sm-5">
<div class="input-group">
<span class="input-group-addon"><a tabindex="0" role="button" data-toggle="popover-image" data-image="<?php echo $product_series['icon'];?>"><i class="fa fa-fw fa-image"></i></a></span>
<input type="text" class="form-control" name="icon" id="caticon" value="<?php echo $product_series['icon'];?>">
<span class="input-group-btn">
<button class="btn btn-primary" type="button" onclick="webuploader_modal('caticon', '', 'icon', 'image', 'img_call_back');">选择图片</button>
</span>
</div>
</div>
<div class="col-sm-5">
<span class="help-block">(导航图标)</span>
</div>
</div>
</div>
</div>
<!-- /.tab-content -->
<div class="nav-footer row">
<input type="hidden" name="id" value="<?php echo $product_series['id'];?>">
<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/product/lists');?>" class="btn btn-block btn-primary">产品列表</a>
<a href="<?php echo url('/admin/product_series/lists');?>" class="btn btn-block btn-primary">产品系列</a>
<a href="<?php echo url('/admin/product_series/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">&times;</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 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>