1 <div class="header"> 2 <h1 class="page-title">广告图</h1> 3 <ul class="breadcrumb"> 4 <li><a href="javascript:;">系统设置</a></li> 5 <li><a href="{:U('Admin/Banner/banner_list')}">广告图管理</a></li> 6 <li class="active">广告图操作</li> 7 </ul> 8 </div> 9 <div class="main-content"> 10 <div class="row"> 11 <div class="col-md-4"> 12 <br> 13 <div id="myTabContent" class="tab-content"> 14 <div class="tab-pane active in" id="home"> 15 <form method="post" enctype="multipart/form-data"> 16 <input type="hidden" id="banner_id" name="banner_id" value="<?php echo $banner_info['banner_id'];?>" /> 17 <div class="form-group"> 18 <label>广告图类型</label> 19 <select name="banner_type" id="banner_type" class="form-control"> 20 <option value="">请选择</option> 21 <option value="1" <?php echo $banner_info['banner_type']==1?'selected':'';?>>首页</option> 22 </select> 23 </div> 24 <?php if ($banner_info){ ?> 25 <div class="form-group"> 26 <label>广告图原图</label> 27 <br> 28 <img src="<?php echo $banner_info['banner_image'];?>" style="height: 300px;"> 29 </div> 30 <?php } ?> 31 <div class="form-group"> 32 <label>请选择上传的图片</label> 33 <input type="file" name="banner_image" id="banner_image" value=""> 34 </div> 35 <div class="form-group"> 36 <label>是否显示广告图</label> 37 <select name="banner_state" id="banner_state" class="form-control"> 38 <option value="1" <?php echo $banner_info['banner_state']==='1'?'selected':'';?>>是</option> 39 <option value="0" <?php echo $banner_info['banner_state']==='0'?'selected':'';?>>否</option> 40 </select> 41 </div> 42 <?php if ($banner_info){ ?> 43 <div class="form-group"> 44 <label>添加时间</label> 45 <input type="text" disabled class="form-control" value="<?php echo $banner_info['add_time'];?>"> 46 </div> 47 <?php } ?> 48 </form> 49 </div> 50 </div> 51 <div class="btn-toolbar list-toolbar"> 52 <button class="btn btn-primary" onclick="$('form').submit();"><i class="fa fa-save"></i> 保存</button> 53 <a href="JavaScript:;" onclick="JavaScript:history.back(-1);" class="btn btn-danger">返回</a> 54 </div> 55 </div> 56 </div> 57 </div> 58 <script type="text/javascript"> 59 $('form').submit(function(){ 60 var banner_id = $("#banner_id").val(); 61 var banner_image = $("#banner_image").val(); 62 if (banner_id==''&&banner_image=='') { 63 alert('请选择上传的图片'); 64 return false; 65 } 66 var banner_type = $("#banner_type").val(); 67 if (banner_type=='') { 68 alert('请选择广告图的类型'); 69 return false; 70 } 71 }); 72 </script>