<include file="Public:head"/>
<script src="{iMicms::RES}/js/date/WdatePicker.js" type="text/javascript"></script>
<script src="{iMicms::STATICS}/vote/common.js" type="text/javascript"></script>
<script src="{iMicms::STATICS}/artDialog/jquery.artDialog.js?skin=default" type="text/javascript"></script>
<script src="{iMicms::STATICS}/artDialog/plugins/iframeTools.js" type="text/javascript"></script>
<script src="{iMicms::STATICS}/jquery-ui.js" type="text/javascript"></script>
<script src="{iMicms::STATICS}/vote/switch.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="{iMicms::STATICS}/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="{iMicms::STATICS}/jquery-ui.theme.css" />
<link rel="stylesheet" type="text/css" href="{iMicms::STATICS}/jquery-ui.structure.css" />
<link rel="stylesheet" type="text/css" href="{iMicms::STATICS}/vote/switch.css" />
<if condition="($vo['type'] eq 'img') OR ($type eq 'img')">
<input type="hidden" id="votetyp" value="img">
<else />
<input type="hidden" id="votetyp" value="txt">
</if>
<div class="content">
<div class="cLineB">
  <h4> <if condition="$vo['type'] eq 'img' OR ($type eq 'img')"> 图片<else/>文本</if>投票设置 </h4><a href="{iMicms::U('Vote/index')}" class="right btn btn-primary btn_submit  J_ajax_submit_btn" style="margin-top:-27px">返回</a>
 </div>
<div class="msgWrap bgfc">
<form class="form" method="post" action=""   enctype="multipart/form-data">
<if condition="$vo['id'] neq ''">
  <input type="hidden" name="id" value="{iMicms:$vo['id']}">
</if>
<table class="userinfoArea" style=" margin:0;" border="0" cellspacing="0" cellpadding="0" width="100%"><tbody>
<tr>
<th width="83">活动模板：</th>
<td>
<select name="moban">
  <option value="1" <eq name="vo.moban" value="1"> selected </eq>>模版一[淡红系]</option>
  <option value="3" <eq name="vo.moban" value="3"> selected </eq>>模版三[草绿系]</option>
  <option value="4" <eq name="vo.moban" value="4"> selected </eq>>模版四[淡蓝系]</option>
   <option value="5" <eq name="vo.moban" value="5"> selected </eq>>模版五[土豪金]</option>
    <option value="6" <eq name="vo.moban" value="6"> selected </eq>>模版六[黄色系]</option>
    <option value="7" <eq name="vo.moban" value="7"> selected </eq>>模版七[深粉系]</option>
    <option value="8" <eq name="vo.moban" value="8"> selected </eq>>模版八[清新系]</option>
    <option value="9" <eq name="vo.moban" value="9"> selected </eq>>模版九[黑黄系]</option>
    <option value="10" <eq name="vo.moban" value="10"> selected </eq>>模版十[新年红]</option>
     <option value="11" <eq name="vo.moban" value="11"> selected </eq>>模版十一[深青系]</option>
</select>

</td>
</tr>
<tr>

<tr>
<th width="83">活动关键词：</th>
<td width="1217"><input style="height:30px;width:750px" type="text" name="keyword" value="<if condition="$vo['keyword'] eq ''">投票<else/>{iMicms:$vo.keyword}</if>" class="px" style="width:550px;"><br><span class="red">只能写一个关键词，请不要与其它活动的关键词重复。</span></td>
</tr>
<tr>
<th width="83">活动标题：</th>
<td><input style="height:30px;width:750px;" type="text" name="title" value="{iMicms:$vo.title}" class="px" style="width:550px;"></td>
</tr>
<tr>
<if condition="$guanggao neq ''">
<volist name="guanggao" id="ivo">
<tr class="guang" id="guang_{iMicms:$ivo.id}">
<th >广告图片：<br /><span style="color:red;font-weight:400;font-size:12px;">(显示在页面最上面)</span></th>
<td>
<input type='hidden' name="picurl_guanggao[id][]" value="{iMicms:$ivo.id}"> 
<input type="text" style="height:30px;width:750px" name="picurl_guanggao[url][]" id="picurl_guanggao_{iMicms:$i+50}" value="{iMicms:$ivo.ggurl}" class="px" onclick="" style="width:300px;">
<a href="#" onclick="upyunPicUpload('picurl_guanggao_{iMicms:$i+50}',700,400,'{iMicms:$token}')" class="btn btn-primary btn_submit  J_ajax_submit_btn">上传</a> 
<a href="#" onclick="viewImg('picurl_guanggao_{iMicms:$i+50}')">预览</a>
&nbsp;&nbsp;<a href="javascript:;" onclick="delgg({iMicms:$ivo.id})">删除</a>&nbsp;填写图片外链地址，大小为640X295
</td>
</tr>
</volist>

 </if>
