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

208 lines
12 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/ad/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/ad/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 $ad['name'];?>">
</div>
<div class="col-sm-5">
<span class="help-block">(广告名称*)</span>
</div>
</div>
<div class="form-group">
<label for="typeid" class="col-sm-2 control-label">所属类别<em style="color:red;">*</em></label>
<div class="col-sm-5">
<select class="form-control" name="typeid" id="typeid">
<option value="0">默认值</option>
<?php echo $typeOption;?>
</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 $ad['sort'];?>">
</div>
<div class="col-sm-5 col-sm-offset-3">
<span class="help-block">(广告排序)</span>
</div>
</div>
<div class="form-group">
<label for="timeset" class="col-sm-2 control-label">时间限定</label>
<div class="col-sm-5">
<label class="radio-inline">
<input name="timeset" type="radio" value="1" <?php if($ad['timeset']):?>checked=""<?php endif;?>/> 限定时间
</label>
<label class="radio-inline">
<input name="timeset" type="radio" value="0" <?php if(!$ad['timeset']):?>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="col-xs-12 col-sm-6 no-padding">
<div class="input-group">
<input type="text" name="starttime" id="starttime" value="<?php echo empty($ad['starttime'])?'':date('Y-m-d H:i:s',$ad['starttime']);?>" class="form-control">
<span class="input-group-btn">
<button class="btn btn-primary" type="button" onclick="laydate_datetime('#starttime');"><i class="fa fa-fw fa-calendar"></i></button>
</span>
</div>
</div>
<div class="col-xs-12 col-sm-6 no-padding">
<div class="input-group">
<input type="text" name="endtime" id="endtime" value="<?php echo empty($ad['endtime'])?'':date('Y-m-d H:i:s',$ad['endtime']);?>" class="form-control">
<span class="input-group-btn">
<button class="btn btn-primary" type="button" onclick="laydate_datetime('#endtime');"><i class="fa fa-fw fa-calendar"></i></button>
</span>
</div>
</div>
</div>
<div class="col-sm-5">
<span class="help-block">(投放时间)</span>
</div>
</div>
<div class="form-group">
<label for="normbody" class="col-sm-2 control-label">广告内容</label>
<div class="col-sm-5">
<textarea class="form-control" name="normbody"><?php echo $ad['normbody'];?></textarea>
</div>
<div class="col-sm-5">
<span class="help-block">(广告内容)</span>
</div>
</div>
<div class="form-group">
<label for="expbody" class="col-sm-2 control-label">过期显示内容</label>
<div class="col-sm-5">
<textarea class="form-control" name="expbody"><?php echo $ad['expbody'];?></textarea>
</div>
<div class="col-sm-5">
<span class="help-block">(过期显示内容)</span>
</div>
</div>
<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="tags" id="tags" required value="<?php echo $ad['tags'];?>">
</div>
<div class="col-sm-5">
<span class="help-block">(广告标识*)</span>
</div>
</div>
</div>
<!-- /.tab-pane -->
<div class="tab-pane" id="navsecond">
</div>
<!-- /.tab-pane -->
</div>
<!-- /.tab-content -->
<div class="nav-footer row">
<input name="id" value="<?php echo $ad['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/ad/lists');?>" class="btn btn-block btn-primary">广告列表</a>
<a href="<?php echo url('/admin/ad/typelists');?>" class="btn btn-block btn-primary">广告类别</a>
<a href="<?php echo url('/admin/ad/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 -->
<script type="text/javascript">
</script>
<script type="text/javascript">
$(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 typeidObj = document.getElementById('typeid');
if (isNaN(typeidObj.value)) {
alert('所属分类值无效');
typeidObj.focus();
return false;
}
// var agree = $("input[name='agree']", this).prop('checked');
// if (agree) {
// alert("Submitted");
// e.preventDefault();
// } else {
// e.preventDefault();
// alert("请勾选确认");
// }
});
});
</script>