<!--
<?php
print <<<EOT
-->
<style type="text/css">
.ListRollPic:after{
	content:'';
	display:block;
	clear:both;
}
.ListRollPic ul{
	width:300px;
	border:#DDD solid 1px;
	margin-bottom:10px;
	margin-right:10px;
	border-radius:5px;
	float:left;
}
.ListRollPic ul li{
	border-top:#DDD solid 1px;
	padding:5px;
	position:relative;
}
.ListRollPic ul li.img{
	border-top:0;
	height:150px;
}
.ListRollPic ul li.img img{
	position: absolute;
	left: 50%;
	top: 50%;
  -webkit-transform: translate3D(-50%, -50%, 0);
      -ms-transform: translate3D(-50%, -50%, 0);
          transform: translate3D(-50%, -50%, 0);
	max-width:95%;
	max-height:150px;
}
.ListRollPic ul li.picurl,.ListRollPic ul li.piclink,.ListRollPic ul li.picalt{
	padding-left:60px;
}
.ListRollPic ul li.picurl span,.ListRollPic ul li.piclink span,.ListRollPic ul li.picalt span{
	display:block;
	position:absolute;
	width:60px;
	height:30px;
	line-height:30px;
	left:5px;
	top:5px;
}
.ListRollPic ul li.picurl input,.ListRollPic ul li.piclink input,.ListRollPic ul li.picalt input{
	width:98%;
	height:20px;
	line-height:20px;
}
.ListRollPic ul li.moreAct{
	text-align:center;
	line-height:30px;
}
.ListRollPic ul li.moreAct span{
	display:inline-block;
	background:#AAA;
	padding:0 10px;
	color:#FFF;
	border-radius:3px;
	margin:0 5px;
	cursor:pointer;
}
.ListRollPic ul li.moreAct span.move{
	background:#F90;
	cursor:move;
}
.ListRollPic ul li.moreAct span.upfile{
	background:blue;
}
.ListRollPic ul li.moreAct span.cut{
	background:green;
}
.ListRollPic ul li.moreAct span:hover{
	background:#F60;
}
.upfileBox,.upfileBox1{
	position:fixed;
	width:100%;
	height:100%;
	z-index:1000;
	left:0;
	top:0;
	display:none;
}
.upfileBox .back,.upfileBox1 .back{
	position:absolute;
	width:100%;
	height:100%;
	left:0;
	top:0;
	background:rgba(0,0,0,0.6);
}
.upfileBox .InBox,.upfileBox1 .InBox{
	position: absolute;
	left: 50%;
	top: 50%;
	width:300px;
	border:#DDD solid 1px;
	padding:20px 0;
	text-align:center;
	border-radius:5px;
	background:#FFF;
  -webkit-transform: translate3D(-50%, -50%, 0);
      -ms-transform: translate3D(-50%, -50%, 0);
          transform: translate3D(-50%, -50%, 0);
}
.upfileBox1 .InBox{
	padding:5px 5px 5px 5px;
	width:500px;
}
.upfileBox .InBox p{
	padding-bottom:15px;
	color:#F30;
}
.upfileBox .InBox iframe{
	width:250px;
	height:30px;
}
.upfileBox1 .InBox iframe{
	width:500px;
	height:350px;
}
</style>
<div class="MainContainers">
    <div class='ListLinkCont'>
          <a href="index.php?lfj=$lfj&inc=&job=list&id=$id&tag=$tag&ch=$ch&chtype=$chtype&ch_fid=$ch_fid&ch_pagetype=$ch_pagetype&ch_module=$ch_module&ch_ifjs=$ch_ifjs&mystyle=$mystyle&">更换选择显示其他设置</a> 
          <a href="$viewurl" target="_blank">查看效果</a>  
          <a href="$viewurl&jobs=show">返回频道/专题</a>
    </div>
	<div class="Conter">
	<form id="form1" name="form8" method="post" action="index.php?lfj=$lfj&action=$job&inc=$inc&lid=$rsdb[lid]&ch=$ch&chtype=$chtype&tag=$tag&type=rollpic&ch_fid=$ch_fid&ch_pagetype=$ch_pagetype&ch_module=$ch_module&ch_ifjs=$ch_ifjs&mystyle=$mystyle&">
		<table class='FormTable'>
<!--
EOT;
if($select_city){
print <<<EOT
-->
            <tr>
              <td class='tdL'>显示范围:</td>
              <td class='tdR'>$select_city</td>
            </tr>
<!--
EOT;
}
print <<<EOT
-->
            <tr> 
              <td class='tdL'>显示尺寸：</td>
              <td class='tdR'> 宽 <input type="text" name="width" id="atc_width" size="10" value="$width">  &nbsp; 高 <input type="text" name="height" id="atc_height" size="10" value="$height"> <span>(单位是像素，如果不填则分别是父标签的100%)</span></td>
            </tr>
			<tr> 
              <td class='tdL'>幻灯片图片：<img src="$webdb[www_url]/images/default/menu_add.gif" title="添加一个空白项" onclick="add_roll_pic0()" /></td>
              <td class='tdR'>
			  	 <div class="ListRollPic" id="ListRollPic">	