<tr class="guang">
<th >广告图片：<br /><span style="color:red;font-weight:400;font-size:12px;">(显示在页面最上面)</span></th>
<td>
<input type='hidden' name="picurl_guanggao[id][]"> 
<input type="text" style="height:30px;width:750px" name="picurl_guanggao[url][]" id="picurl_guanggao_1" value="{iMicms:$vo.picurl_guanggao}" class="px" onclick="" style="width:300px;">
<a href="#" onclick="upyunPicUpload('picurl_guanggao_1',700,400,'{iMicms:$token}')" class="btn btn-primary btn_submit  J_ajax_submit_btn">上传</a> 
<a href="#" onclick="viewImg('picurl_guanggao_1')">预览</a>
&nbsp;&nbsp;<a href="javascript:;" onclick="delguang(1)">删除</a>
&nbsp;&nbsp;<a href="javascript:;" id="addg2"  onclick="newguang(2)">添加</a>&nbsp;填写图片外链地址，大小为640X295
</td>
</tr>
<tr>
<th width="83">微信分享描述：</th>
<td><input style="height:30px;width:750px;" type="text" name="fxms" value="{iMicms:$vo.fxms}" class="px" style="width:550px;"></td>
</tr>
<tr>
<th>微信分享外链图标<br /><span style="color:red;font-weight:400;font-size:12px;">（分享首页到朋友圈或朋友时显示的图标）</span></th>
<td>

<input style="height:30px;width:750px" type="text" name="wappicurl" value="{iMicms:$vo.wappicurl}" class="px" onclick="document.getElementById('picurl_src').src=this.value;" id="wappicurl" style="width:300px;">
<a href="#" onclick="upyunPicUpload('wappicurl',700,400,'{iMicms:$token}')" class="btn btn-primary btn_submit  J_ajax_submit_btn">上传</a> <a href="#" onclick="viewImg('wappicurl')">预览</a>&nbsp;填写图片外链地址，大小为300*300</td>
</tr>

<tr>
<th width="83">微信引导关注提示语：</th>
<td><input style="height:30px;width:750px;" type="area" name="ydgzts" value="{iMicms:$vo.ydgzts}" class="px" style="width:550px;"> <a href="{iMicms::C('site_url')}/shili/ydgzts.htm" target=_blank>&nbsp;<span style="color:red;font-weight:400;font-size:12px;">点击查看示例</span></a></td>
</tr>
<tr>
<th width="83">投票引导关注链接：</th>
<td><input style="height:30px;width:750px;" type="text" name="wxgzurl" value="{iMicms:$vo.wxgzurl}" class="px" style="width:550px;"><a href="{iMicms::C('site_url')}/shili/wxyd.htm" target=_blank>&nbsp;<span style="color:red;font-weight:400;font-size:12px;">点击查看示例</span></a><br><font color=red>(此链接去你的公众号后台素材管理里添加个引导关注素材，然后把素材链接填到这)<font></td>
</tr>
<tr>

<th width="83">每个微信用户可投票数：</th>
<td><input style="height:30px;width:250px;" type="text" name="tpnub" value="{iMicms:$vo.tpnub}" class="px" style="width:550px;"><span style="color:red;font-weight:400;font-size:12px;">（可以限制每天投票数，也可以现在此次活动投票数 "投票设置"中可以设置票数分配规则！可设置每人每天给同一个作品只能投一票）</span></td>
</tr>

