186 lines
10 KiB
HTML
Executable File
186 lines
10 KiB
HTML
Executable File
<!-- 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/question/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/question/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="question" class="col-sm-2 control-label">标题<em style="color:red;">*</em></label>
|
|
<div class="col-sm-5">
|
|
<input type="text" class="form-control" name="title" id="title" required value="<?php echo $question['title'];?>">
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<span class="help-block">(问题标题)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="product" class="col-sm-2 control-label">相关分类</label>
|
|
<div class="col-sm-5">
|
|
<select class="form-control select2" style="width: 100%;" name="cid" id="cid">
|
|
<option value="0">默认值</option>
|
|
<?php if (!empty($question_catelist)): ?>
|
|
<?php foreach ($question_catelist as $key => $value): ?>
|
|
<option value="<?php echo $value['id']; ?>" <?php if ($value['id'] == $question['cid']): ?> selected <?php endif; ?>><?php echo $value['name']; ?></option>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</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 $question['sort'];?>">
|
|
</div>
|
|
<div class="col-sm-5 col-sm-offset-3">
|
|
<span class="help-block">(排序)</span>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label">图片<em style="color:red;">*</em></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="question-img" data-toggle="image" data-folder="question" class="img-thumbnail"><img class="img-responsive" src="<?php echo $question['image']; ?>"/></a>
|
|
<input type="hidden" name="image" value="<?php echo $question['image']; ?>" id="input-picture" />
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</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 $question['content'];?></textarea>
|
|
</div>
|
|
</div>
|
|
<!-- /.box -->
|
|
</div>
|
|
<!-- /.tab-pane -->
|
|
</div>
|
|
<!-- /.tab-content -->
|
|
<div class="nav-footer row">
|
|
<input name="id" value="<?php echo $question['id'];?>" type="hidden">
|
|
<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/question/lists');?>" class="btn btn-block btn-primary">列表</a>
|
|
<a href="<?php echo url('/admin/question/add');?>" class="btn btn-block btn-primary">添加</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!-- /.content -->
|
|
</div>
|
|
<style>
|
|
.table thead > tr > td, .table tbody > tr > td {
|
|
vertical-align: middle;
|
|
}
|
|
</style>
|
|
<!-- /.content-wrapper -->
|
|
<?php echo editor('#content');?>
|
|
<script>
|
|
$(function() {
|
|
$("#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 sortObj = document.getElementById('sort');
|
|
if (isNaN(sortObj.value)) {
|
|
alert('排序值必须是数字');
|
|
sortObj.focus();
|
|
return false;
|
|
}
|
|
// var agree = $("input[name='agree']", this).prop('checked');
|
|
// if (agree) {
|
|
// alert("Submitted");
|
|
// e.preventDefault();
|
|
// } else {
|
|
// e.preventDefault();
|
|
// alert("请勾选确认");
|
|
// }
|
|
});
|
|
});
|
|
$(function() {
|
|
$("#btn-product-qas").click(function(e) {
|
|
//var callback = $(this).data('callback');
|
|
var $element = $(this).parent().parent();
|
|
$('#modal-product').remove();
|
|
$.ajax({
|
|
url: "<?php echo url('/admin/product/modallists');?>?inputid=" + $element.find('input[type=hidden]').attr('id') + '&titleid=' + $element.find('input[type=text]').attr('id'),
|
|
dataType: 'html',
|
|
success: function(html) {
|
|
$('body').append('<div id="modal-product" class="modal fade">' + html + '</div>');
|
|
$('#modal-product').modal({show: true, backdrop: 'static'});
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script> |