{php include template("admin/header");}

<style>
.midder table tr td {
border-bottom: 1px solid #DDDDDD;
height: 24px;
line-height: 8px;
padding: 5px 20px;
vertical-align: top;
margin: 0;
outline: 0 none;
}
.btt {margin-top:6px; float:left;color:#FFFFFF; background:#318dd0; font-size:12px;  border-color:#106BAB #106BAB #0D68A9;color:#333;background:#f1f0f0;border:1px solid #c4c4c4;border-radius:2px;padding:4px 15px;display:inline-block;
cursor:pointer;text-decoration:none;overflow:visible;text-align:center;zoom:1;white-space:nowrap;margin-right:10px;font-family:inherit;position:relative;}
.midder table .odd td .cloadimg { display:block; width:80px; height:51px; line-height:10000px; background: no-repeat url(<?php echo SITE_URL; ?>images/b1_wide_120802.png) center center; text-indent:9999999px; border:#DDD 1px solid; overflow:hidden;}
.odd .laoding { background-image: url(<?php echo SITE_URL; ?>images/ico-operating.gif);}
.odd .zhu { border-color:#CCC}
.midder table tr td{ padding-top:20px;}
.mt_20{ margin-top:17px;}
.tfile {
filter: alpha(opacity=0);
opacity: 0;
font-size: 16px;
height: 51px;
width: 128px;
float: left;
margin-top: -40px;
overflow:hidden;
cursor: pointer;
}
.midder table tr.odd td {
line-height: 60px;
}
</style>
<script src="<?php echo SITE_URL; ?>public/js/jquery.js" type="text/javascript"></script>
<script src="<?php echo SITE_URL; ?>js/ajaxfileupload.min.js" type="text/javascript"></script>
<script>

function UploadShareImg(g_id){
	
	$("#a_"+g_id).addClass("laoding");
	$.ajaxFileUpload({
		url:"<?php echo SITE_URL; ?>index.php?app=share&ac=do&le=UploadImg&f=uploadShareImg_"+g_id,
		secureuri:false,
		dataType:'text',
		fileElementId:'uploadShareImg_'+g_id,
		success:function(result){
			$("#a_"+g_id). removeClass("laoding");
			var img_src = "<?php echo SITE_URL; ?>"+result;
			$("#a_"+g_id).css({"background-image":"url("+result+")","background-size":"177px 50px"});
			$("#img_url_"+g_id).attr("value",result);
			}
		}
	)}

</script>
<script>
function insertMenu(){
	$("#before").before('<tr><td><input class="input-text" name="slidetitle[]" value="请输入标题"></td><td><input class="input-text" name="slidedesc[]" style="width:250px;" value=""></td><td><input class="input-text" name="slideurl[]" style="width:250px;" value=""></td><td><input class="input-text" name="slideimg[]" style="width:250px;" value="">(图片尺寸960x270)</td><td><input class="input-text" name="sort[]" style="width:100px;" value=""></td></tr>');
}

</script>

<div class="midder">

<h2>手机幻灯设置</h2>

{php include template("admin/mobile_menu");}
<form method="POST" action="index.php?app=mobile&ac=admin&mg=setad&ts=do">
<table cellpadding="0" cellspacing="0">

<tbody><tr><td>标题（可留空）</td><td>关键词（点击广告后查找该关键词商品）</td><td>图片(必选，点击上传，注意尺寸)</td><td>排序</td><td>操作</td></tr>

<!--{loop $arrSlides $key $item}-->
<tr class="odd"><td><input type="hidden" name="id[]" value="{$item[id]}"><input class="input-text mt_20" name="slidetitle[]" value="{$item[title]}"></td><td><input class="input-text mt_20"  name="slidedesc[]" value="{$item[desc]}"></td><td> <a href="javascript:;" class="cloadimg" style="background-image:url({$item[img]});background-size:80px 51px;" class="zhu" id="a_{$item[id]}">上传图片</a>
    <input class="tfile PUB_PIC_FILE" name="uploadShareImg_{$item[id]}" type="file" id="uploadShareImg_{$item[id]}" onchange="return UploadShareImg({$item[id]});">
    <input type="hidden" name="slideimg[]" value="{$item[img]}" id="img_url_{$item[id]}">
    
    </td><td><input class="input-text mt_20" name="sort[]" style="width:30px;" value="{$item[sort]}"></td>

    <td><a href="index.php?app=mobile&ac=admin&mg=setad&ts=del&id={$item[id]}" onclick="return confirm('您确定要删除吗，如不确定请点取消')">删除</a></td></tr>
<!--{/loop}-->
<tr id="before"><td><input class="btn btn_submit" type="submit" value="提 交"></td><td></td><td>说明：尽量不超过5个</td><td></td><td></td></tr>

</tbody></table>

<form>
</div>
{template footer}