<tr>
<th width="83">同一个IP下每天能投多少票：</th>
<td><input style="height:30px;width:250px;" type="text" name="ipnubs" value="{iMicms:$vo.ipnubs}" class="px" style="width:550px;"><span style="color:red;font-weight:400;font-size:12px;">（防止死粉刷票，如果填写0则不限制）</span></td>
</tr>
<tr>
<th width="83">报名期和投票期重叠的时间段每个作品的投票数限额：</th>
<td><input style="height:30px;width:250px;" type="text" name="btcdxz" value="{iMicms:$vo.btcdxz}" class="px" style="width:550px;"><span style="color:red;font-weight:400;font-size:12px;"><br>（又能报名又能投票期间每个作品最多能得多少票，填0为不限制！比如报名时间是 1-10号 投票时间是 5-30号，那么5-10号期间每个作品的最高票数只能是设置的这么多，这样可以防止前后报名作品的票数差距太大！）</span></td>
</tr>
<tr>
<th>报名时间：<span style="color:red;font-weight:400;font-size:12px;"><br>（报名时间）</span></th>
<td><input style="height:30px;width:150px" type="text" class="px" id="start_time" value="<if condition="$vo['start_time'] neq ''">{iMicms:$vo.start_time|date="Y-m-d H:i",###}</if>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" name="start_time">
到
<input style="height:30px;width:150px" type="text" class="px" id="over_time" value="<if condition="$vo['over_time'] neq ''">{iMicms:$vo.over_time|date="Y-m-d H:i",###}</if>" name="over_time" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"></td>
</tr>

<tr>
<th>投票时间：<span style="color:red;font-weight:400;font-size:12px;"><br>（投票时间）</span></th>
<td><input style="height:30px;width:150px" type="text" class="px" id="statdate" value="<if condition="$vo['statdate'] neq ''">{iMicms:$vo.statdate|date="Y-m-d H:i",###}</if>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" name="statdate">
到
<input style="height:30px;width:150px" type="text" class="px" id="enddate" value="<if condition="$vo['enddate'] neq ''">{iMicms:$vo.enddate|date="Y-m-d H:i",###}</if>" name="enddate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"></td>
</tr>

<tr>
<th width="83">活动说明一<br>【标题】：</th>
<td><input style="height:30px;width:450px;" type="text" name="shumat" value="{iMicms:$vo.shumat}" class="px" style="width:550px;"><span style="color:red;font-weight:400;font-size:12px;">（留空则不显示此说明栏）</span></td>
</tr>
<tr>
<th valign="top">活动说明一<br>【内容】：<br /><span style="color:red;font-weight:400;font-size:12px;"></span></th>
<td valign="top"><textarea class="px" id="content" name="shuma" style="width: 550px; height: 270px; display:none ;"><?php echo html_entity_decode(htmlspecialchars_decode($vo['shuma'])); ?></textarea>
</td>
</tr>

<tr>
<th width="83">活动说明二<br>【标题】：</th>
<td><input style="height:30px;width:450px;" type="text" name="shumbt" value="{iMicms:$vo.shumbt}" class="px" style="width:550px;"><span style="color:red;font-weight:400;font-size:12px;">（留空则不显示此说明栏）</span></td>
</tr>
<tr>
<th valign="top">活动说明二<br>【内容】：<br /><span style="color:red;font-weight:400;font-size:12px;"></span></th>
<td valign="top"><textarea class="px" id="content1" name="shumb" style="width: 550px; height: 270px; display:none ;"><?php echo html_entity_decode(htmlspecialchars_decode($vo['shumb'])); ?></textarea>
</td>
</tr>