<!--
EOT;
foreach($picurl AS $key=>$value){
$thisimg=tempdir($value);
print <<<EOT
-->
					<ul class="list$key">
						<li class="img"><span><img src='$thisimg' onError="this.src='$webdb[www_url]/images/default/nopic.jpg'"/></span></li>
						<li class="picurl"><span>图片地址</span><input type="text" name="picurl[$key]" value="{$picurl[$key]}" id="pic$key" onBlur="editpicurl(\$(this))"></li>
						<li class="piclink"><span>链接网址</span><input type="text" name="piclink[$key]" value="{$piclink[$key]}"></li>
						<li class="picalt"><span>文字介绍</span><input type="text" name="picalt[$key]" value="{$picalt[$key]}"></li>
						<li class="moreAct"><span class="move">移动</span> <span class="upfile" onclick="upfile_roll($key)">上传</span> <span class="cut" onclick="cutimg('pic$key')">剪切</span> <span class="del" onclick="remove_roll(\$(this))">删除</span></li>
						<input class='thiskey' name="thiskey[]" type="hidden" value="$key" />
					</ul>
<!--
EOT;
}print <<<EOT
-->
			  	 </div>
				 <div class="uppic_iframe"><iframe frameborder=0 height=45 width=45 scrolling=no src='$webdb[www_url]/do/upfile_m.php?dir=rollpics/rollpics0&thisobjs=rollpic'></iframe></div>
<script language="javascript">
function cutimg(pic){
	var img=document.getElementById(pic).value;
	var cw=document.getElementById('atc_width').value;
	var ch=document.getElementById('atc_height').value;
	if(cw==''){
		document.getElementById('atc_width').focus();
		alert("请设置好图片宽度");return false;
	}
	if(ch==''){
		document.getElementById('atc_height').focus();
		alert("请设置好图片高度");return false;
	}
	if(img!=''){
		if(img.indexOf("http://")==-1){
			img="$webdb[www_url]/$webdb[updir]/"+img;
		}
		window.open("cutimg.php?lfj=$lfj&ch_module=$ch_module&job=cutimg&width="+cw+"&height="+ch+"&srcimg="+img,'',"width=480,height=430")
	}else{
		document.getElementById(pic).focus();
		alert('图片地址不存在');
	}
}
</script>
<script type="text/javascript">
var maxkey=0;
function upimg1(imgurl,objs){
	var imgs= new Array();
	imgs=imgurl.split(","); 
	for (i=0;i<imgs.length ;i++ ){ 
		if(imgs[i]!=''){
			get_maxkey();
			$('.ListRollPic').append('<ul class="list'+maxkey+'"><li class="img"><span><img src="{$webdb[www_url]}/{$webdb[updir]}/'+imgs[i]+'"/></span></li><li class="picurl"><span>图片地址</span><input type="text" name="picurl['+maxkey+']" value="'+imgs[i]+'" onBlur="editpicurl(\$(this))" id=pic'+maxkey+'></li><li class="piclink"><span>链接网址</span><input type="text" name="piclink['+maxkey+']"></li><li class="picalt"><span>文字介绍</span><input type="text" name="picalt['+maxkey+']"></li><li class="moreAct"><span class="move">移动</span> <span class="upfile" onclick="upfile_roll('+maxkey+')">上传</span> <span class="del" onclick="remove_roll(\$(this))">删除</span></li><input class="thiskey" name="thiskey[]" type="hidden" value="'+maxkey+'" /></ul>');
		}
	}
	$('.uppic_iframe iframe').attr('src','$webdb[www_url]/do/upfile_m.php?dir=rollpics/rollpics0&thisobjs='+objs+'&'+Math.random());
}
function add_roll_pic0(){
	get_maxkey();
	$('.ListRollPic').append('<ul class="list'+maxkey+'"><li class="img"><span><img src="$webdb[www_url]/images/default/nopic.jpg"/></span></li><li class="picurl"><span>图片地址</span><input type="text" name="picurl['+maxkey+']" onBlur="editpicurl(\$(this))"></li><li class="piclink"><span>链接网址</span><input type="text" name="piclink['+maxkey+']"></li><li class="picalt"><span>文字介绍</span><input type="text" name="picalt['+maxkey+']"></li><li class="moreAct"><span class="move">移动</span> <span class="upfile" onclick="upfile_roll('+maxkey+')">上传</span> <span class="cut" onclick="cutimg(\'pic'+maxkey+'\')">剪切</span> <span class="del" onclick="remove_roll(\$(this))">删除</span></li><input class="thiskey" name="thiskey[]" type="hidden" value="'+maxkey+'" /></ul>');
}
function remove_roll(objs){
	objs.parent().parent().remove();
}
function get_maxkey(){
	var check_key=0;
	$('.ListRollPic ul').each(function(){
		check_key=1;
		var thiskey=$(this).find('.thiskey').val();
		if(thiskey>maxkey){
			maxkey=thiskey;
		}
	});
	if(check_key>0){
		maxkey++;
	}
}
function editpicurl(objs){
	var thispicurl=objs.val();
	if(thispicurl.indexOf("http://")==-1){
		thispicurl="{$webdb[www_url]}/{$webdb[updir]}/"+thispicurl;
	}
	objs.parent().parent().find('img').attr("src",thispicurl);
}
</script>
<script type="text/javascript" src="$webdb[www_url]/images/move/Sortable.js"></script>
<script type="text/javascript">
(function (){
	var console = window.console;
	if( !console.log ){
		console.log = function (){
			alert([].join.apply(arguments, ' '));
		};
	}
	Sortable.create(document.getElementById('ListRollPic'), {
		handle: '.move',
		animation: 150
	});
})();
</script>
			  </td>
            </tr>
			<tr> 
              <td class='tdL'>幻灯片类型:</td>
              <td class='tdR'> 
                <input type="radio" name="rolltype" value="1" $_rolltype[1]/> 类型1(<span onclick="Show_rolltype(1)" style="color:blue;">查看示例</span>)
                <input type="radio" name="rolltype" value="2" $_rolltype[2]/> 类型2(<span onclick="Show_rolltype(2)" style="color:blue;">查看示例</span>)
				<input type="radio" name="rolltype" value="3" $_rolltype[3]/> 类型3(<span onclick="Show_rolltype(3)" style="color:blue;">查看示例</span>)
				<input type="radio" name="rolltype" value="100" $_rolltype[100]/> 自定义(<span style="color:#999;">要写程序,不懂程序请别选择</span>)
			  </td>
            </tr>
			<tr id="phpcode"> 
              <td class='tdL'>模板代码:<br>
                (<a href="http://bbs.qibosoft.com/read-forum-tid-370595.htm" target="_blank">查看教程</a>) 
              </td>
              <td class='tdR'> 
                <textarea name="tplpart_1code" cols="100" rows="8">$tplpart_1code</textarea>
              </td>
            </tr>
            <tr> 
              <td class='tdL'>更新内容时上方遮蔽层设置:</td>
              <td class='tdR'>层宽 
                <input name="div_w" type="text" id="div_w" value="$div_w" size="4" />
                层高 
                <input name="div_h" type="text" id="div_h" value="$div_h" size="4" />
                层的颜色 
                <input name="div_bgcolor" type="text" id="div_bgcolor" value="$div_bgcolor" size="12" />
              </td>
            </tr>
            <tr> 
              <td class='tdL'>是否隐藏,暂时不显示:</td>
              <td class='tdR'> 
                <input type="radio" name="hide" value="1" $hidedb[1]/>
                是 
                <input type="radio" name="hide" value="0" $hidedb[0]/>
                否 </td>
            </tr>
            <tr> 
              <td class='tdL'><br/></td>
              <td class='tdR'><input type="submit" name="Submit" value="提交" onClick=sub() /></td>
            </tr>
		</table>
	</form>
	</div>
