You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
202 lines
8.4 KiB
HTML
202 lines
8.4 KiB
HTML
<extend name="Public/base" />
|
|
|
|
<block name="body">
|
|
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
|
|
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
|
|
|
|
|
<div class="cf main-place top_nav_list navtab_list">
|
|
{:W('Index/navigation',array('value'=>'Site/media','compare'=>'Adv/media_adv_pos_lists'))}
|
|
<h3 class="page_title">新增广告</h3>
|
|
<p class="description_text"></p>
|
|
</div>
|
|
|
|
|
|
<!-- 标签页导航 -->
|
|
<div class="tab-wrap">
|
|
|
|
<div class="tab-content tabcon1711">
|
|
<!-- 表单 -->
|
|
<form id="form" action="{:U('add_media_adv?model='.$model['id'])}" method="post" class="form-horizontal">
|
|
<!-- 基础文档模型 -->
|
|
<div id="tab1" class="tab-pane in tab1">
|
|
<table border="0" cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr>
|
|
<td class="l">广告标题:</td>
|
|
<td class="r">
|
|
<input type="text" class="txt " name="title" value="" >
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="l">广告链接:</td>
|
|
<td class="r">
|
|
<input type="text" class="txt " name="url" value="">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="l">开始时间:</td>
|
|
<td class="r">
|
|
<input type="text" class="txt time time1" name="start_time" value="" placeholder="默认当前时间">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="l">结束时间:</td>
|
|
<td class="r">
|
|
<input type="text" class="txt time time2" name="end_time" value="" placeholder="默认没有时间限制">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="l">广告排序:</td>
|
|
<td class="r">
|
|
<input type="text" class="txt" name="sort" value="0">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="l">打开方式:</td>
|
|
<td class="r table_radio">
|
|
<span class="form_radio">
|
|
<label>
|
|
<input type="radio" class="inp_radio" value="_blank" name="target" checked="checked"> 新页面
|
|
</label>
|
|
<label>
|
|
<input type="radio" class="inp_radio" value="_self" name="target" > 本页面
|
|
</label>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr class="picbox">
|
|
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>广告图片:</td>
|
|
<td class="r"><?php $setWidth=intval($advpos['width']);$setHeight=intval($advpos['height']); ?>
|
|
<input type="file" id="upload_picture_pic" name="upload_picture">
|
|
<input type="hidden" name="data" id="pic_id" data-width="{$setWidth}" data-height="{$setHeight}"/>
|
|
<div class="upload-img-box">
|
|
<notempty name="data['data']">
|
|
<div class="upload-pre-item">
|
|
<span class="placeholder-graphic placeholder-graphic_adv" style="<if condition='$setWidth egt $setHeight'>width:120px;height:{:intval($setHeight*120/$setWidth)}px<else />width:{:intval($setWidth*120/$setHeight)}px;height:120px;</if>"><img src="{$data['data']|get_cover='path'}"/></span>
|
|
</div>
|
|
</notempty>
|
|
</div>
|
|
<span class="notice-text">({$advpos.width}*{$advpos.height})</span>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="form-item cf">
|
|
<input type='hidden' name="pos_id" value="{:I('pos_id')}" />
|
|
<button class=" submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">保存</button>
|
|
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
|
|
返回
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="common_settings">
|
|
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
|
<form class="addShortcutIcon">
|
|
<input type="hidden" name="title" value="{$m_title}">
|
|
<input type="hidden" name="url" value="Site/media">
|
|
</form>
|
|
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
|
</div>
|
|
|
|
</block>
|
|
|
|
<block name="script">
|
|
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
|
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
|
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
|
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
|
|
<script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
|
|
<script type="text/javascript">
|
|
//导航高亮
|
|
highlight_subnav('{:U('Site/media')}');
|
|
|
|
//Think.setValue("module", {$data.module|default = 'media'});
|
|
|
|
$(function(){
|
|
$("#game_name").val($("#game_id option:selected").text());
|
|
|
|
|
|
|
|
$('.time1').datetimepicker({
|
|
format: 'yyyy-mm-dd hh:ii',
|
|
language:"zh-CN",
|
|
minView:0,startDate:new Date(),
|
|
autoclose:true
|
|
}).change(function(){
|
|
var start = new Date($(this).val()).getTime();
|
|
var end = new Date($('.time2').val()).getTime();
|
|
|
|
if(isNaN(end)) {return false;}
|
|
|
|
if(start>=end) {layer.msg('开始时间必须小于结束时间');return false;}
|
|
|
|
return false;
|
|
});
|
|
|
|
$('.time2').datetimepicker({
|
|
format: 'yyyy-mm-dd hh:ii',
|
|
language:"zh-CN",
|
|
minView:0,startDate:new Date(),
|
|
autoclose:true
|
|
}).change(function(){
|
|
var end = new Date($(this).val()).getTime();
|
|
var start = new Date($('.time1').val()).getTime();
|
|
|
|
if(isNaN(start)) {return false;}
|
|
|
|
if(start>=end) {layer.msg('开始时间必须小于结束时间');return false;}
|
|
|
|
return false;
|
|
});
|
|
|
|
showTab();
|
|
|
|
});
|
|
|
|
$('#submit').click(function(){
|
|
$('#form').submit();
|
|
});
|
|
|
|
/* 初始化上传插件 */
|
|
$("#upload_picture_pic").uploadify({
|
|
"height" : 30,
|
|
"swf" : "__STATIC__/uploadify/uploadify.swf",
|
|
"fileObjName" : "download",
|
|
"buttonText" : "上传图标",
|
|
"uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id(),'flag'=>true))}",
|
|
"width" : 120,
|
|
'removeTimeout' : 1,
|
|
'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
|
|
"onUploadSuccess" : upload_picture_pic{$field.name},
|
|
'onFallback' : function() {
|
|
alert('未检测到兼容版本的Flash.');
|
|
}
|
|
});
|
|
function upload_picture_pic{$field.name}(file, data){
|
|
var data = $.parseJSON(data);
|
|
var src = '';
|
|
if(data.status){
|
|
$("#pic_id").val(data.id);
|
|
src = data.url || '__ROOT__' + data.path;
|
|
var setWidth = parseInt($.trim($('#pic_id').attr('data-width'))),setHeight = parseInt($.trim($('#pic_id').attr('data-height')));
|
|
var style = '';
|
|
if(setWidth>=setHeight) {style = 'width:120px;height:'+parseInt(setHeight*120/setWidth)+'px';} else {style = 'height:120px;width:'+parseInt(setWidth*120/setHeight)+'px';}
|
|
$("#pic_id").parent().find('.upload-img-box').html(
|
|
'<div class="upload-pre-item"><span class="placeholder-graphic placeholder-graphic_adv" style="'+style+'"><img src="' + src + '"/></span></div>'
|
|
);
|
|
} else {
|
|
updateAlert(data.info);
|
|
setTimeout(function(){
|
|
$('#top-alert').find('button').click();
|
|
$(that).removeClass('disabled').prop('disabled',false);
|
|
},1500);
|
|
}
|
|
}
|
|
</script>
|
|
</block>
|