<tr>
<th width="83">活动说明三<br>【标题】：</th>
<td><input style="height:30px;width:450px;" type="text" name="shumct" value="{iMicms:$vo.shumct}" class="px" style="width:550px;"><span style="color:red;font-weight:400;font-size:12px;">（留空则不显示此说明栏）</span></td>
</tr>
<tr>
<th valign="top">活动说明三<br>【内容】：<br /><span style="color:red;font-weight:400;font-size:12px;"></span></th>
<td valign="top"><textarea class="px" id="content2" name="shumc" style="width: 550px; height: 270px; display:none ;"><?php echo html_entity_decode(htmlspecialchars_decode($vo['shumc'])); ?></textarea>
</td>
</tr>

<tr>
<th width="83">虚拟浏览量：</th>
<td><input style="height:30px;width:150px;" type="area" name="xncheck" value="{iMicms:$vo.xncheck}" class="px" style="width:550px;"> &nbsp;<span style="color:red;font-weight:400;font-size:12px;">首页浏览量的值为 真实浏览量+虚拟浏览量</span></td>
</tr>
<tr>
<th width="83">虚拟投票数：</th>
<td><input style="height:30px;width:150px;" type="area" name="xntps" value="{iMicms:$vo.xntps}" class="px" style="width:550px;"> &nbsp;<span style="color:red;font-weight:400;font-size:12px;">首页投票数的值为 真实投票数+虚拟投票数</span></td>
</tr>
<tr>
<th width="83">虚拟报名数：</th>
<td><input style="height:30px;width:150px;" type="area" name="xnbms" value="{iMicms:$vo.xnbms}" class="px" style="width:550px;"> &nbsp;<span style="color:red;font-weight:400;font-size:12px;">首页报名的值为 真实报名数+虚拟报名数</span></td>
</tr>
<tr>
<th width="83">无法在线报名帮助：</th>
<td valign="top"><textarea  name="wfbmbz" style="width: 350px; height: 80px; "><?php if(empty($vo['wfbmbz'])){echo "若在线报名失败，可以将报名信息：姓名+联系方式+描述+宝贝照片（1~5张，至少1张）发给我们：qq:[填写客服qq]";}else{ echo html_entity_decode(htmlspecialchars_decode($vo['wfbmbz']));} ?> </textarea>
</tr>
<tr>
<th valign="top">第三方统计代码</th>

<td valign="top"><textarea  name="cnzz" style="width: 650px; height: 170px; "><?php echo html_entity_decode(htmlspecialchars_decode($vo['cnzz'])); ?> </textarea>
</td>
</tr>
<tr>
<th width="83">首页背景音乐：</th>
<td><input style="height:30px;width:750px;" type="text" name="music" value="{iMicms:$vo.music}" class="px" style="width:550px;"></td>
 </tr>
 <tr>
<th width="83">首页顶部公告：</th>
<td><input style="height:30px;width:750px;" type="text" name="gonggao" value="{iMicms:$vo.gonggao}" class="px" style="width:550px;"></td>
 </tr>
<tr>
<th valign="top">被投票时自动通知模板</th>

<td valign="top"><textarea  name="sms_content" style="width: 650px; height: 70px; "><?php echo html_entity_decode(htmlspecialchars_decode($vo['sms_content'])); ?> </textarea>
变量类型：{frend} 好友名，{vcount}当前票数，{num}当前排名，{diffmaxcount}与第一名差距,{diffmincount}与上一名差距</td>
</tr>
<script type="text/javascript">
$(document).ready(function(){
});
//addguang
function newguang(id){
var newid=id+1;
 //  <input type="text" name="picurl_guanggao[]" value="{iMicms:$vo.picurl_guanggao}" class="px" onclick="" id="picurl_guanggao" style="width:300px;">
//<a href="#" onclick="upyunPicUpload('picurl_guanggao',700,400,'{iMicms:$token}')" class="btn btn-primary btn_submit  J_ajax_submit_btn">上传</a> 
//<a href="#" onclick="viewImg('picurl_guanggao')">预览</a>
//&nbsp;&nbsp;<a href="javascript:;" onclick="delguang(1)">删除</a>
//&nbsp;&nbsp;<a href="javascript:;" id="add2"  onclick="newguang(2)">添加</a>
var str ="<tr class='guang'><th>广告图片：</th><td>";
	str+="<input type='hidden' name='picurl_guanggao[id][]' value=''>"
	str+= "<input type=\"text\" style='height:30px;width:750px' name=\"picurl_guanggao[url][]\" id=\"picurl_guanggao_"+id+"\" value='' class='px' onclick='' style=\"width:300px;\">";
    str+=" <a href=\"#\" onclick=\"upyunPicUpload('picurl_guanggao_"+id+"',700,400,'{iMicms:$token}')\" class='btn btn-primary btn_submit  J_ajax_submit_btn'>上传</a>";
	str+=" <a href=\"#\" onclick=\"viewImg('picurl_guanggao_"+id+"')\">预览</a>";
	str+="　<a href=\"javascript:;\" onclick=\"delguang("+id+")\">删除</a>";
	str+="　<a href=\"javascript:;\" id=\"addg"+newid+"\"  onclick=\"newguang("+newid+")\">添加</a>";
	str+="</td></tr>";
	  $('#addg' + id).hide();
	$(".guang:last").after(str);
	}
