<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.Course.KS_CosPropLive1" Codebehind="KS.CosPropLive.aspx.cs" %>

<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="server">
<link href="/admin/images/style.css" rel="stylesheet" type="text/css" />
<link href="/admin/images/style2.css" rel="stylesheet" type="text/css" />
<link href="/admin/images/Main.css" rel="stylesheet" />
<link href="/admin/images/popup.css" rel="stylesheet" />
<script src="/ks_inc/jquery.js"></script>
<script src="/ks_inc/kesion.common.js"></script>
    <asp:Panel ID="FirstPanel" runat="server">
        
      <div class="m-Popup">
          <div class="m-index-c"> 　
			  <ul class="chooseBox clearfix">
			      <li><a href="?look=addinfo&selecttype=0&periodid=<%=KSCMS.S("periodid") %>&courseid=<%=KSCMS.S("courseid") %>"><div class="cIcon cI1"></div><div class="cItext">积分</div></a></li>
				  <li><a href="?look=addinfo&selecttype=3&periodid=<%=KSCMS.S("periodid") %>&courseid=<%=KSCMS.S("courseid") %>"><div class="cIcon cI2"></div><div class="cItext">投票</div></a></li>
                   <%if (Kesion.Cache.CommonJsonCache.CheckYunAPPHasAllow("plus.announce"))
                       { %>
				  <li><a href="?look=addinfo&selecttype=2&periodid=<%=KSCMS.S("periodid") %>&courseid=<%=KSCMS.S("courseid") %>"><div class="cIcon cI3"></div><div class="cItext">公告</div></a></li>
                  <%} %>
				  <li><a href="?look=addinfo&selecttype=4&periodid=<%=KSCMS.S("periodid") %>&courseid=<%=KSCMS.S("courseid") %>"><div class="cIcon cI4"></div><div class="cItext">考卷</div></a></li>
                  <%if (BaseFun.CheckModulePower("mall")){ %>
				  <li><a href="?look=addinfo&selecttype=5&periodid=<%=KSCMS.S("periodid") %>&courseid=<%=KSCMS.S("courseid") %>"><div class="cIcon cI5"></div><div class="cItext">商品</div></a></li>
                  <%} %>
                   <%if (Kesion.Cache.CommonJsonCache.CheckYunAPPHasAllow("plus.wenjuan"))
                       { %>
				  <li><a href="?look=addinfo&selecttype=1&periodid=<%=KSCMS.S("periodid") %>&courseid=<%=KSCMS.S("courseid") %>"><div class="cIcon cI6"></div><div class="cItext">问卷</div></a></li>
                  <%} %>
				  <li><a href="?look=addinfo&selecttype=6&periodid=<%=KSCMS.S("periodid") %>&courseid=<%=KSCMS.S("courseid") %>"><div class="cIcon cI7"></div><div class="cItext">游戏</div></a></li>
				  <li><a href="?look=addinfo&selecttype=7&periodid=<%=KSCMS.S("periodid") %>&courseid=<%=KSCMS.S("courseid") %>"><div class="cIcon cI8"></div><div class="cItext">点名</div></a></li>
			  </ul>
          </div>
      </div>
        <div class="main-button p-btnBox" style="display:none">
            <asp:Button ID="Button1" runat="server" CssClass="button" Text="下一步" OnClick="Button1_Click" />
	    </div>
		
    </asp:Panel>

    <asp:Panel ID="secondPanel" runat="server" Visible="false">
      <div class="m-Popup">
	<div class="m-TabTitle clearfix">
        <%if(type==0){ %>
		<span class="m-TabIcon1 curr">赠送积分</span>
        <%}else if(type==1){ %>
		<span class="m-TabIcon2 curr">问卷调查</span>
        <%}else if(type==2){ %>
		<span class="m-TabIcon3 curr">发布公告</span>
        <%}else if(type==3){ %>
		<span class="m-TabIcon4 curr">发布投票</span>
        <%}else if(type==4){ %>
		<span class="m-TabIcon5 curr">试卷</span>
        <%}else if(type==5){ %>
		<span class="m-TabIcon6 curr">商品链接</span>
        <%}else if(type==6){ %>
		<span class="m-TabIcon7 curr">游戏其他</span>
        <%}else if(type==7){ %>
		<span class="m-TabIcon7 curr">点名报道</span>
        <%} %>
	</div>
	<div class="m-TabCon">
        <!--通用js函数-->
        <script>
            var key = "";//搜索的关键字
            var keyid = "0";//搜索选项信息   名称或者id
            //搜索信息
            function search(p, num, type) {
                key = ""; keyid = "0";//初始化  清空数据  默认值
                switch (type) {
                    case "wenjuan"://问卷信息
                        key = document.getElementsByName("wenjuankey")[0].value;
                        if (key == "关键字") {
                            key = "";
                        }
                        for (var i = 0; i < document.getElementsByName("serachwenjuan").length; i++) {
                            var KS = document.getElementsByName("serachwenjuan")[i];
                            if (KS.checked == true) {
                                keyid = KS.value;//获取下拉的选项信息
                            }
                        }
                        showwenjuan(p, num);//ajax加载  搜索之后
                        break;
                    case "sj"://试卷信息
                        key = document.getElementsByName("sjkey")[0].value;
                        if (key == "关键字") {
                            key = "";
                        }
                        for (var i = 0; i < document.getElementsByName("searchsj").length; i++) {
                            var KS = document.getElementsByName("searchsj")[i];
                            if (KS.checked == true) {
                                keyid = KS.value;//获取下拉的选项信息
                            }
                        }
                        showsj(p, num);
                        break
                    case "shop"://商品信息
                        key = document.getElementsByName("shopkey")[0].value;
                        if (key == "关键字") {
                            key = "";
                        }
                        for (var i = 0; i < document.getElementsByName("searchshop").length; i++) {
                            var KS = document.getElementsByName("searchshop")[i];
                            if (KS.checked == true) {
                                keyid = KS.value;//获取下拉的选项信息
                            }
                        }
                        showshop(p, num)
                        break
                    case "game":
                        key = document.getElementsByName("gamekey")[0].value;
                        if (key == "关键字") {
                            key = "";
                        }
                        for (var i = 0; i < document.getElementsByName("searchgame").length; i++) {
                            var KS = document.getElementsByName("searchgame")[i];
                            if (KS.checked == true) {
                                keyid = KS.value;//获取下拉的选项信息
                            }
                        }
                        showgame(p, num);
                        break;
                    case "gonggao":
                        key = document.getElementsByName("gongagokey")[0].value;
                        if (key == "关键字") {
                            key = "";
                        }
                        for (var i = 0; i < document.getElementsByName("searchgonggao").length; i++) {
                            var KS = document.getElementsByName("searchgonggao")[i];
                            if (KS.checked == true) {
                                keyid = KS.value;//获取下拉的选项信息
                            }
                        }
                        showgonggao(this, p, num);
                        break;
                    case "vote":
                        key = document.getElementsByName("votekey")[0].value;
                        if (key == "关键字") {
                            key = "";
                        }
                        for (var i = 0; i < document.getElementsByName("searchvote").length; i++) {
                            var KS = document.getElementsByName("searchvote")[i];
                            if (KS.checked == true) {
                                keyid = KS.value;//获取下拉的选项信息
                            }
                        }
                        showtoupiao(this, p, num);
                        break;

                }

            }
            //关闭ajax
            function closeajax(type, id) {
                switch (type) {
                    case "wenjuan":
                        $("#showwenjuan").html("");//移除
                        $("#showwenjuan").hide();//隐藏
                        break;
                    case "sj":
                        $("#showsj").html("");//移除
                        $("#showsj").hide();//隐藏
                        break;
                    case "shop":
                        $("#showshop").html("");//移除
                        $("#showshop").hide();//隐藏
                        break;
                    case "game":
                        $("#showgame").html("");
                        $("#showgame").hide();
                        break;
                    case "gonggao":
                        $("#showgonggao" + id).html("");
                        $("#showgonggao" + id).hide();//隐藏绑定
                        break;
                    case "vote":
                        $("#showtoupiao" + id).html("");
                        $("#showtoupiao" + id).hide();//隐藏绑定
                        break;
                }
            }
        </script>
        <%if(type==0){ %>
	    <div >
		   <div class="p-Giftpoints">
        <!-- 道具信息--> 
               <input type="hidden" name="jifennum" id="jifennum" value="1" />
		     <table class="p-commonTable" width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
				  <td class="p-l-td">课时信息：</td>
				  <td class="p-r-td"><%=periodname %></td>
				</tr>
				<tr style="display:none;">
				  <td class="p-l-td">视频播放状态：</td>
				  <td class="p-r-td">
					  <span class="p-radioBox"><input type="radio" name="jifentype" value="1" <%=loadtype==1?"checked":"" %>><label>暂停</label></span>
					  <span class="p-radioBox"><input type="radio" name="jifentype" value="0" <%=loadtype==0?"checked":"" %>><label>播放</label></span>
				  </td>
				</tr>
				<tr>
				  <td class="p-l-td">显示持续时间：</td>
				  <td class="p-r-td">
					  <%--<i class="fr addBtnIcon" onclick="addjifen('<%=periodtimecount %>')"></i>--%>
					  <div class="p-textBox">
                          <input type="text" name="jifentime1" value="10"  style="width:60px;text-align:center;" />秒
						  <span>赠送</span><input name="getjifen1" type="text"  value="<%=bindid %>" class="textbox" style="width:50px;"><span>个积分</span>
					  </div> 
				  </td>
				</tr> 
                <tbody id="jifen">
                    
                </tbody>
			 </table>
		   </div>
		</div>
        <%}else if(type==1){ %>
		<div  >
		   <div class="p-Question">
        <!-- 问卷信息-->
               <script>
                   //显示问卷信息
                   function showwenjuan(p, num) {
                       $("#showwenjuan").show();//显示
                       jQuery.ajax({
                           type: "post",
                           url: "KS.CosPropInfo.aspx",
                           data: { action: "getwenjuan", p: p, num: num, key: key, keyid: keyid },
                           contentType: "application/x-www-form-urlencoded; charset=utf-8",
                           success: function (data) {
                               key = ""; keyid = "0";//初始化  清空数据  恢复默认值
                               $("#showwenjuan").html(data);//显示试卷信息
                           }
                       });
                   }
                   //选择题库信息
                   function selectwenjuan(num) {
                       var sid = null;
                       var name = null;
                       for (var i = 0; i < document.getElementsByName("wjid" + num).length; i++) {
                           var KS = document.getElementsByName("wjid" + num)[i];
                           var KSname = document.getElementsByName("wenjuanname" + num)[i];
                           if (KS.checked == true) {
                               sid = KS.value;
                               name = KSname.value;
                           }
                       }
                       jQuery("#wenjuanname" + num).html(name);//移除
                       jQuery("#wenjuanid" + num).val(sid);//将题库ID赋值
                       $("#showwenjuan").html("");//移除
                   }

               </script>
               <input type="hidden" name="wenjuannum" id="wenjuannum" value="1" />
		     <table class="p-commonTable" width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
				  <td class="p-l-td">课时信息：</td>
				  <td class="p-r-td"><%=periodname %></td>
				</tr>
				<tr style="display:none;">
				  <td class="p-l-td">视频播放状态：</td>
				  <td class="p-r-td">
					  <span class="p-radioBox"><input type="radio" name="wenjuantype" value="1" <%=loadtype==1?"checked":"" %>><label>暂停</label></span>
					  <span class="p-radioBox"><input type="radio" name="wenjuantype" value="0" <%=loadtype==0?"checked":"" %>><label>播放</label></span>
				  </td>
				</tr>
				<tr>
				  <td class="p-l-td">播放时间达到：</td>
				  <td class="p-r-td">
				      <%--<i class="fr addBtnIcon" onclick="addwenjuan('<%=periodtimecount %>')"></i>--%>
					  <div class="p-textBox">
                          <input type="text" name="wenjuantime1" value="10"  style="width:60px;text-align:center;" />秒
						  <span>，一次做</span><input name="worknum1" type="text" value="<%=worknum %>" class="textbox" style="width:50px;"><span>个题目</span>
						  <input type="button" value="绑定问卷" class="button" onclick="showwenjuan(1, 1)"><input type="hidden" name="wenjuanid1" id="wenjuanid1" value="<%=bindid %>" />
                              <span class="blueFont" id="wenjuanname1"><%=showmessage(bindid,type) %></span>
					  </div>
				  </td>
				</tr>
                 <tbody id="wenjuan">

                 </tbody>
                 <tbody id="showwenjuan">

                 </tbody>                 
			 </table>
		   </div>
		</div>
        <%}else if(type==2){ %>
		<div >
		   <div class="p-Notice">
        <!-- 公告信息-->
               <script>
                   //绑定公告信息
                   function showgonggao(obj, p, num) {
                       var $this = $(obj);
                       $this.addClass("setBtn").siblings().removeClass("setBtn");
                       jQuery("#sgonggaoname" + num).html("请选择绑定的公告信息");
                       jQuery('#gonggaostatus' + num).val("1");
                       jQuery('#gonggaoconten' + num).hide();
                       jQuery.ajax({
                           type: "post",
                           url: "KS.CosPropInfo.aspx",
                           data: { action: "getgonggao", p: p, num: num, key: key, keyid: keyid },
                           success: function (data) {
                               key = ""; keyid = "0";//初始化  清空数据  恢复默认值
                               $("#showgonggao" + num).html(data);//显示试卷信息
                               $("#showgonggao" + num).show();//显示绑定
                           }
                       });
                   }
                   //设置公告信息
                   function shezhigonggao(obj, id) {
                       var $this = $(obj);
                       $this.addClass("setBtn").siblings().removeClass("setBtn");
                       var gonggaoid = document.getElementsByName("addgonggaoid" + id)[0].value;
                       if (gonggaoid == 0) {
                           jQuery("#sgonggaoname" + id).html("自主设置公告信息");
                       } else {
                           jQuery("#sgonggaoname" + id).html("修改公告信息");
                       }
                       jQuery('#gonggaostatus' + id).val("0");
                       jQuery('#gonggaoconten' + id).show();
                       $("#showgonggao" + id).html("");
                       $("#showgonggao" + id).hide();//隐藏绑定
                   }
                   //选择公告信息
                   function selectgonggao(num) {
                       var sid = null;
                       var name = null;
                       for (var i = 0; i < document.getElementsByName("sgonggaoid" + num).length; i++) {
                           var KS = document.getElementsByName("sgonggaoid" + num)[i];
                           var KSname = document.getElementsByName("sgonggaoname" + num)[i];
                           if (KS.checked == true) {
                               sid = KS.value;
                               name = KSname.value;
                           }
                       }
                       jQuery("#sgonggaoname" + num).html(name);//将题库ID赋值
                       jQuery("#gonggaoid" + num).val(sid);//将题库ID赋值
                       $("#showgonggao" + num).html("");//移除
                   }
                   //确定设置公告信息以及修改公告信息
                   function addorupdategonggao(num) {
                       //公告id进行判断新增还是修改   0-新增   其他修改
                       var gonggaoid = document.getElementsByName("addgonggaoid" + num)[0].value;
                       var gonggaotitle = document.getElementsByName("gongaotitle" + num)[0].value;
                       var gonggaocontent = document.getElementsByName("gongaoIntro" + num)[0].value;
                       if (gonggaotitle == "") { alert("请填写公告标题！"); return false; }
                       if (gonggaocontent == "") { alert("请填写公告内容！"); return false; }
                       jQuery.ajax({
                           type: "post",
                           url: "?action=addgonggao&title=" + gonggaotitle + "&content=" + gonggaocontent + "&gonggaoid=" + gonggaoid,
                           success: function (data) {
                               jQuery("#gonggaoid" + num).val(data);//将公告ID赋值---存储信息使用的
                               jQuery("#addgonggaoid" + num).val(data)//将公告id赋值
                               jQuery("#sgonggaoname" + num).html(gonggaotitle);//将标题显示
                               jQuery('#gonggaoconten' + num).hide();//隐藏设置公告的信息
                               jQuery("#augonggao" + num).val("修改公告")//按钮文字变换
                           }
                       });
                   }
               </script>
               <input type="hidden" name="gonggaonum" id="gonggaonum" value="1" />
		     <table class="p-commonTable" width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
				  <td class="p-l-td">课时信息：</td>
				  <td class="p-r-td"><%=periodname %></td>
				</tr>
				<tr style="display:none;">
				  <td class="p-l-td">视频播放状态：</td>
				  <td class="p-r-td">
					  <span class="p-radioBox"><input type="radio" name="gonggaotype" value="1" <%=loadtype==1?"checked":"" %> ><label>暂停</label></span>
					  <span class="p-radioBox"><input type="radio" name="gonggaotype" value="0" <%=loadtype==0?"checked":"" %> ><label>播放</label></span>
				  </td>
				</tr>
				<tbody id="gonggao">
					<tr class="noneBorder">
					  <td class="p-l-td">播放时间达到：</td>
					  <td class="p-r-td"> 
						  <div class="p-textBox">
                          <input type="text" name="gonggaotime1" value="10"  style="width:60px;text-align:center;" />秒
							  <span>，提示公告</span>
							  <span class="TabNoticeB">
								  <span class="NoticeB setBtn" onclick="shezhigonggao(this,1)">设置公告</span><input type="hidden" name="gonggaostatus1" id="gonggaostatus1" value="0" />
								  <span class="NoticeB" onclick="showgonggao(this,1,1)">绑定公告</span><input type="hidden" name="gonggaoid1" id="gonggaoid1"  value="<%=bindid %>" />
							  </span>
                              <span class="blueFont" id="sgonggaoname1"><%=showmessage(bindid,type) %></span>
						  </div>
					  </td>
					</tr>
					<tr>
					  <td colspan="2" class="p-0">
						<table class="TabConBox" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tbody class="tabInner tabShow" id="gonggaoconten1">
                                <tr class="noneBorder">
                                <td colspan='2'class='p-0 pt-0'>
                                <div class='p-listBox'style="padding-left:0;padding-right:0;">
                                <table width='100%' border='0' cellpadding='0' cellspacing='0'>
								<tr class="noneBorder">
								  <td class="p-l-td">公告标题：<input type="hidden" name="addgonggaoid1" id="addgonggaoid1" value="<%=bindid %>" /></td>
								  <td class="p-r-td">
									  <input type="text" class="textbox" name="gongaotitle1"  value="<%=gonggaoedtitle %>"  />
								  </td>
								  <td class="p-l-td" rowspan="2" align="center" ><input type="button"  value="确定设置" id="augonggao1" class="button" onclick="addorupdategonggao(1)" /></td>
								</tr>
								<tr class="noneBorder">
								  <td class="p-l-td">公告内容：</td>
								  <td class="p-r-td">
									  <textarea class="textbox" name="gongaoIntro1" style="width:80%;height:80px"><%=gonggaoed %></textarea>
								  </td>
								</tr> 
                                </table>
                                </div>
                                </td>
                                </tr>
							</tbody>
                            <tbody id="showgonggao1" class="noneBorder"></tbody>
						</table>
					  </td>
					</tr>
				</tbody>
				<tr class="noneBorder">
				  <td class="p-l-td"></td>
				  <td class="p-r-td">
				  </td>
				</tr>
			 </table>
		   </div>
		</div>
        <%}else if(type==3){ %>
		<div >
		   <div class="p-Vote">
        <!-- 发布投票 -->
               <script>
                   //显示绑定投票信息
                   function showtoupiao(obj, p, num) {
                       var $this = $(obj);
                       $this.addClass("setBtn").siblings().removeClass("setBtn");
                       jQuery('#toupiaostatus' + num).val("1");
                       jQuery('#toupiaocontent' + num).hide();//设置的隐藏
                       jQuery.ajax({
                           type: "post",
                           url: "KS.CosPropInfo.aspx",
                           data: { action: "gettoupiao", p: p, num: num, key: key, keyid: keyid },
                           success: function (data) {
                               key = ""; keyid = "0";//初始化  清空数据  恢复默认值
                               $("#showtoupiao" + num).html(data);
                               $("#showtoupiao" + num).show();//显示绑定投票信息
                           }
                       });
                   }
                   //显示设置投票信息
                   function shezhitoupiao(obj, id) {
                       var $this = $(obj);
                       $this.addClass("setBtn").siblings().removeClass("setBtn");
                       var auvoteid = document.getElementsByName("auvoteid" + id)[0].value;
                       if (auvoteid == 0) {
                           jQuery("#toupiaoname" + id).html("自主设置投票信息");
                       } else {
                           jQuery("#toupiaoname" + id).html("修改投票信息");
                       }
                       jQuery('#toupiaostatus' + id).val("0");
                       jQuery('#toupiaocontent' + id).show();
                       $("#showtoupiao" + id).html("");
                       $("#showtoupiao" + num).hide();//隐藏绑定
                   }
                   //选择投票信息
                   function selecttoupiao(num) {
                       var sid = null;
                       var name = null;
                       for (var i = 0; i < document.getElementsByName("stoupiaoid" + num).length; i++) {
                           var KS = document.getElementsByName("stoupiaoid" + num)[i];
                           var KSname = document.getElementsByName("stoupaioname" + num)[i];
                           if (KS.checked == true) {
                               sid = KS.value;
                               name = KSname.value;
                           }
                       }
                       jQuery("#toupiaoname" + num).html(name);//将题库ID赋值
                       jQuery("#toupiaoid" + num).val(sid);//将题库ID赋值
                       $("#showtoupiao" + num).html("");//移除
                   }
                   //增加投票选项信息
                   function addanswer(id)//答案编号  从三开始
                   {
                       var str = "";
                       var aid = parseInt(jQuery('#answernum' + id).val()) + parseInt(1);//添加答案的编号
                       str += "<div class='v-option' id='ans" + id + "_" + aid + "'>";//第一个是答题编号  第二个是答案编号
                       str += "<i class='fr deleteBtnIcon' onclick='delanswer(" + id + "," + aid + ")'></i>";
                       str += "<span class='v-o-n'>(" + aid + ")</span><input type='hidden' name='answerid" + id + "_" + aid + "' id='answerid" + id + "_" + aid + "' value='0' /><input type='text' class='textbox' name='answer" + id + "_" + aid + "' /></div>";
                       if (id <= 10) {//限制答案选项的数量
                           jQuery("#answernum" + id + "-" + id).append(str);//显示新增选项信息
                           jQuery("#answernum" + id).val(parseInt(jQuery('#answernum' + id).val()) + parseInt(1));//小题答案选项数量加一
                       }
                   }
                   //删除投票选项信息 id-答题编号  aid-小题编号
                   function delanswer(id, aid)//删除选项小题
                   {
                       if (aid == jQuery("#answernum" + id).val()) {
                           jQuery('#ans' + id + "_" + aid).remove();//移除小题
                           jQuery("#answernum" + id).val(parseInt(jQuery('#answernum' + id).val()) - parseInt(1));//小题答案选项数量减一
                       }
                   }
                   //新增投票  以及修改投票
                   function adddorupdatetoupiao(num) {
                       var data = "";//传递的选项答案信息参数组
                       var Votetitle = document.getElementsByName("Votetitle" + num)[0].value;//投票标题
                       if (Votetitle == "") { alert("请填写投票的标题"); return false; }//标题校验****
                       var vote = null;//存储的投票类型
                       for (var i = 0; i < document.getElementsByName("vote" + num).length; i++)//投票类型
                       {
                           var KS = document.getElementsByName("vote" + num)[i];
                           if (KS.checked == true) {
                               vote = document.getElementsByName("vote" + num)[i].value
                           }
                       }
                       var voteid = jQuery('#auvoteid' + num).val();//投票主题的id   默认为0    其他修改
                       var votenum = jQuery('#answernum' + num).val();//投票选项的数量
                       for (var i = 1; i <= votenum; i++) {
                           if (i <= 2) {//校验前两题的答案信息
                               if (document.getElementsByName("answer" + num + "_" + i)[0].value == "")//选项校验****
                               {
                                   alert("请在出现的选项中至少两个填写答案！");
                                   return false;
                               }
                           }
                           data += "&answer" + i + "=" + document.getElementsByName("answer" + num + "_" + i)[0].value;
                           if (voteid != 0)//不等于零  修改使用的参数信息
                           {
                               data += "&answerid" + i + "=" + document.getElementsByName("answerid" + num + "_" + i)[0].value;
                           }
                       }
                       var strs = new Array();//返回的数据存储数组
                       jQuery.ajax({
                           type: "post",
                           url: "?action=addtoupiao&title=" + Votetitle + "&type=" + vote + "&voteid=" + voteid + "&votenum=" + votenum,
                           data: data,
                           success: function (data) {
                               strs = data.split("&&");
                               jQuery("#toupiaoname" + num).html(Votetitle);//将投票主题显示
                               //第一个参数是投票主题id  strs[0]
                               jQuery("#toupiaoid" + num).val(strs[0]);//将投票ID赋值---存储道具信息使用的
                               jQuery("#auvoteid" + num).val(strs[0]);//将投票主题id赋值  判断修改或新增使用
                               for (var i = 1; i <= votenum; i++) {
                                   jQuery("#answerid" + num + "_" + i).val(strs[i]);//将选项id信息保存
                               }
                               jQuery('#toupiaocontent' + num).hide();//隐藏设置投票的信息
                               jQuery("#autoupiao" + num).val("修改投票")//按钮文字变换
                           }
                       });
                   }
               </script>
               <input type="hidden" name="toupiaonum" id="toupiaonum" value="1" />
		     <table class="p-commonTable" width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
				  <td class="p-l-td">课时信息：</td>
				  <td class="p-r-td"><%=periodname %></td>
				</tr>
				<tr style="display:none;">
				  <td class="p-l-td">视频播放状态：</td>
				  <td class="p-r-td">
					  <span class="p-radioBox"><input type="radio" name="toupiaotype" value="1" <%=loadtype==1?"checked":"" %>><label>暂停</label></span>
					  <span class="p-radioBox"><input type="radio" name="toupiaotype" value="0" <%=loadtype==0?"checked":"" %>><label>播放</label></span>
				  </td>
				</tr>
				<tbody id="toupiao">
					<tr class="noneBorder">
					  <td class="p-l-td">播放时间达到：</td>
					  <td class="p-r-td">
						  <div class="p-textBox">
                          <input type="text" name="toupiaotime1" value="10"  style="width:60px;text-align:center;" />秒 
							  <span>，开始投票</span>
							  <span class="TabNoticeB">
								  <span class="NoticeB setBtn" onclick="shezhitoupiao(this,1)">设置投票</span><input type="hidden" name="toupiaostatus1" id="toupiaostatus1" value="0" />
								  <span class="NoticeB" onclick="showtoupiao(this,1,1)">绑定投票</span><input type="hidden" name="toupiaoid1" id="toupiaoid1"  value="<%=bindid %>" />
							  </span>
                              <span class="blueFont" id="toupiaoname1"><%=showmessage(bindid,type) %></span>
						  </div>
					  </td>
					</tr>
					<tr>
                       <%if(KSCMS.S("edit")=="edit"){ %>
                        <%=toupiaoed %>
                        <%}else{ %>
					  <td colspan="2" class="p-0">
                                <div class='p-listBox'style="padding-left:0;padding-right:0;">
						<table class="TabConBox" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tbody class="tabInner tabShow" id="toupiaocontent1">
								<tr class="noneBorder">
								  <td class="p-l-td">投票标题：<input type="hidden" name="auvoteid1" id="auvoteid1" value="0" /></td>
								  <td class="p-r-td">
                                     <input type="text" class="textbox" name="Votetitle1">
								  </td>
                                    <td rowspan="2" align="center"> <input type="button" class="button fr" id="autoupiao1" value="确定设置" onclick="adddorupdatetoupiao(1)" /></td>
								</tr>
								<tr class="noneBorder">
								  <td class="p-l-td">投票类型：</td>
								  <td class="p-r-td">
									  <span class="p-radioBox"><input type="radio" name="vote1" value="1" checked="checked"><label>单选</label></span>
									  <span class="p-radioBox"><input type="radio" name="vote1" value="0"><label>多选</label></span>
								  </td>
								</tr>
								<tr class="noneBorder">
								  <td class="p-l-td">投票选项：</td>
								  <td class="p-r-td" id="answernum1-1">
                                      <input type="hidden" name="answernum1" id="answernum1" value="3" /><!-- 答案选项的数量 -->
									  <div class="v-option" id="ans1_1"><span class="v-o-n">(1)</span><input type="hidden" name="answerid1_1" id="answerid1_1" /><input type="text" class="textbox" name="answer1_1" /></div>
									  <div class="v-option" id="ans1_2"><span class="v-o-n">(2)</span><input type="hidden" name="answerid1_2" id="answerid1_2" /><input type="text" class="textbox" name="answer1_2" /></div>
									  <div class="v-option" id="ans1_3"><span class="v-o-n">(3)</span><input type="hidden" name="answerid1_3" id="answerid1_3" /><input type="text" class="textbox" name="answer1_3" /></div>
								  </td>
								</tr>
                                <tr class="noneBorder">
								  <td class="p-l-td"></td>
								  <td class="p-r-td">
                                      <a href="javascript:;" class="NoticeB" onclick="addanswer(1)" style="margin-left: 30px;">增加选项</a>
								  </td>
								</tr>
							</tbody>
							<tbody class="tabInner noneBorder" id="showtoupiao1"></tbody>
						</table>
                                    </div>
					  </td>
                        <%} %>
					</tr>
				</tbody>
				<tr class="noneBorder">
				  <td class="p-l-td"></td>
				  <td class="p-r-td">
					  <div id="Div1" class="message"><span class="state"><strong>操作说明：</strong><br /></span>1.请注意设置视频播放时长<br>2.删除道具相关信息之后记得点击修改<br>3.推广链接请使用英文！</div>
				  </td>
				</tr>
			 </table>
		   </div>
		</div>
        <%}else if(type==4){ %>
		<div >
		   <div class="p-Exam">
        <!--试卷信息-->
               <script>
                   
                   //显示试卷
                   function showsj(p, num) {
                       $("#showsj").show();//显示试卷信息
                       jQuery.ajax({
                           type: "post",
                           url: "KS.CosPropInfo.aspx",
                           data: { action: "getsj", p: p, num: num, key: key, keyid: keyid },
                           success: function (data) {
                               key = ""; keyid = "0";//初始化  清空数据  恢复默认值
                               $("#showsj").html(data);//显示试卷信息
                           }
                       });
                   }
                   //选择试卷
                   function selectsj(num) {
                       var sid = null;
                       var name = null;
                       for (var i = 0; i < document.getElementsByName("ssjid" + num).length; i++) {
                           var KS = document.getElementsByName("ssjid" + num)[i];
                           var KSname = document.getElementsByName("ssjname" + num)[i];
                           if (KS.checked == true) {
                               sid = KS.value;
                               name = KSname.value;
                           }
                       }
                       if (sid == "" || sid == null) {
                           alert("您未选择试卷信息！");
                           return false;
                       }
                       jQuery("#ssjname" + num).html(name);
                       jQuery("#sjid" + num).val(sid);//将题库ID赋值
                       $("#showsj").html("");//移除
                   }
               </script>
               <input type="hidden" name="sjnum" id="sjnum" value="1" />
		     <table class="p-commonTable" width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
				  <td class="p-l-td">课时信息：</td>
				  <td class="p-r-td"><%=periodname %></td>
				</tr>
				<tr style="display:none;">
				  <td class="p-l-td">视频播放状态：</td>
				  <td class="p-r-td">
					  <span class="p-radioBox"><input type="radio" name="sjtype" value="1" <%=loadtype==1?"checked":"" %>><label>暂停</label></span>
					  <span class="p-radioBox"><input type="radio" name="sjtype" value="0" <%=loadtype==0?"checked":"" %>><label>播放</label></span>
				  </td>
				</tr>
				<tbody id="sj">
					<tr>
					  <td class="p-l-td">播放时间达到：</td>
					  <td class="p-r-td">
						  <%--<i class="fr addBtnIcon" onclick="addsj('<%=periodtimecount %>')"></i>--%>
						  <div class="p-textBox">
                          <input type="text" name="sjtime1" value="10"  style="width:60px;text-align:center;" />秒 
							  <span>，启动道具</span>
							  <span class="TabNoticeB">
								  <span class="NoticeB setBtn"  onclick="showsj(1,1)">绑定试卷</span><input type="hidden" name="sjid1" id="sjid1"  value="<%=bindid %>" />
							  </span>
                              <span class="blueFont" id="ssjname1"><%=showmessage(bindid,type) %></span>
						  </div>
					  </td>
					</tr> 
				</tbody>
                 <tbody id="showsj">

                 </tbody>
				<tr class="noneBorder">
				  <td class="p-l-td"></td>
				  <td class="p-r-td">
					  <div id="Div2" class="message"><span class="state"><strong>操作说明：</strong><br /></span>1.请注意设置视频播放时长<br>2.删除道具相关信息之后记得点击修改<br>3.推广链接请使用英文！</div>
				  </td>
				</tr>
			 </table>
		   </div>
		</div>
        <%}else if(type==5){ %>
		<div >
		   <div class="p-Shop">
        <!-- 商品链接 -->
                <script>
                   
                    //显示商品信息
                    function showshop(p, num) {
                        $("#showshop").show();//隐藏
                        jQuery.ajax({
                            type: "post",
                            url: "KS.CosPropInfo.aspx",
                            data: { action: "getshop", p: p, num: num, key: key, keyid: keyid },
                            success: function (data) {
                                key = ""; keyid = "0";//初始化  清空数据  恢复默认值
                                $("#showshop").html(data);//显示试卷信息
                            }
                        });
                    }
                    //选择商品信息
                    function selectshop(num) {
                        var sid = null;
                        var name = null;
                        for (var i = 0; i < document.getElementsByName("sshopid" + num).length; i++) {
                            var KS = document.getElementsByName("sshopid" + num)[i];
                            var KSname = document.getElementsByName("sshopname" + num)[i];
                            if (KS.checked == true) {
                                sid = KS.value;
                                name = KSname.value;
                            }
                        }
                        if (sid == "" || sid == null) {
                            alert("您未选择商品信息！");
                            return false;
                        }
                        jQuery("#shopname" + num).html(name);//将题库ID赋值
                        jQuery("#shopid" + num).val(sid);//将题库ID赋值
                        $("#showshop").html("");//移除
                    }
               </script>
               <input type="hidden" name="shopnum" id="shopnum" value="1" />
		     <table class="p-commonTable" width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
				  <td class="p-l-td">课时信息：</td>
				  <td class="p-r-td"><%=periodname %></td>
				</tr>
				<tr style="display:none;">
				  <td class="p-l-td">视频播放状态：</td>
				  <td class="p-r-td">
					  <span class="p-radioBox"><input type="radio" name="shoptype" value="1" <%=loadtype==1?"checked":"" %>><label>暂停</label></span>
					  <span class="p-radioBox"><input type="radio" name="shoptype" value="0" <%=loadtype==0?"checked":"" %>><label>播放</label></span>
				  </td>
				</tr>
				<tbody id="shop">
					<tr>
					  <td class="p-l-td">播放时间达到：</td>
					  <td class="p-r-td">
						 <%-- <i class="fr addBtnIcon" onclick="addshop('<%=periodtimecount %>')"></i>--%>
						  <div class="p-textBox">
                          <input type="text" name="shoptime1" value="10"  style="width:60px;text-align:center;" />秒  
							  <span>，启动道具</span>
							  <span class="TabNoticeB">
								  <span class="NoticeB setBtn" onclick="showshop(1,1)">商品绑定</span>
							  </span>
							  <span class="blueFont" id="shopname1"><%=showmessage(bindid,type) %></span><input type="hidden" name="shopid1" id="shopid1"  value="<%=bindid %>" />
						  </div>
					  </td>
					</tr> 
				</tbody>
                 <tbody id="showshop">

                 </tbody>
				<tr class="noneBorder">
				  <td class="p-l-td"></td>
				  <td class="p-r-td">
					  <div id="Div3" class="message"><span class="state"><strong>操作说明：</strong><br /></span>1.请注意设置视频播放时长<br>2.删除道具相关信息之后记得点击修改<br>3.推广链接请使用英文！</div>
				  </td>
				</tr>
			 </table>
		   </div>
		</div>
        <%}else if(type==6){ %>
		<div  >
		   <div class="p-Play">
        <!-- 游戏其他--> 
               <script>
                   
                    //显示游戏
                    function showgame(p, num) {
                        $("#showgame").show();//显示试卷信息
                        jQuery.ajax({
                            type: "post",
                            url: "KS.CosPropInfo.aspx",
                            data: { action: "getgame", p: p, num: num, key: key, keyid: keyid },
                            success: function (data) {
                                key = ""; keyid = "0";//初始化  清空数据  恢复默认值
                                $("#showgame").html(data);//显示试卷信息
                            }
                        });
                    }
                    //选择游戏库
                    function selectgame(num) {
                        var sid = null;
                        var name = null;
                        for (var i = 0; i < document.getElementsByName("sgameid" + num).length; i++) {
                            var KS = document.getElementsByName("sgameid" + num)[i];
                            var KSname = document.getElementsByName("sgamename" + num)[i];
                            if (KS.checked == true) {
                                sid = KS.value;
                                name = KSname.value;
                            }
                        }
                        jQuery("#gamename" + num).html(name);//将游戏库名
                        jQuery("#gameid" + num).val(sid);//将游戏库ID赋值
                        $("#showgame").html("");//移除
                    }
               </script>
               <input type="hidden" name="gamenum" id="gamenum" value="1" />
		     <table class="p-commonTable" width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
				  <td class="p-l-td">课时信息：</td>
				  <td class="p-r-td"><%=periodname %></td>
				</tr>
				<tr style="display:none;">
				  <td class="p-l-td">视频播放状态：</td>
				  <td class="p-r-td">
					  <span class="p-radioBox"><input type="radio" name="gametype" value="1" <%=loadtype==1?"checked":"" %>><label>暂停</label></span>
					  <span class="p-radioBox"><input type="radio" name="gametype" value="0" <%=loadtype==0?"checked":"" %>><label>播放</label></span>
				  </td>
				</tr>
				<tbody id="game">
					<tr>
					  <td class="p-l-td">播放时间达到：</td>
					  <td class="p-r-td">
						  <%--<i class="fr addBtnIcon" onclick="addgame('<%=periodtimecount %>')"></i>--%>
						  <div class="p-textBox">
                          <input type="text" name="gametime1" value="10"  style="width:60px;text-align:center;" />秒  
							  <span>，启动道具</span>
							  <span class="TabNoticeB">
								  <span class="NoticeB setBtn" onclick="showgame(1,1)">选择游戏库</span><input type="hidden" name="gameid1" id="gameid1"  value="<%=bindid %>" />
							  </span>
                              <span class="blueFont" id="gamename1"><%=showmessage(bindid,type) %></span>
						  </div>
					  </td>
					</tr>
				</tbody>
                 <tbody id="showgame">

                 </tbody>
				<tr class="noneBorder">
				  <td class="p-l-td"></td>
				  <td class="p-r-td">
					  <div id="Div4" class="message"><span class="state"><strong>操作说明：</strong><br /></span>1.请注意设置视频播放时长<br>2.删除道具相关信息之后记得点击修改<br>3.推广链接请使用英文！</div>
				  </td>
				</tr>
			 </table>
		   </div>
		</div>
        <%}else if(type==7){ %>
	    <div >
		   <div class="p-Giftpoints">
        <!-- 点名信息--> 
               <input type="hidden" name="callnum" id="callnum" value="1" />
		     <table class="p-commonTable" width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
				  <td class="p-l-td">课时信息：</td>
				  <td class="p-r-td"><%=periodname %></td>
				</tr>
				<tr style="display:none;">
				  <td class="p-l-td">视频播放状态：</td>
				  <td class="p-r-td">
					  <span class="p-radioBox"><input type="radio" name="calltype" value="1" <%=loadtype==1?"checked":"" %>><label>暂停</label></span>
					  <span class="p-radioBox"><input type="radio" name="calltype" value="0" <%=loadtype==0?"checked":"" %>><label>播放</label></span>
				  </td>
				</tr>
				<tr>
				  <td class="p-l-td">显示持续时间：</td>
				  <td class="p-r-td">
					  <%--<i class="fr addBtnIcon" onclick="addjifen('<%=periodtimecount %>')"></i>--%>
					  <div class="p-textBox">
                          <!--持续时间 -->
                          <input type="text" name="call1"  style="width:60px;text-align:center;" value="10" /> 秒
                           
						  <span>签到成功，奖励</span><input name="getcall1" type="text"  value="<%=bindid %>" class="textbox" style="width:50px;"><span>个<%=MyCache.GetCacheConfig(90) %></span>
					  </div>
				  </td>
				</tr>
				<tr class="noneBorder"> 
				  <td class="p-r-td" colspan="2">
					  <div class="message"><span class="state"><strong>操作说明：</strong><br /></span>为零时不奖励<br></div>
				  </td>
				</tr>
			 </table>
		   </div>
		</div>
        <%} %>
	</div>
          <input type="hidden" name="addtype" value="<%=type %>" />
         <input type="hidden" name="action" value="<%=action %>" />
        <textarea name="propinfocontent" id="propinfocontent" style="display:none" ></textarea> 
        <div style="height:55px;"></div>
    <div class="main-button p-btnBox">
		<input type="submit" value="<%=button  %>" class="button" onclick="return(check());">
		<input type="button" value="取消返回(C)" class="button" onclick="parent.box.close();" >
	</div>