</div>
<div class="upfileBox">
	<input class='upfilenum' type="hidden" value="0"/>
	<div class="back" onclick="HideupfileBox()"></div>
	<div class="InBox"><p>请上传图片</p><iframe frameborder=0  scrolling=no src='$webdb[www_url]/do/upfile.php?fn=upfile&dir=rollpics/rollpics0&label=out_url0'></iframe></div>
</div>
<div class="upfileBox1">
	<div class="back" onclick="HideupfileBox1()"></div>
	<div class="InBox"><iframe frameborder=0  scrolling=no src='$webdb[www_url]/images/rollpic/rolltype1.html'></iframe></div>
</div>
<script type="text/javascript">
function upfile_roll(num){
	$('.upfilenum').val(num);
	$('.upfileBox').fadeIn();
}
function HideupfileBox(){
	$('.upfileBox').fadeOut();
}
function HideupfileBox1(){
	$('.upfileBox1').fadeOut();
}
function upfile(url,name,size,ty){
	var thisnum=$('.upfilenum').val();
	$('.ListRollPic .list'+thisnum+' img').attr("src","{$webdb[www_url]}/{$webdb[updir]}/"+url);
	$('.ListRollPic .list'+thisnum+' .picurl input').val(url);
	HideupfileBox();
	$('.upfileBox iframe').attr('src','$webdb[www_url]/do/upfile.php?fn=upfile&dir=rollpics/rollpics0&label=out_url0&'+Math.random());
}
function Show_rolltype(num){
	$('.upfileBox1').fadeIn();
	$('.upfileBox1 iframe').attr('src','$webdb[www_url]/images/rollpic/rolltype'+num+'.html');
}
$('input[name="rolltype"]').click(function(){
	if($(this).val()==100){
		$('#phpcode').fadeIn();
	}else{
		$('#phpcode').fadeOut();
	}
});
if($rolltype==100){
	$('#phpcode').fadeIn();
}else{
	$('#phpcode').fadeOut();
}
</script>
<!--
EOT;
?>
-->