//delguang
function delguang(id){
  if(1 != id){
   $("#picurl_guanggao_"+id).parent().parent().remove();
 }
 }
function delgg(id){
   var obj = {id:id}
        $.post("{iMicms::U('Vote/del_gg')}", obj,
            function(data) {
            },
        "json");
 $("#guang_"+id).remove();
}
//add intro
function addintr(index){
		$("#add_"+index+"").dialog({
		     modal: true,             // 创建模式对话框
			autoOpen:true,
			width:"600",
			height:"350",
			title : '选项简介',
			buttons: { "确定": function() { $(this).dialog("close");}},
			open : function(event, ui) {
				// 打开Dialog后创建编辑器
				$("#add_"+index+"").hide();
                 addeditor("add_"+index+"");
			},
			beforeClose : function(event, ui) {
				// 关闭Dialog前移除编辑器
                
				$("#add_intr_"+index+"").val($("#add_"+index+"").val());
				KindEditor.remove("add_"+index+"");
			}
		});
}
	//add new sub
 function newsub(next){
 var votetyp = $('#votetyp').val();
 var str=addnewsub(next,votetyp);
     nowindex= next-1;
	 nowid = "#div_add_del_"+nowindex;
  $('#add' + next).hide();
  $(nowid).after(str);
 
 }
 //del sub
 function delsub(index){
  if(1 != index){
   $("#div_add_del_"+index).remove();
 }
 }
 
function addeditor(textid){
textid="#"+textid;
var editor;
editor = KindEditor.create(textid, {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : true,
uploadJson : '/wevote/index.php?g=User&m=Upyun&a=kindedtiropic',
items :[
        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
        'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
        'anchor', 'link', 'unlink', '|', 'about'
],
afterBlur: function(){this.sync();}
});
}
//
function addnewsub(index,votetyp){
var newindex= index+1;
var str= "<tbody id='div_add_del_"+index+"' name='div_add_del'>";
    str+="<tr>";
	str+="<input type='hidden' name='add[id][]' readonly='readonly' disabled='disabled'  value='' style='width:20px;' >";
	str+="<td width='120'>";
	str+="<input type='text' name='add[item][]' value='' placeholder='请填写选项标题' class='px' style=width:120px;'>";
	str+="&nbsp&nbsp<a href='javascript:;' id='item"+index+"' name='' onclick='addintr("+index+")'>添加选项简介</a>";
    str+="</td>"; 
	str+="<td>";
    str+="<input type='text' name='add[rank][]' value='' style='width:20px;' class='px'>";
	str+="</td>";
    str+="<td>";
    str+="<input type='text' name='add[vcount][]' value='' style='width:20px;' class='px'>";
	str+="</td>";
	str+="<td style='display:none'><textarea  id='add_intr_"+index+"' name='add[intr][]' style='width: 700px; height: 120px;display:none'></textarea></td>";
    str+="<td style='display:none'><textarea  id='add_"+index+"' name='add[intr1][]' style='width: 700px; height: 120px;display:none'></textarea></td>";
	if('img'==votetyp)
	 {
	   str += "<td width='200'>";
       str += "   <img class='thumb_img' id='startpicurl_"+index+"_src' src='' style='max-height:100px;display: none;'>"; 
	   str += "	  <input type='text' name='add[startpicurl][]' placeholder='图片[http://]' value='' class='px'";
	   str += "   onclick=\"document.getElementById('startpicurl_"+index+"_src').src=this.value;\" id='startpicurl_"+index+"' style='width:130px;'>";
	   str += "   <a href='###' onclick=\"upyunPicUpload('startpicurl_"+index+"',700,400,'{iMicms:$token}')\" class='btn btn-primary btn_submit  J_ajax_submit_btn'>上传</a>";
	   str += "   <a href='###' onclick='viewImg('startpicurl_"+index+"')'>预览</a>";
	   str += "</td>";
       str += "<td width='100'><input type='text' name='add[tourl][]' value='' class='px' style='width:100px;'></td>";
	 }
     str += "<td width='50' class='norightborder'><a href='javascript:;' onclick='delsub("+index+")'>删除</a> ";
	 str += "<a href='javascript:;' id='add"+newindex+"' onclick='newsub("+newindex+")'>添加</a></td>";
	 str += "/tr";
	 str += "</tbody>";
  return str;
}

  </script>