</div>
    </asp:Panel>
    <script>
        $(function () {
            $('.m-TabCon').show();
        })
</script>
    <script>
        var shifoutianjia = 1;//校验时间点标志判断能否增加数据库信息
        //var propnum = 0;//存储道具的总使用次数
        var propinfo = "";//存储的道具使用信息
        var time = "0";//存储的时间点
        //var status = 1;//是否提交的标志
        //校验数据
        function check()//校验提交表单
        {
            shifoutianjia = 0;
            //校验积分
        <%if(type==0){ %>
            if (shifoutianjia == 0) {
                checkjifen();
            }
        <%}else if(type==1){ %>
            //校验问卷
            if (shifoutianjia == 0) {
                checkwenjuan();
            }
        <%}else if(type==2){ %>
            //校验公告
            if (shifoutianjia == 0) {
                checkgonggao();
            }
        <%}else if(type==3){ %>
            //校验投票
            if (shifoutianjia == 0) {
                checktoupiao();
            }
        <%}else if(type==4){ %>
            //校验试卷
            if (shifoutianjia == 0) {
                checksj();
            }
        <%}else if(type==5){ %>
            //校验商品
            if (shifoutianjia == 0) {
                checkshop();
            }
        <%}else if(type==6){ %>
            //校验游戏
            if (shifoutianjia == 0) {
                checkgame();
            }
        <%} if(type==7){%>
            if (shifoutianjia == 0) {
                checkCall();
            }
        <%}%>
            //是否提交  from表单
            if (shifoutianjia == 1) {
                return false;
            } else {
                //构造的数据存储   可以提交前赋值
                jQuery("#propinfocontent").html(propinfo);
                console.log(propinfo);
                //alert(propinfo + "***")
                return true;
            }
        }
        //校验积分相关信息
        function checkjifen() {
            if (document.getElementsByName("jifentime1")[0].value != 0) {//触发时间点不为0
                for (var i = 0; i < document.getElementsByName("jifentype").length; i++)//投票类型
                {
                    var KS = document.getElementsByName("jifentype")[i];
                    if (KS.checked == true) {
                        propinfo += document.getElementsByName("jifentype")[i].value + "@@@";
                    }
                }
                //获取积分赠送数量
                var jifennum = jQuery('#jifennum').val();
                //propinfo += jifennum + "@@@";
                //校验时间点----**************
                var checktime = new Array();

                if (jifennum >= 1) {//如果积分道具的数量大于1
                    for (var i = 1; i <= jifennum; i++) {
                        var jifentime = document.getElementsByName("jifentime" + i)[0].value;
                        checktime = time.split(",");
                        time += "," + jifentime;
                        var getjifen = document.getElementsByName("getjifen" + i)[0].value;
                        if (parseInt(getjifen) == 0) {
                            shifoutianjia = 1;
                            propinfo = "";//清空数据
                            time = "";//清空时间点
                            alert("请填写正确的获取的积分信息！"); break;
                        }
                        propinfo += jifentime + "&&";
                        propinfo += getjifen + "&#&";
                    }
                }
                if (shifoutianjia == 0) {
                    propinfo += "#####";
                }
            } else {
                shifoutianjia = 1;
                alert("请选择时间信息！");
            }
        }
        //校验问卷调查
        function checkwenjuan() {
            if (document.getElementsByName("wenjuantime1")[0].value != 0) {
                for (var i = 0; i < document.getElementsByName("wenjuantype").length; i++)//投票类型
                {
                    var KS = document.getElementsByName("wenjuantype")[i];
                    if (KS.checked == true) {
                        propinfo += document.getElementsByName("wenjuantype")[i].value + "@@@";
                    }
                }
                var wenjuannum = jQuery('#wenjuannum').val();
                //propinfo += wenjuannum + "@@@";//修改需要
                //校验时间点----**************
                var checktime = new Array();
                if (wenjuannum >= 1) {
                    for (var i = 1; i <= wenjuannum; i++)//循环问卷记录数
                    {
                        checktime = time.split(",");
                        var wenjuantime = document.getElementsByName("wenjuantime" + i)[0].value;//问卷出现的时间
                        var worknum = document.getElementsByName("worknum" + i)[0].value;//每次做题数量
                        var wenjuanid = document.getElementsByName("wenjuanid" + i)[0].value;//绑定问卷库的id
                        propinfo += wenjuantime + "&&";
                        if (wenjuanid == "" || worknum == "" || wenjuanid == "0" || worknum == "0") {
                            shifoutianjia = 1;
                            propinfo = "";//清空数据
                            time = "";//清空时间点
                            alert("请先填写问卷相关信息！"); break;
                        } else {
                            propinfo += wenjuanid + "&&";
                            propinfo += worknum + "&#&";
                        }
                    }
                }
                if (shifoutianjia == 0) {
                    propinfo += "#####";
                }
            } else {
                shifoutianjia = 1;
                alert("请选择时间信息！");
            }
        }
        //校验公告
        function checkgonggao() {
            if (document.getElementsByName("gonggaotime1")[0].value != 0) {

                for (var i = 0; i < document.getElementsByName("gonggaotype").length; i++)//投票类型
                {
                    var KS = document.getElementsByName("gonggaotype")[i];
                    if (KS.checked == true) {
                        propinfo += document.getElementsByName("gonggaotype")[i].value + "@@@";
                    }
                }
                var gonggaonum = jQuery('#gonggaonum').val();
                //propinfo += gonggaonum + "@@@";//修改需要
                //校验时间点----**************
                var checktime = new Array();
                if (gonggaonum >= 1) {
                    for (var i = 1; i <= gonggaonum; i++)//循环问卷记录数
                    {
                        checktime = time.split(",");
                        var gonggaotime = document.getElementsByName("gonggaotime" + i)[0].value;//问卷出现的时间
                        var gonggaoid = document.getElementsByName("gonggaoid" + i)[0].value;//绑定问卷库的id
                         
                        if (shifoutianjia == 0)//校验时间点标志
                        {
                            time += "," + gonggaotime;
                            if (gonggaoid == "" || gonggaoid == "0" || gonggaotime == "0") {
                                shifoutianjia = 1;
                                propinfo = "";//清空数据
                                time = "";//清空时间点
                                alert("请绑定公告！"); break;
                            } else {
                                propinfo += gonggaotime + "&&";
                                propinfo += gonggaoid + "&#&";
                            }
                        }
                    }
                }
                if (shifoutianjia == 0) {
                    propinfo += "#####";
                }
            } else {
                shifoutianjia = 1;
                alert("请选择时间信息！");
            }
        }
        //校验投票
        function checktoupiao() {
            if (document.getElementsByName("toupiaotime1")[0].value != 0) {
                for (var i = 0; i < document.getElementsByName("toupiaotype").length; i++)//投票类型
                {
                    var KS = document.getElementsByName("toupiaotype")[i];
                    if (KS.checked == true) {
                        propinfo += document.getElementsByName("toupiaotype")[i].value + "@@@";
                    }
                }
                var toupiaonum = jQuery('#toupiaonum').val();
                //propinfo += toupiaonum + "@@@"; //数量
                //校验时间点----**************
                var checktime = new Array();
                if (toupiaonum >= 1) {
                    for (var i = 1; i <= toupiaonum; i++)//循环问卷记录数
                    {
                        checktime = time.split(",");
                        var toupiaotime = document.getElementsByName("toupiaotime" + i)[0].value;//问卷出现的时间
                        var toupiaoid = document.getElementsByName("toupiaoid" + i)[0].value;//绑定问卷库的id
                        if (shifoutianjia == 0) {
                            //判断公告是自己设置的还是绑定的
                            time += "," + toupiaotime;
                            propinfo += toupiaotime + "&&";
                            if (toupiaoid == "" || toupiaoid == "0") {
                                shifoutianjia = 1;
                                propinfo = "";//清空数据
                                time = "";//清空时间点
                                alert("请绑定投票！"); break;
                            } else {
                                propinfo += toupiaoid + "&#&";
                            }
                        }
                    }
                }
                if (shifoutianjia == 0) {
                    propinfo += "#####";
                }
            } else {
                shifoutianjia = 1;
                alert("请选择时间信息！");
            }
        }
        //校验试卷
        function checksj() {
            if (document.getElementsByName("sjtime1")[0].value != 0) {
                for (var i = 0; i < document.getElementsByName("sjtype").length; i++)//投票类型
                {
                    var KS = document.getElementsByName("sjtype")[i];
                    if (KS.checked == true) {
                        propinfo += document.getElementsByName("sjtype")[i].value + "@@@";
                    }
                }
                var sjnum = jQuery('#sjnum').val();
                //propinfo += sjnum + "@@@";//修改需要
                //校验时间点----**************
                var checktime = new Array();//时间点数组
                if (sjnum >= 1) {
                    for (var i = 1; i <= sjnum; i++)//循环问卷记录数
                    {
                        checktime = time.split(",");
                        shifoutianjia = 1;//校验时间点标志
                        var sjtime = document.getElementsByName("sjtime" + i)[0].value;//问卷出现的时间
                        var sjid = document.getElementsByName("sjid" + i)[0].value;//绑定问卷库的id
                        for (var p = 0; p < checktime.length; p++)//校验时间点
                        {
                            if (sjtime == checktime[p]) {//时间点相同
                                shifoutianjia = 1;
                                propinfo = "";//清空数据
                                time = "";//清空时间点
                                alert("试卷中道具使用的时间点与前面使用过的时间点冲突！");
                                break;
                            } else {
                                shifoutianjia = 0;
                            }
                        }
                        if (shifoutianjia == 0) {
                            time += "," + sjtime;
                            propinfo += sjtime + "&&";
                            if (sjid == "" || sjid == "0" || sjtime == "0") {
                                shifoutianjia = 1;
                                propinfo = "";//清空数据
                                time = "";//清空时间点
                                alert("请绑定问卷！"); break;
                            } else {
                                propinfo += sjid + "&#&";
                            }
                        }
                    }
                }
                if (shifoutianjia == 0) {
                    propinfo += "#####";
                }
            } else {
                shifoutianjia = 1;
                alert("请选择时间信息！");
            }
        }
        //校验商品
        function checkshop() {
            if (document.getElementsByName("shoptime1")[0].value != 0) {
                for (var i = 0; i < document.getElementsByName("shoptype").length; i++)//投票类型
                {
                    var KS = document.getElementsByName("shoptype")[i];
                    if (KS.checked == true) {
                        propinfo += document.getElementsByName("shoptype")[i].value + "@@@";
                    }
                }

                var shopnum = jQuery('#shopnum').val();
                //propinfo += shopnum + "@@@";//修改需要
                //校验时间点----**************
                var checktime = new Array();//时间点数组
                if (shopnum >= 1) {
                    for (var i = 1; i <= shopnum; i++)//循环问卷记录数
                    {
                        shifoutianjia = 1;
                        checktime = time.split(",");
                        var shoptime = document.getElementsByName("shoptime" + i)[0].value;//问卷出现的时间
                        var shopid = document.getElementsByName("shopid" + i)[0].value;//绑定问卷库的id
                        for (var p = 0; p < checktime.length; p++)//校验时间点
                        {
                            if (shoptime == checktime[p]) {//时间点相同
                                shifoutianjia = 1;
                                propinfo = "";//清空数据
                                time = "";//清空时间点
                                alert("商品链接中道具使用的时间点与前面使用过的时间点冲突！");
                                break;
                            } else {
                                shifoutianjia = 0;
                            }
                        }
                        if (shifoutianjia == 0) {
                            time += "," + shoptime;
                            propinfo += shoptime + "&&";
                            if (shopid == "" || shopid == "0" || shoptime == "0") {
                                shifoutianjia = 1;
                                propinfo = "";//清空数据
                                time = "";//清空时间点
                                alert("请绑定商品！"); break;
                            } else {
                                propinfo += shopid + "&#&";
                            }
                        }
                    }
                }
                if (shifoutianjia == 0) {
                    propinfo += "#####";
                }
            } else {
                shifoutianjia = 1;
                alert("请选择时间信息！");
            }
        }
        //校验游戏
        function checkgame() {
            if (document.getElementsByName("gametime1")[0].value != 0) {
                for (var i = 0; i < document.getElementsByName("gametype").length; i++)//投票类型
                {
                    var KS = document.getElementsByName("gametype")[i];
                    if (KS.checked == true) {
                        propinfo += document.getElementsByName("gametype")[i].value + "@@@";
                    }
                }
                var gamenum = jQuery('#gamenum').val();
                //propinfo += gamenum + "@@@";//修改需要
                //校验时间点----**************
                var checktime = new Array();//时间点数组
                if (gamenum >= 1) {
                    for (var i = 1; i <= gamenum; i++)//循环问卷记录数
                    {
                        shifoutianjia = 1;
                        checktime = time.split(",");
                        var gametime = document.getElementsByName("gametime" + i)[0].value;//问卷出现的时间
                        var gameid = document.getElementsByName("gameid" + i)[0].value;//绑定问卷库的id
                        for (var p = 0; p < checktime.length; p++)//校验时间点
                        {
                            if (gametime == checktime[p]) {//时间点相同
                                shifoutianjia = 1;
                                propinfo = "";//清空数据
                                time = "";//清空时间点
                                alert("游戏其他中道具使用的时间点与前面使用过的时间点冲突！");
                                break;
                            } else {
                                shifoutianjia = 0;
                            }
                        }
                        if (shifoutianjia == 0) {
                            time += "," + gametime;
                            propinfo += gametime + "&&";
                            if (gameid == "" || gameid == "0" || gametime == "0") {
                                shifoutianjia = 1;
                                propinfo = "";//清空数据
                                time = "";//清空时间点
                                alert("请绑定游戏！"); break;
                            } else {
                                propinfo += gameid + "&#&";
                            }
                        }
                    }
                }
                if (shifoutianjia == 0) {
                    propinfo += "#####";
                }
            } else {
                shifoutianjia = 1;
                alert("请选择时间信息！");
            }
        }

        //校验点名相关信息
        function checkCall() {
            if (document.getElementsByName("call1")[0].value != 0) {//触发时间点不为0
                //直播是时间点  只有持续时间  不存在时间点的问题了
                 propinfo += document.getElementsByName("calltype")[0].value + "@@@";
                //获取积分赠送数量
                var callnum = jQuery('#callnum').val();
                //propinfo += jifennum + "@@@";
                //校验时间点----**************
                var checktime = new Array();
                if (callnum >= 1) {//如果积分道具的数量大于1
                    for (var i = 1; i <= callnum; i++) {
                        var calltime = document.getElementsByName("call" + i)[0].value;
                        shifoutianjia = 0;//校验时间点标志
                        //去掉时间点校验的问题 
                        var getcall = document.getElementsByName("getcall" + i)[0].value;
                        //去掉奖励校验
                        propinfo += calltime + "&&";
                        propinfo += getcall + "&#&"; 
                         
                    }
                }
                if (shifoutianjia == 0) {
                    propinfo += "#####";
                }
            } else {
                shifoutianjia = 1;
                alert("请填写持续时间信息！");
            }
        }

    </script>


</asp:Content>