<!-- <tr >
<th>单选/多选：<br /><span style="color:red;font-weight:400;font-size:12px;">（意思是只能帮单个人投 还是可以帮多人投）</span></th>
<td>
  <p style="width: 120px; float: left; display: block; line-height: 32px; height: 32px;">
    <select name="cknums" class="input-medium">
      <option value="1" <if condition="$vo['cknums'] eq 1">selected</if>>单选</option>
      <option value="2" <if condition="$vo['cknums'] eq 2">selected</if>>多选</option>
    </select>
</p>
     
</td>
</tr> -->
<tr>
<!-- <th width="83">投票选择：</th>
	<td>
  <div class="list">   
     <div class="fun_title">   
        <span rel="" <?php if($vo['votelimit'] == 1) {?> class="ad_on" title="点击关闭"<?php } else {?>class="ad_off" title="点击开启"<?php }?>></span><p> (想要每天可以投一票请点开启)</p>
     </div>   
   </div>  
  </td>
  </tr> -->
   <tr>
  <th width="83">参赛选手被投票时是否通知：</th>
	<td>
  <div class="list">   
     <div class="fun_title">   
        <span rel="is_sendsms" <?php if($vo['is_sendsms'] == 1) {?> class="ad_on" title="点击关闭"<?php } else {?>class="ad_off" title="点击开启"<?php }?>></span><p> </p>
     </div>   
   </div>  
  </td>
  </tr>
  <input type="hidden" name="is_sendsms" id="is_sendsms" value='<?php echo intval($vo['is_sendsms']);?>'>
  <tr>
  <th width="83">报名作品是否需要审核：</th>
	<td>
  <div class="list">   
     <div class="fun_title">   
        <span rel="is_sh" <?php if($vo['is_sh'] == 1) {?> class="ad_on" title="点击关闭"<?php } else {?>class="ad_off" title="点击开启"<?php }?>></span><p> </p>
     </div>   
   </div>  
  </td>
  </tr>
<input type="hidden" name="is_sh" id="is_sh" value='<?php echo intval($vo['is_sh']);?>'>

<tr>
<th>&nbsp;</th>
<td><button type="submit" name="button1" class="btn btn-primary btn_submit  J_ajax_submit_btn">保存</button>
<a href="{iMicms::U('Vote/index')}" class="btn">取消</a>
</td>
</tr>
</tbody>
</table>

  </div>
        </div></form>
<script type="text/javascript">
function delrow(obj, tbody,objid) {
  $$(tbody).removeChild(obj.parentNode.parentNode);
   var obj = {id:objid}
        $.post("{iMicms::U('Vote/del_tab')}", obj,
            function(data) {
            },
        "json");
}
</script>
<include file="Public:footer"/>