<%@ Control Language="C#" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.HtmlTags" %>
<%@ Import Namespace="Kesion.APPCode" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Kesion.Course" %>
<%@ Import Namespace="Kesion.Components" %>
<%@ Import Namespace="System.Xml" %>
<script runat="server" type="text/C#">
    dynamic __user = HttpContext.Current.Items["user"];                //初始化用户信息，
    private static  dynamic __info = new System.Dynamic.ExpandoObject();   //初始化当前页信息
    bool isLoadPage = true;  //定义页面是否加载
    public string KejianID = string.Empty;
    public string KeJianUrl = string.Empty;
    public string sqlParam = "";
    public int t_free = 0;
    public EpConfig ep = new EpConfig();
    public int CurrPage = new BasicField().GetCurrPage;
    public int PageSize = 14;
    public int recordcount, pagecount;
    public int verify = 0;
    public int system = 0;
    public int pid = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        Course.CheckMVCVerify("Teacher/CourseList");//判断权限
        if (__user.GroupID == 4)
        {
            sqlParam = "KS_Course Where TeachWay=5 and username='" + __user.UserName + "'";
            system = 2;
        }
        else
        {
            system = 1;
            sqlParam = "KS_Course Where TeachWay=5 and schoolid=" + __user.UserID;
        }
        __info.t_count = Utils.StrToInt(DataFactory.GetOnlyValue("select count(1) from KS_Course where TeachWay=5 and  username='" + __user.UserName + "'"));
        infoInitial();
        if (KSCMS.S("action").Equals("save"))
        {
            saveCourse();
        }
        if (KSCMS.S("action").Equals("getsj"))
        {
            GetSJ();
        }
        if (KSCMS.S("action").Equals("del"))
        {
            deleteSj(KSCMS.S("ids"));
        }
        string DoMethod = KSCMS.S("do");

        switch (DoMethod)
        {
            case "add":
                if (!EnterPrise.GetTotal("live", 0))
                {
                    Msg.Alert("对不起，您添加的课程数量已达到上限!", KSCMS.GetComeUrl());
                    isLoadPage = false;
                    return;
                }
                break;
            case "verify":
                DataFactory.ExecuteNonQuery("UPDATE [KS_Course] SET [verify] = 0 WHERE system=2 and  courseid =" + __info.courseid);
                KSCMS.Redirect(KSCMS.GetComeUrl());
                break;
            case "modify":
                initialEdit(__info.courseid); //编辑
                break;
            case "del":
            case "delete":
                deleteSj(__info.courseid.ToString());
                break;
            case "getsj":
                GetSJ();
                break;
            case "sell":
                //操作上下架
                CommonData.UpdateFieldStatus("KS_Course", "IsOff", "courseid", Utils.StrToInt(KSCMS.S("courseid")));
                Msg.Alert("操作成功", BasicField.GetUserUrl("teacher/LiveList"));
                break;
        }


        string sql = "select top 1 DefaultPic,free,courseClass from KS_enterprise where userid=" + new TemporaryVar().UserID;
        if (new TemporaryVar().GroupID == 4)
        {
            sql = "select top 1  FaceClass,CourseClass,ExamClass from KS_CosTeacher where userid=" + new TemporaryVar().UserID;
        }
        using (DataTable dt = DataFactory.GetDataTable(sql))
        {
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                if (string.IsNullOrEmpty(dr["courseClass"].ToString()) && new TemporaryVar().SchoolID == 0)
                {
                    Msg.Alert("请先设置网授的分类", BasicField.GetUserUrl("teacher/CsMemberClass"));

                }
            }
        }
    }

    protected void saveCourse()
    {
        Utils.TipsDisabled();  //检查是否演示状态
        Hashtable ht = new Hashtable();
        ht.Add("system", system);
        ht.Add("ClassID", Utils.StrToInt(__info.ClassID));
        /** 多课程分类选择  ***/
        string proids = string.Empty;

        ht.Add("MoreClass", __info.MoreClass); //多课程分类
        /** 多课程分类选择  ***/

        ht.Add("tcid", __info.tcid);

        ht.Add("IsOtherTc", Utils.StrToInt(__info.IsOtherTc)); //是否有其他教师    

        if (Utils.StrToInt(__info.IsOtherTc) == 0)
        {
            ht.Add("TeacherName", "");//其他教师名称
        }
        else
        {
            ht.Add("TeacherName", Utils.RemoveXss(__info.techertest));//其他教师名称
        }
        ht.Add("teacher", BaseFun.GetTeacher(KSCMS.S("teacherlist")));  //主教

        ht.Add("cityid", __info.CityId);
        ht.Add("Provinceid", __info.Provinceid);
        ht.Add("CountyId", __info.CountyId);
        ht.Add("name", __info.TxtName);
        if (string.IsNullOrEmpty(__info.TxtShortName))
        {
            ht.Add("ShortName", Utils.CutStr(__info.TxtName, 100));//短课程名称（新增加的字段）
        }
        else
        {
            ht.Add("ShortName", __info.TxtShortName);//短课程名称（新增加的字段）
        }
        ht.Add("Intro", (__info.TxtIntro));
        ht.Add("Target", (__info.TxtTarget));
        ht.Add("Notice", (__info.TxtNotice));

        ht.Add("recommend", 0);
        ht.Add("popular", 0);
        ht.Add("istop", 0);
        ht.Add("huandeng", 0);
        ht.Add("comment", 0);
        ht.Add("tryout", 0);
        ht.Add("is3g", 1);
        ht.Add("TeachWay", 5);  //授课方式 1为网上授课 0为面授
        ht.Add("shixian", Utils.StrToInt(__info.shixian));//有效期
        ht.Add("seotitle", Utils.RemoveXss(__info.TxtName));
        ht.Add("listeningID", Utils.RemoveXss(__info.listeningID));  //试听
        #region 服务统一管理
        ht.Add("liveType", __info.LiveType);
        ht.Add("accountid", KSCMS.S("accountid"));
        #endregion
        ht.Add("IsExam", 1);//是否有试卷


        if (Utils.StrToInt(__info.regulations) > 100)
        {
            ht.Add("regulations", 100);
        }
        else if (Utils.StrToInt(__info.regulations) <= 0)
        {
            ht.Add("regulations", 0);
        }
        else
        {
            ht.Add("regulations", Utils.StrToInt(__info.regulations));
        }
        #region 报名时间段
        ht.Add("bmbegintime", __info.bmbegintime);//开始
        ht.Add("bmendtime", __info.bmendtime);//结束
        #endregion
        ht.Add("zhekou", __info.zhekou);   //折扣
        ht.Add("Money", Utils.StrToFloat(__info.Money)); //参考价
        ht.Add("Price_Member", Utils.StrToFloat(__info.Price_Member)); //市场价
        #region 设置VIP
        if (Utils.StrToInt(__info.Promotion) == 3)
        {
            #region 设置VIP
            ht.Add("ISLoad", Utils.StrToInt(__info.ISLoad));
            if (__info.ISLoad == "1")
            {
                if (Utils.StrToFloat(__info.Loadzhekou) < 0)
                {
                    __info.Loadzhekou = "0";
                }
                else if (Utils.StrToFloat(__info.Loadzhekou) > 10)
                {
                    __info.Loadzhekou = "10";
                }

                ht.Add("Loadzhekou", Utils.StrToFloat(__info.Loadzhekou));
                ht.Add("FixedPrice", 0);
            }
            else if (__info.ISLoad == "0")
            {
                ht.Add("Loadzhekou", 0);
                ht.Add("FixedPrice", 0);
            }
            else if (__info.ISLoad == "2")
            {
                ht.Add("Loadzhekou", 0);
                ht.Add("FixedPrice", Utils.StrToFloat(__info.FixedPrice));
            }
            #endregion
        }
        else
        {
            #region 积分设置VIP
            if (Utils.StrToInt(__info.IsVip) == 3)
            {
                ht.Add("ISLoad", 0);//VIP免费
            }
            else
            {
                ht.Add("ISLoad", -1);
            }
            #endregion
        }
        #endregion
        #region 促销类型  普通课程才有捆绑销售
        if (Utils.StrToInt(__info.Promotion) == 1)
        {
            #region  限时抢购
            ht.Add("begintime", __info.begintime);//开始
            ht.Add("endtime", __info.endtime);//结束
            ht.Add("isBind", 0);
            ht.Add("PanicMoney", Utils.StrToFloat(__info.PanicMoney));//抢购价
            ht.Add("Limited", Utils.StrToInt(__info.Limited));//报名人数上限
            #endregion
        }
        else if (Utils.StrToInt(__info.Promotion) == 2)
        {
            ht.Add("isBind", 0);
            ht.Add("PanicMoney", Utils.StrToFloat(__info.PanicMoney));//团购价
            ht.Add("Limited", Utils.StrToInt(__info.Limited));//报名人数上限
        }
        else if (Utils.StrToInt(__info.Promotion) == 3)
        {
            #region  积分

            ht.Add("isBind", 0);
            ht.Add("PanicMoney", 0);//抢购价
            ht.Add("jifen", Utils.StrToInt(__info.jifen));//积分
            #endregion
        }
        ht.Add("Promotion", Utils.StrToInt(__info.Promotion));//促销类型
        #endregion
        ht.Add("buylimit", __info.buylimit);//限购人数
        ht.Add("photourl", Utils.ChkSQL(__info.DefaultPic));//图片
        ht.Add("IsOff", __info.RBIsOff);//出售方式    
        #region  课时    
        Hashtable ht2 = new Hashtable();
        if (__info.RadioButtonList4 == "0")
        {
            ht2.Add("type", 0);
            ht2.Add("PeriodName", __info.TxtName);
            ht2.Add("Addtype", 4);
            ht2.Add("ParentID", 0);
            ht2.Add("orderid", 1);
            ht2.Add("isexample", KSCMS.S("LiveType"));
            ht.Add("liveid", KSCMS.S("LiveVideoID"));  //直播ID和UID
            ht2.Add("liveid", KSCMS.S("LiveVideoID"));  //直播ID和UID
            ht2.Add("LiveTime", KSCMS.S("LiveTime"));
            ht2.Add("IsLogin",Utils.StrToInt(KSCMS.S("IsLogin")));
            ht2.Add("InvalidDate", KSCMS.S("InvalidDate"));
            if (__info.RadioLiveStatus == "2")
            {
                ht2.Add("Url", __info.TxtUrl.ToString());//链接地址			
            }
            ht2.Add("status", KSCMS.S("RadioLiveStatus"));

            if (__info.RadioButtonList2 == "2")
            {
                ht2.Add("IsFree", 1);
            }
            else
            {
                ht2.Add("IsFree", Utils.StrToInt(__info.RadioButtonList2));//是否免费
            }
            if (__info.LiveType == "0")
            {
                ht2.Add("OtherVideo", KSCMS.S("TxtOrherVideo"));
                ht2.Add("IsMobileLivePlayerJS", KSCMS.S("TxtIsMobileLivePlayerJS"));
            }
        }
        #endregion
        if (BaseFun.CheckFieldExists("KS_Course", "IsSendNote"))   //是否邮寄资料
        {
            ht.Add("IsSendNote", Utils.StrToInt(__info.IsSendNote1));
            ht.Add("NotePrice", Utils.StrToDecimal(Utils.StrToDecimal(__info.NotePrice).ToString("f2")));   //保留2位小数
            ht.Add("NoteContent", __info.NoteContent);
            ht.Add("IsContainTax", Utils.StrToFloat(__info.IsContainTax1));
        }
        if (KSCMS.S("do").Equals("add"))
        {
             ht.Add("IsPeriod", __info.RadioButtonList4);//是否开启课时
            ht.Add("IsFree", Utils.StrToInt(__info.RadioButtonList2));//是否免费
            ht.Add("ChargePeriod", 1);//1不允许设置课时的价格
            Kesion.Controls.CustomFields.DoSchoolFieldSave(ref ht, "course");
            ht.Add("userid", __user.UserID);
            ht.Add("username", __user.UserName);//后台管理者
            DateTime _time = DateTime.Now;
            ht.Add("addTime", _time);
            #region 判断是否超过限制课程数
            string channelPasswd = Utils.RndNumber(6);
            string uid = string.Empty;
            string channelId = string.Empty;
            if (EnterPrise.GetTotal("live", 70))
            {
                CommonData.Insert("KS_Course", ht);
                int courseId = Utils.StrToInt(CommonData.GetMaxId("KS_Course", "courseid"));
                #region 课时
                if (__info.RadioButtonList4 == "0")//没有课时隐形加入课时表的
                {
                    ht2.Add("AddDate", DateTime.Now);
                    ht2.Add("UserName", __user.UserName);
                    ht2.Add("CourseID",courseId );
                    CommonData.Insert("KS_CoslivePeriod", ht2);
                   DataFactory.ExecuteNonQuery("UPDATE KS_Course set livestate=" + Utils.StrToInt(KSCMS.S("RadioLiveStatus")) + " WHERE CourseID=" + courseId);//更新课程的直播状态

                }
                #endregion
                if (ep.GetEpConfig(8) == "0" || Teacher.TcAddIsVeryfy("course") == "0")  //bu需要审核
                {
                    EnterPrise.AddInorOutScore("course", "liveadd", __user.UserName, __user.UserID);
                }

                if (__user.GroupID == 3 || __user.GroupID == 3 && new TemporaryVar().SchoolID > 0)
                {
                    int   uidd = new TemporaryVar().SchoolID;
                    if (__user.GroupID == 3)
                    {
                        uidd = new TemporaryVar().UserID; ;
                    }
                    DataFactory.ExecuteNonQuery("UPDATE [KS_EnterPrise] SET [LiveTotal] = [LiveTotal] + 1 WHERE UserId = " + uidd );

                }

                Kesion.Course.Course.UpdateCourseInfo(courseId.ToString(), 5);  //更新课程数据

                Msg.Alert("恭喜,直播课程添加成功!", BasicField.GetUserUrl("teacher/livelist"));
                isLoadPage = false;
                return;
            }
            else
            {
                Msg.Alert("发布直播课程已达到上限!", BasicField.GetUserUrl("teacher/livelist"));
                isLoadPage = false;
                return;
            }
            #endregion

        }
        else
        {
            #region 课时
            if (__info.RadioButtonList4 == "0")//没有课时隐形加入课时表的
            {
                ht2.Add("CourseID", __info.courseid);
                if (DataFactory.Exists("KS_CoslivePeriod", " Addtype=4 and CourseID=" + __info.courseid))
                {
                  
                    CommonData.Update("KS_CoslivePeriod", ht2, "where Addtype=4 and CourseID="+__info.courseid);
                    DataFactory.ExecuteNonQuery("UPDATE KS_Course set livestate=" + Utils.StrToInt(KSCMS.S("RadioLiveStatus")) + " WHERE CourseID=" + __info.courseid);//更新课程的直播状态

                }
                else
                {
                    ht2.Add("AddDate", DateTime.Now);
                    ht2.Add("UserName", __user.UserName);
                    CommonData.Insert("KS_CoslivePeriod", ht2);
                   DataFactory.ExecuteNonQuery("UPDATE KS_Course set livestate=" + Utils.StrToInt(KSCMS.S("RadioLiveStatus")) + " WHERE CourseID=" + __info.courseid);//更新课程的直播状态

                }

            }
            #endregion
            Kesion.Controls.CustomFields.DoSchoolFieldSave(ref ht, "edit");

            CommonData.Update("KS_Course", ht, "where CourseId=" + __info.courseid);

            #region 更新课时的收费状态
            if (Utils.StrToInt(__info.RadioButtonList2) == 0)
            {
                #region 免费
                DataFactory.ExecuteNonQuery("update KS_CoslivePeriod set IsFree=0 where CourseId=" + __info.courseid);

                #endregion
            }
            else if (Utils.StrToInt(__info.RadioButtonList2) == 1)
            {
                #region 收费
                if (Utils.StrToFloat(__info.Money) <= 0 && Utils.StrToFloat(__info.Price_Member) <= 0)
                {
                    DataFactory.ExecuteNonQuery("update KS_CoslivePeriod set IsFree=0 where CourseId=" + __info.courseid);

                }
                #endregion
            }
            #endregion
            Kesion.Course.CourseBuyRecordCache.CleanUserCosJson(__info.courseid);
            Kesion.Course.Course.UpdateCourseInfo(__info.courseid.ToString(), 5);  //更新课程数据
            Msg.Alert("恭喜,直播课程修改成功!", BasicField.GetUserUrl("teacher/livelist"));
            isLoadPage = false;
            return;
        }
    }
    private void deleteSj(string CourseId)
    {
        if (CourseId == null || CourseId == "0") return;
        CourseId = Utils.FilterIDs(CourseId);
        string result=Kesion.Course.Course.DeleteCourse(CourseId,true,false,true,__user.UserID);  //调用删除课程
        Msg.Alert("恭喜,课程删除成功!", BasicField.GetUserUrl("teacher/LiveList"));
        isLoadPage = false;
        return;
    }
    private void CleanCache()
    {
        #region 更新分类缓存
        Kesion.Course.Course.ClearCacheFile("LiveList");
        #endregion
    }
    private void infoInitial()
    {
        if (KSCMS.S("do").Equals("add"))
        {
            __info.Label1 = "添加直播课程";
            Dictionary<string, string> PeriodInfo = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
            Kesion.Course.Live.InitalCourseLive(PeriodInfo, -1, "user");
            PeriodInfo.Add("LoadFrom", "course");
            Context.Items["courseLive"] = PeriodInfo;
            this.LivePlace.Controls.Add(base.LoadControl("~/Config/Control/SystemCourse/CourseLive.ascx"));

            __info.bmbegintime = DateTime.Now.ToString();
            __info.bmendtime =  DateTime.Now.AddMonths(1).ToString();
            __info.begintime = DateTime.Now.ToString();
            __info.endtime =  DateTime.Now.AddMonths(1).ToString();
           __info.RadioButtonList4 = Utils.StrToInt(KSCMS.S("RadioButtonList4"),1).ToString();//是否开启课时：1开启，0关闭
            __info.RadioButtonList2 = Utils.StrToInt(KSCMS.S("RadioButtonList2"),0).ToString();//是否免费
        }
        else
        {
            __info.Label1 = "修改直播课程信息";
            __info.begintime = KSCMS.S("begintime");
            __info.endtime = KSCMS.S("endtime");
            __info.bmbegintime = KSCMS.S("bmbegintime");
            __info.bmendtime = KSCMS.S("bmendtime");
        }
      
        __info.IsVip= Utils.StrToInt(KSCMS.S("IsVip"));
        __info.wlink = KSCMS.S("wlink");;
        __info.LiveType = KSCMS.S("LiveType");
    
        __info.TxtName = KSCMS.S("TxtName");//课程名称
        __info.TxtShortName = KSCMS.S("TxtShortName");//简短标题
        __info.TxtIntro = KSCMS.S("TxtIntro");//课程介绍
        __info.TxtTarget = KSCMS.S("TxtTarget");//课程目标                                                                               
        __info.photourl = KSCMS.S("photourl");//图片
        __info.shixian = KSCMS.S("shixian");
        __info.TxtNotice = KSCMS.S("TxtNotice");//课程公告                                
        __info.RadioButtonList1 = Utils.StrToInt(KSCMS.S("RadioButtonList1")).ToString();//是否免费
        __info.zhekou = KSCMS.S("zhekou");//折扣        
        __info.ISLoad =Utils.StrToInt(KSCMS.S("ISLoad")).ToString();//是否年费用户收费
        __info.Loadzhekou = KSCMS.S("Loadzhekou");//收费折扣
        __info.FixedPrice = KSCMS.S("FixedPrice");//收费固定价格
        __info.Price_Member = KSCMS.S("Price_Member");//课程市场价格
        __info.Money = KSCMS.S("Money");//课程参考价
        __info.radiotype = Utils.StrToInt(KSCMS.S("radiotype")).ToString();
        __info.TxttimeCount = KSCMS.S("TxttimeCount");
        __info.TxtUrl = KSCMS.S("TxtUrl");
        __info.WapUrl = KSCMS.S("WapUrl");
        __info.TextAddress = KSCMS.S("TextAddress");
        __info.TxtYunVideoID = KSCMS.S("TxtYunVideoID");
        __info.TxtOrherVideo = KSCMS.S("TxtOrherVideo");
        __info.TxtMobileOrherVideo = KSCMS.S("TxtMobileOrherVideo");
        __info.Textppt = KSCMS.S("Textppt");
        __info.PeriodTxtIntro = KSCMS.S("PeriodTxtIntro");
        __info.ClassID = KSCMS.S("DrpClassID1");//课程分类
        __info.MoreClass = KSCMS.S("MoreClassList");//更多分类
        __info.moveplaytype = KSCMS.S("moveplaytype");
        __info.courseid = Utils.StrToInt(KSCMS.S("courseid"));
        __info.listeningID = KSCMS.S("listeningID");
        __info.RBIsOff = Utils.StrToInt(KSCMS.S("RBIsOff").ToString()).ToString();
        __info.regulations = Utils.StrToInt(KSCMS.S("regulations"));
        __info.DefaultPic = KSCMS.S("DefaultPic");
        __info.IsOtherTc = Utils.StrToInt(KSCMS.S("IsOtherTc").ToString()).ToString();
        __info.techertest = KSCMS.S("techertest");
        __info.Promotion = Utils.StrToInt(KSCMS.S("Promotion").ToString());
        __info.PanicMoney = Utils.StrToFloat(KSCMS.S("PanicMoney").ToString());
        __info.Provinceid = Utils.StrToInt(KSCMS.S("Provinceid").ToString());
        __info.CityId = Utils.StrToInt(KSCMS.S("CityId").ToString());
        __info.CountyId = Utils.StrToInt(KSCMS.S("CountyId").ToString());
        __info.t_free = 0;
        __info.epDefaultPic = KSCMS.S("epDefaultPic").ToString();
        __info.jifen = Utils.StrToInt(KSCMS.S("jifen"));
        __info.IsSetPrice = 1;

        __info.Limited = KSCMS.S("Limited");
        __info.buylimit = Utils.StrToInt(KSCMS.S("buylimit"));
        __info.RadioLiveStatus = Utils.StrToInt(KSCMS.S("RadioLiveStatus")).ToString();
        __info.TxtPlayOther = KSCMS.S("TxtPlayOther");

        __info.LiveTime = KSCMS.S("LiveTime");
        __info.TextBox4 = KSCMS.S("TextBox4");
        __info.TextUid = KSCMS.S("TextUid");
        __info.liveID = KSCMS.S("liveID");
        __info.TxtIsMobileLivePlayerJS = KSCMS.S("TxtIsMobileLivePlayerJS");
        __info.tcid = Teacher.getTcID().ToString();

        __info.IsSendNote1 = Utils.StrToInt(KSCMS.S("IsSendNote1"),0).ToString();
        __info.NotePrice = Utils.StrToFloat(KSCMS.S("NotePrice"),0).ToString();
        __info.NoteContent = KSCMS.S("NoteContent");
        __info.IsContainTax1 = Utils.StrToFloat(KSCMS.S("IsContainTax")).ToString();
    }
    private void initialEdit(int CourseId)
    {
        SqlParam[] param = new SqlParam[1];
        param[0] = new SqlParam("CourseId", CourseId);

        using (DataTable dt = CommonData.GetDataTable("[KS_Course]", "*", param))
        {
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                pid = Utils.StrToInt(dr["accountid"].ToString());
                //	drr = dr;

                #region 隐形课时
                __info.RadioButtonList4 = dr["IsPeriod"].ToString();
                __info.LiveType = dr["LiveType"].ToString();
                if (__info.RadioButtonList4 == "0")
                {

                    using (DataTable dtt = DataFactory.GetDataTable("select top 1 a.*,b.livetype,b.IsPeriod from KS_CoslivePeriod a inner join ks_course b on a.courseid=b.courseid where  a.Addtype=4 and  a.courseid=" + CourseId))
                    {
                        if (dtt.Rows.Count > 0)
                        {
                            DataRow drr = dtt.Rows[0];

                            Dictionary<string, string> PeriodInfo = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
                            Kesion.Course.Live.InitalCourseLive(PeriodInfo, 0, "user", drr, 1);
                             PeriodInfo.Add("LoadFrom", "course");
                            Context.Items["courseLive"] = PeriodInfo;
                            this.LivePlace.Controls.Add(base.LoadControl("~/Config/Control/SystemCourse/CourseLive.ascx"));
                        }
                    }

                }
                else
                {
                    Dictionary<string, string> PeriodInfo = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
                    Kesion.Course.Live.InitalCourseLive(PeriodInfo,Utils.StrToInt(dr["LiveType"].ToString()), "user");
                    Context.Items["courseLive"] = PeriodInfo;
                    this.LivePlace.Controls.Add(base.LoadControl("~/Config/Control/SystemCourse/CourseLive.ascx"));

                }
                #endregion
                __info.buylimit = Utils.StrToInt(dr["buylimit"].ToString());
                __info.begintime = dr["begintime"].ToString();
                __info.endtime = dr["endtime"].ToString();

                #region 报名时间段
                __info.bmbegintime = dr["bmbegintime"].ToString();
                __info.bmendtime = dr["bmendtime"].ToString();
                #endregion

                if (__user.GroupID==4|| DataFactory.GetOnlyValue("select top 1 IsSetPrice from KS_EnterPrise where userid=" + new TemporaryVar().UserID + "") == "1")
                {
                    __info.IsSetPrice = 1;
                    __info.ISLoad = Utils.StrToInt(dr["ISLoad"].ToString()).ToString();//是否年费用户收费
                    __info.Loadzhekou = dr["Loadzhekou"].ToString();//收费折扣
                    __info.FixedPrice = Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["FixedPrice"].ToString()));//收费固定价格

                    __info.Promotion = Utils.StrToInt(dr["promotion"].ToString());
                    if (Utils.StrToInt(dr["promotion"].ToString(), 0) == 1)
                    {
                        __info.PanicMoney = Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["PanicMoney"].ToString()));
                        __info.Limited = dr["Limited"].ToString();
                    }
                    else if (Utils.StrToInt(__info.Promotion) == 2)
                    {
                        __info.PanicMoney = Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["PanicMoney"].ToString()));
                        __info.Limited = dr["Limited"].ToString();

                    }
                    else if (Utils.StrToInt(__info.Promotion) == 3)
                    {
                        __info.jifen = dr["jifen"].ToString();
                    }
                }
                else
                {
                    __info.IsSetPrice = 0;
                }
                __info.wlink = dr["wlink"].ToString();
                __info.RBIsOff = dr["IsOff"].ToString();
                __info.CountyId = Utils.StrToInt(dr["CountyId"].ToString());
                __info.Provinceid = Utils.StrToInt(dr["Provinceid"].ToString());
                __info.CityId = Utils.StrToInt(dr["Cityid"].ToString());
                __info.courseid = Utils.StrToInt(dr["courseid"].ToString());
                __info.TxtName = dr["Name"].ToString();//课程名称
                __info.TxtShortName = dr["ShortName"].ToString();//简短标题
                __info.TxtIntro = dr["Intro"].ToString();//课程介绍
                __info.TxtTarget = dr["Target"].ToString();//课程目标                                                                               
                __info.photourl = dr["photourl"].ToString();//图片
                __info.shixian = dr["shixian"].ToString();
                __info.TxtNotice = dr["Notice"].ToString();//课程公告                                
                __info.RadioButtonList2 = Utils.StrToInt(dr["IsFree"].ToString()).ToString();//是否免费

                if (BaseFun.CheckFieldExists("KS_Course", "IsSendNote"))   //是否邮寄资料
                {
                    __info.IsSendNote1 = Utils.StrToInt(dr["IsSendNote"]).ToString();
                    __info.NotePrice = Utils.StrToDecimal(dr["NotePrice"]).ToString("f2");
                    __info.NoteContent = dr["NoteContent"].ToString();
                    __info.IsContainTax1 = Utils.StrToFloat(dr["IsContainTax"]).ToString();
                }

                __info.zhekou = dr["zhekou"].ToString();//折扣        
                __info.ISLoad = Utils.StrToInt(dr["ISLoad"].ToString()).ToString();//是否年费用户收费
                #region 积分设置VIP
                if (Utils.StrToInt(dr["ISLoad"].ToString()) == 0)
                {
                    __info.IsVip=3;//是否年费用户收费
                }
                #endregion
                __info.Loadzhekou = dr["Loadzhekou"].ToString();//收费折扣
                __info.FixedPrice = Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["FixedPrice"].ToString()));//收费固定价格
                __info.Price_Member = Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["Price_Member"].ToString()));//课程市场价格
                __info.Money = Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["Money"].ToString()));//课程参考价
                __info.ClassID = dr["classid"].ToString();
                __info.MoreClass = dr["MoreClass"].ToString();
                __info.regulations = dr["regulations"].ToString(); // 试卷状态规定
                __info.listeningID = dr["listeningID"].ToString();
                __info.IsOtherTc = Utils.StrToInt(dr["IsOtherTc"].ToString()).ToString();//是否其他教师
                __info.techertest = dr["TeacherName"].ToString();  //其他教师                   
                __info.tcid = dr["tcid"].ToString(); //名师ID；
                __info.DefaultPic = dr["photourl"].ToString();
                verify = Utils.StrToInt(dr["verify"].ToString());

                //************收费方式*********

            }
        }
    }

    private string initial1(int parentId, int type = 0)
    {
        #region 按分类快速搜索
        string selceted = "," + __info.ClassID + ",";
        if (type == 1)//更多分类
        {
            selceted = "," + __info.MoreClass + ",";
        }
        StringBuilder sb = new StringBuilder();
        using (DataTable dt = EnterPrise.getEpriseBusiness(__user.UserName, 0, 0))
        {
            if (dt != null)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    int depth = Utils.StrToInt(dr[2].ToString());
                    if (depth <= 3)
                    {
                        int id = Utils.StrToInt(dr[0].ToString());
                        string CatetoryName = dr[1].ToString();
                        if (depth == 2)
                        {
                            CatetoryName = "　├ " + CatetoryName;
                        }
                        if (depth == 3)
                        {
                            CatetoryName = "　   　├ " + CatetoryName;
                        }
                        if (selceted.IndexOf("," + id.ToString() + ",") != -1)
                            sb.AppendFormat("<option value=\"{0}\" {2}>{1}</option>", id.ToString(), CatetoryName, "selected");
                        else
                            sb.AppendFormat("<option value=\"{0}\" {2}>{1}</option>", id.ToString(), CatetoryName, "");
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }
        return sb.ToString();
        //return __info.CourseClass;
        #endregion
    }
    public string DataBinder()
    {
        StringBuilder sb = new StringBuilder();
        int Type = Utils.StrToInt(KSCMS.S("Type"));
        if (!string.IsNullOrEmpty(KSCMS.S("Type")))
        {
            switch (Type)
            {
                case 1:
                    sqlParam += " and verify=0 ";
                    break;
                case 2:
                    sqlParam += " and verify=1 ";
                    break;
                case 3:
                    sqlParam += " and IsOff=1 ";
                    break;
                case 4:
                    sqlParam += " and IsOff=0 ";
                    break;
                case 5:
                    sqlParam += " and isfree=0 ";
                    break;
                case 6:
                    sqlParam += " and isfree=1 ";
                    break;

            }
        }
        if (!string.IsNullOrEmpty(KSCMS.S("TextBox1")))
        {
            sqlParam += " and name like '%" + Utils.ChkSQL(KSCMS.S("TextBox1")) + "%'";
        }

        using (DataTable dt = DataFactory.GetPage("*", sqlParam, "Courseid", "order by  addTime desc", CurrPage, PageSize, out recordcount, out pagecount))
        {
            if (dt.Rows.Count > 0)
            {
              
              foreach (DataRow dr in dt.Rows)
                    {
                        sb.Append(" <li class=\"photo_box_list_li\"><span class=\"checkbtn_box border\"><input type=\"checkbox\"  name=\"ids\" id=\"ids\" value=\"" + dr["courseid"] + "\"   " + ((Convert.ToString(dr["verify"]) == "1") ? "class=\"checkbtn\"" : (Convert.ToString(dr["verify"]) == "0" ? "class=\"checkbtn\"" : " class=\"checkbtn checkno\" disabled")) + " />" + "</span>" +
						
                        "<div class=\"infos-pic\"><i class=\"tips\"  " + (Convert.ToString(dr["verify"]) == "1" ? (Convert.ToString(dr["IsOff"]) == "1" ? "" : "style=\"color: white; background-color:rgba(255,108,0,0.8);\" ") : "") + ">" + (Convert.ToString(dr["verify"]) == "1" ? (Convert.ToString(dr["IsOff"]) == "1" ? "在售" : "停售") : "未审核") + "</i><a href=\"" + (Convert.ToString(dr["verify"]) == "0" ? "javascript:;" : BasicField.GetRewriteUrl("liveview", Utils.StrToInt(dr["courseid"].ToString()))) + "\" target=\"_blank\">" +
                        "<img src=\"" + dr["photourl"].ToString() + "\" onerror=\"this.src='" + (string.IsNullOrEmpty(__info.epDefaultPic) ? "/sysimg/nopic.gif" : __info.epDefaultPic) + "'\"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>" +
                        "<div class=\"infoConBox\"><div class=\"infos-title\"><span class=\"rf liveIcon\">"+(dr["livestate"].ToString()=="1"?"<font color='red'>直播中</font>":dr["livestate"].ToString()=="2"?"已结束":"未开始") +"</span><h2 class=\"h5\"><a href=\"" + (Convert.ToString(dr["verify"]) == "0" ? "javascript:;" : BasicField.GetRewriteUrl("liveview", Utils.StrToInt(dr["courseid"].ToString()))) + "\" title=\"" + dr["name"].ToString() + "\" target=\"_blank\">" + Utils.CutStr(dr["name"].ToString(), 15) +"</a>"+
                        (Convert.ToString(dr["recommend"]) == "1" ? "<font class=\"bg1\">荐</font>" : "") +
						(Convert.ToString(dr["popular"]) == "1" ? "<font class=\"bg2\">精</font>" : "") +
						(Convert.ToString(dr["istop"]) == "1" ? "<font class=\"bg3\">头</font>" : "") +
						(Convert.ToString(dr["huandeng"]) == "1" ? "<font class=\"bg4\">幻</font>" : "") +
						(Convert.ToString(dr["is3g"]) == "1" ? "<font class=\"bg5\">3g</font>" : "") +
                    	"<span class=\"type\">" + (Convert.ToString(dr["isFree"]) == "0" ? "<a mark=\"video\">免费</a>" : "<a mark=\"video\" class=\"redBg\">付费</a>") + "</span></h2></div>" +
						"<div class=\"infoTitle\">" +
                   		"<span class=\"price\">" +
                 		(Utils.StrToInt(dr["IsFree"].ToString()) == 0 ? "<font class='green'>免费</font>" : (dr["promotion"].ToString() == "3" ? dr["jifen"].ToString() + MyCache.GetCacheConfig(90) : (dr["promotion"].ToString() == "1" || dr["promotion"].ToString() == "2" ? "¥" + Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["PanicMoney"].ToString())) : (Utils.StrToDecimal(dr["price_member"].ToString()) == 0 ? "<font class='green'>免费</font>" : "¥" + Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["price_member"].ToString())) + "" + (dr["promotion"].ToString() == "4" ? "+" + dr["jifen"].ToString() + MyCache.GetCacheConfig(90) : ""))))) +
                   		"<del>¥" + Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(dr["Money"])) + "</del></span><span>" + dr["StudentNum"].ToString() + "人学习</span></div>" +
            	         "<div class=\"btns\">" + (Utils.StrToInt(dr["IsPeriod"].ToString()) == 1 ? "<span><a href=\"" + BasicField.GetUserUrl("teacher/CsLiveZj", "courseid-" + dr["courseid"].ToString() + "") + "\">"+dr["CountPid"]+"个课时</a></span>" : "") +
                    
            			"<span><a href=\"javascript:;\" onclick='upliveRoom(" + dr["courseid"].ToString() + "," + Utils.StrToInt(dr["livetype"].ToString()) + "," + dr["accountid"].ToString() + ")'>获取直播</a></span>" +
              			"<span><a href=\"javascript:;\" onclick='livenotice(" + dr["courseid"].ToString() + ")'>通知学员</a></span>" +
                           "<span><a href=\"" + BasicField.GetUserUrl("teacher/CsZlList", "type=0,courseid-" + dr["courseid"].ToString() + ",prt-1,costype-5")+"\">"+Utils.StrToInt(dr["zlnum"].ToString())+"份资料</a></span>" +
						"<span>" + ((Convert.ToString(dr["verify"]) == "1") ? "<a href=\"" + BasicField.GetUserUrl("teacher/LiveList", "do-modify,courseid-" + dr["courseid"].ToString() + "") + "\">编辑</a>" : (Convert.ToString(dr["verify"]) == "0" ? "<a href=\"" + BasicField.GetUserUrl("teacher/LiveList", "do-modify,courseid-" + dr["courseid"].ToString() + "") + "\">编辑</a>" : "")) + "</span>" +
						"<span>" + (Convert.ToString(dr["verify"]) == "1" ? (Convert.ToString(dr["IsOff"]) == "1" ? "<a href=\"" + BasicField.GetUserUrl("teacher/LiveList", "do-sell,courseid-" + dr["courseid"] + "") + "\" onclick=\"return(confirm('您确定要下架此课程吗?下架后学员将无法再报名此课程'));\" href=\"javascript:;\">下架</a>" : "<a href=\"" + BasicField.GetUserUrl("teacher/LiveList", "do-sell,courseid-" + dr["courseid"] + "") + "\" href=\"javascript:;\">上架</a>") : "") + "</span>" +
						"<span>" + ((Convert.ToString(dr["verify"]) == "1") ? "<a href=\"" + BasicField.GetUserUrl("teacher/LiveList", "do-del,courseid-" + dr["courseid"].ToString() + "") + "\" onclick=\"return(confirm('您确定要删除此课程吗?删除后会影响到您的综合积分'));\">删除</a>" : (Convert.ToString(dr["verify"]) == "0" ? "<a href=\"" + BasicField.GetUserUrl("teacher/LiveList", "do-delete,courseid-" + dr["courseid"].ToString() + "") + "\" onclick=\"return(confirm('您确定要删除此课程吗?'));\">删除</a>" : "")) + "</span>" +
					"</div></div></li>");
                    }
               
            }
            else
            {
                KSCMS.W("<div class=\"empty\">没有添加任何课程信息</div>");
            }
        }
        return sb.ToString();
    }
    public string GetTeacherList(string tcid)
    {

        string selcected = "";
        StringBuilder sb = new StringBuilder();
        string sql = "select top 100 Tcid,Tname from KS_CosTeacher where verify=1 and (userid=" + __user.UserID + " or   schoolid=" + __user.UserID +") order by tcid desc";
        using (DataTable dt = DataFactory.GetDataTable(sql))
        {
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    ListItem lii = new ListItem();

                    if (("," + tcid + ",").IndexOf("," + dr["tcid"].ToString() + ",") != -1)
                    {
                        selcected = "selected";
                    }
                    else
                    {
                        selcected = "";
                    }
                    sb.AppendFormat("<option value=\"{0}\" {2} >{1}</option>", dr["tcid"].ToString(), dr["tname"].ToString(), selcected);
                }
            }
        }
        return sb.ToString();
    }
    public void GetSJ()
    {
        StringBuilder sb = new StringBuilder();
        string Key = KSCMS.S("TxtSJKey");
        if (Key == "")
        {

        }
        else
        {
            string sql2 = "select top 200 ID,Title from KS_SJ where Title like '%" + Key + "%'";
            using (DataTable dt = DataFactory.GetDataTable(sql2))
            {

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        sb.AppendFormat(@"<option value=""{0}""{2}>{1}</option>", dr[0].ToString(), dr[1].ToString(), Utils.StrToInt(KSCMS.S("examPleID")) == Utils.StrToInt(dr[0].ToString()) ? " selected" : string.Empty);
                    }
                }
            }
        }
        __info.LstB2 = sb.ToString();
    }
    public string InniaLivePlay()
    {
        #region 初始直播视频类型
        StringBuilder sb = new StringBuilder();
        XmlDocument xmldoc = new XmlDocument();
        xmldoc.Load(Utils.GetMapPath(KSCMS.GetInstallDir() + "config/course/PCLivePlay.config"));
        foreach (XmlNode xn in xmldoc.SelectNodes("//liveplay/item"))
        {
            ListItem li = new ListItem();
            if (xn.SelectSingleNode("@enable").InnerText == "true")
            {
                sb.AppendFormat("<option value=\"{0}\" {2}>{1}</option>", xn.SelectSingleNode("@id").InnerText, xn.SelectSingleNode("@name").InnerText, __info.LiveType == xn.SelectSingleNode("@id").InnerText ? "selected" : "");
            }

        }
        sb.AppendFormat("<option value=\"{0}\" {2}>{1}</option>", "0", "其他", __info.LiveType == "0" ? "selected" : "");
        return sb.ToString();
        #endregion

    }

</script>

<%
    if (!isLoadPage) return;
	if (KSCMS.S("do") != "modify" && KSCMS.S("do") != "add")
	{
%>
<form name="aspnetForm" method="post" action="<%=BasicField.GetUserUrl("teacher/LiveList")%>" id="aspnetForm">
    <div class="t_tybox">
         <div class="tytitle clearfix" style="padding:0;">
            <div class="tabs_header">
            	<ul class="tabs clearfix">
                    <li><a href="<%=BasicField.GetUserUrl("teacher/CourseList") %>"><span>点播课程</span></a></li>
                    <li class="active"><a href="<%=BasicField.GetUserUrl("teacher/livelist") %>"><span>直播课程</span></a></li>
                    <li><a href="<%=BasicField.GetUserUrl("teacher/facelist") %>"><span>面授课程</span></a></li>
                </ul>
            </div>
            <a href="<%=BasicField.GetUserUrl("teacher/LiveList","do-add") %>" class="addbtn" style="float:right; margin-left:0; margin-right:20px;">+添加直播课程</a>
            <div class="property">
                <div class="name fr">筛选</div>
                <div class="propertyBox">
                    <ul class="tabs clearfix">
                        <span class="screen fl">选择状态：</span>
                        <li <%=KSCMS.S("Type")==""?" class='active'":string.Empty %>><a href="<%=BasicField.GetUserUrl("teacher/LiveList") %>"><span>所有记录</span></a></li>
						<% if (ep.GetEpConfig("Setting", 8) == "1")  //bu需要审核
                        { %>
                        <li <%=KSCMS.S("Type")=="1"?" class='active'":string.Empty %>><a href="<%=BasicField.GetUserUrl("teacher/LiveList","Type-1") %>"><span><font>待审核</font></span></a></li>
                        <li <%=KSCMS.S("Type")=="2"?" class='active'":string.Empty %>><a href="<%=BasicField.GetUserUrl("teacher/LiveList","Type-2") %>"><span>已审核</span></a></li>
                        <%} %>
                         <li <%=KSCMS.S("Type")=="3"?" class='active'":string.Empty %>><a href="<%=BasicField.GetUserUrl("teacher/LiveList","Type-3") %>"><span>已上架</span></a></li>
                         <li <%=KSCMS.S("Type")=="4"?" class='active'":string.Empty %>><a href="<%=BasicField.GetUserUrl("teacher/LiveList","Type-4") %>"><span>已下架</span></a></li>
                         <li <%=KSCMS.S("Type")=="5"?" class='active'":string.Empty %>><a href="<%=BasicField.GetUserUrl("teacher/LiveList","Type-5") %>"><span>免费</span></a></li>
                         <li <%=KSCMS.S("Type")=="6"?" class='active'":string.Empty %>><a href="<%=BasicField.GetUserUrl("teacher/LiveList","Type-6") %>"><span>付费</span></a></li>
                    </ul>
                </div>
            </div>
            <div class="top_c_sc" style="margin-right:10px;">
                <span>课程名称：</span>
                <input name="TextBox1" type="text" id="TextBox1" class="textbox" />
                <input type="submit" name="Button4" value=" 搜索 " id="Button4" onclick="$('#actions').val('search')" class="button" />
            </div>
         </div>
        
         <div class="photo_box">
           <ul class="photo_box_list clearfix">
             <%=DataBinder()  %>  
           </ul>
         </div>
        
        
         <div class="cz_btn">        
            <span><input type="checkbox" class="checkbtn" name="chkall" id="chkall" onclick="CheckAll(this.form);" /><label for="chkall">全部选中</label></span>		   
            <span><input type="submit" class="button" value="批量删除" onclick="return (GetIDS('del'));"></span>
            <input type="hidden" id="actions" value="del" name="action">
         </div>   
         <div class="fy_box">
             <%
                #region 分页
                string PageStr = "[KS:PageStr1]";
                BasicField.ReplaceFilterPage(ref PageStr, CurrPage, PageSize, pagecount, recordcount);
                KSCMS.W(PageStr);
                #endregion
             %>
         </div>
         <div class="clearfix"></div> 
         <script>
            function upliveRoom(courseid,liveType,accountid)
            {                     
             
                if (liveType==1)
                {
                    jQuery.dialog.open('/plus/course/openliveroom.aspx?CourseId=' + courseid+"&liveType="+liveType+"&accountid="+accountid+"&istop=0", { lock: true, fixed: true, title: "<div style='text-align:left'>直播管理</div>", width: 600, height: 400, max: false, min: false });
                              
                        
                } else if(liveType==0 || liveType>6 )
                {
                    alert("您选择其他服务器系统不能自动分配");
                }else{
                    jQuery.dialog.open('/plus/course/openliveroom.aspx?CourseId=' + courseid+"&liveType="+liveType+"&accountid="+accountid+"&istop=0", { lock: true, fixed: true, title: "<div style='text-align:left'>直播管理</div>", width: 600, height: 400, max: false, min: false });
                }
            }
            function  livenotice (courseid)
            {
                jQuery.dialog.open('/plus/course/liveNotice.aspx?CourseId=' + courseid+"&istop=0", { lock: true, fixed: true, title: "<div style='text-align:left'>直播管理</div>", width: 800, height: 500, max: false, min: false });
        
            }
         </script> 	    
    </div>
    <div>
        <script type="text/javascript">
            showtips(' <span>操作说明：<br /></span><span class="tips_cor" style="display:block;margin-top:5px;">1.如果是待审核是不能点击预览的,而且没有上下架的功能！<br>2.如果复选框是<font color="blue">打X</font>，代表是不能点击<br>3.如果审核通过而且后台设置你有删除的功能，那么你确定要执行的将影响你的<font color="blue">综合积分</font></span>');
        </script>
    </div>   
</form>

<%}else{Kesion.APPCode.EditorAPI.EchoHead(); %>


  <div class="t_tybox">
    	<div class="tytitle"><h4 id="Label1"><%=__info.Label1 %></h4></div>
    	<script src="/ks_inc/DatePicker/WdatePicker.js"></script>
        <div class="tab-page" id="sjPanel">
     
  		<form name="aspnetForm" method="post" action="<%=BasicField.GetUserUrl("teacher/LiveList","do-"+KSCMS.S("do")+"") %>" id="Form1">
   		<input type="hidden" name="action" id="action" value="save" >
    	<input type="hidden" name="courseid" value="<%=__info.courseid %>" >
    	<!--选项卡-->	
    	<div class="tabs_header">
            <ul class="tabs tabs-spec clearfix">
                
                 <li class="active"><a href="JavaScript:;"><span>基本信息</span></a></li>
                 <li ><a href="javascript:;"><span>课时信息</span></a></li>
                 <li ><a href="javascript:;"><span>其他选项</span></a></li>
            </ul>
        </div>
        <div class="tab-content">
            <div class="tab-pane" style="display:block">
                <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="border">
                    <tr>
                        <td class="lefttd" height="30" ><font color=red >*</font>课程名称：</td>
                        <td class="tag_left">
                            <input type="text" value="<%=__info.TxtName %>" class="textbox" id="TxtName" name="TxtName" style="width:350px;">
                        </td>
                    </tr> 
                    <tr style="display:none">
                         <td class="lefttd" height="30">简短标题：</td>
                         <td class="tag_left">
                             <input type="text" value="<%=__info.TxtShortName %>" class="textbox" name="TxtShortName" Style="width: 150px">
                             <span class="tips">该字段的字数是100，该字段如果为空的话，就去截取”课程名称“的字数</span>
                         </td>
                    </tr> 
                    <tr>
                      <td class="lefttd" height="30" align="right" style="width: 150px">课程类型：</td>
                      <td class="tag_left">
                          <select name="DrpClassID1" id="DrpClassID1">
                            <%=initial1(0) %>
                          </select>
                      </td>          
                    </tr>
                    <tr style="display:none">
                      <td class="lefttd" align="right" style="width: 150px">课程多分类：</td>
                      <td class="tag_left"  height="230">
                         <select size="4" name="MoreClassList" multiple="multiple" id="MoreClassList" style="width:262px;height:250px !important;background: none;">
                            <%=initial1(0,1) %>
                         </select>
                      </td>          
                    </tr>
                    <%if (UserManage.GetUserInfo().SchoolID==0){ %>
                    <tr>
                         <td class="lefttd"> <font color=red >*</font>课程主教：</td>
                         <td class="tag_left">  
                              <select  name="teacherlist" id="teacherlist" style="width: 200px;height: 140px !important;vertical-align: middle;" multiple="multiple">
                                 <%=GetTeacherList(__info.tcid.ToString()) %>
                              </select>   
                              <a href="<%=BasicField.GetUserUrl("teacher/CsTeacher") %> " style="color:#999;">名师管理</a>&nbsp;&nbsp;
                              <input type="checkbox" class="checkbtn" name="IsOtherTc" value="1" <%=__info.IsOtherTc=="1"?" checked":"" %> onclick="if (this.checked){ $('#otherTeacher').show(); }else{  $('#otherTeacher').hide(); }" />助教
                              <span id="otherTeacher"<%=__info.IsOtherTc=="1"?"":" style='margin-top:10px;display:none'" %>>
                                 <input name="techertest" type="text" style="width:120px;" id="techertest" value="<%=__info.techertest %>" class="textbox" /> 如：王老师      
                              </span>         
                         </td>          
                    </tr>
                    <%} %>
                    <tr>
                        <td class="lefttd" height="30"> 限报人数：</td>
                        <td class="tag_left">
                            <input name="buylimit" type="text" value="<%=__info.buylimit %>" id="buylimit" class="textbox"  style="width:50px;text-align:center;padding-left:0;"  />人（设置“0”为不限。） 
                        </td>
                    </tr>
                    <tr>
                        <td class="lefttd" height="30"><font color=red >*</font>时间限制：</td>
                        <td class="tag_left">
                             <script>isHour = 1;</script>
                             <input name="bmbegintime" type="text" value="<%=__info.bmbegintime %>" id="bmbegintime" class="textbox  Wdate" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd HH:mm:ss&#39;,minDate:&#39;%y-%M-%d&#39;});" /> 
                             至 <input name="bmendtime" type="text" value="<%=__info.bmendtime %>" id="bmendtime" class="textbox  Wdate" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd HH:mm:ss&#39;,minDate:&#39;%y-%M-%d&#39;});" />     
                        </td>
                    </tr>
                    <tr>
                        <td class="lefttd" height="30">收费方式：</td>
                        <td class="tag_left">
                        <table id="RadioButtonList2" class="radio" onclick="free()" border="0" >
                    <tr>
                        <td class="bo-min"><input type="radio" name="RadioButtonList2" value="0" <%=__info.RadioButtonList2=="0"?"checked":"" %>  <%=KSCMS.S("do")=="modify"?"disabled='disabled'":"" %>/><label for="RadioButtonList2_0">免费</label></td>
                        <td class="bo-min"><input type="radio" name="RadioButtonList2" value="1" <%=__info.RadioButtonList2=="1"?"checked":"" %>  <%=KSCMS.S("do")=="modify"?"disabled='disabled'":"" %>/><label for="RadioButtonList2_1">付费</label></td>
                    <span class="tips">TIPS:收费方式一旦设置，不允许修改。</span>
                        </tr>
                </table>
                <script>
                    function free() {
                        var checkrad = jQuery("#RadioButtonList2 :radio[checked]").val();
                        if (checkrad == "0") {
                            jQuery("#Tbody1").css("display", "");
                            jQuery("#Tbody2").css("display", "none");
                            jQuery("#Tbody8").css("display", "none");
                            jQuery("#TbodyUserVIP").css("display", "none");
            
                        } else {
                            jQuery("#Tbody1").css("display", "none");
                            jQuery("#Tbody2").css("display", "");
                            jQuery("#Tbody8").css("display", "");
                             Promotion();
                        }
                    }
            
            
                    function Promotion() {
                        var checkrad = jQuery("#Promotion :radio[checked]").val();
                    
                        if (checkrad == "1") {
                            jQuery("#Tbody5").css("display", "");
                            jQuery("#Tbody6").css("display", "");
                            jQuery("#Tbody7").css("display", "none");
                            jQuery("#TbodyUserVIP").css("display", "");
                            jQuery("#Tbody2").css("display", "none");
            
                        } else if (checkrad == "2") {
                            jQuery("#Tbody5").css("display", "none");
                            jQuery("#Tbody6").css("display", "");
                            jQuery("#Tbody7").css("display", "none");
                            jQuery("#TbodyUserVIP").css("display", "");
                            jQuery("#Tbody2").css("display", "none");
                        
                        } else if (checkrad == "3") {
                            jQuery("#Tbody5").css("display", "none");
                            jQuery("#Tbody6").css("display", "none");
                            jQuery("#Tbody7").css("display", "");
                            jQuery("#TbodyUserVIP").css("display", "none");
                            jQuery("#Tbody2").css("display", "none");
                        }
                        else {
                            jQuery("#Tbody5").css("display", "none");
                            jQuery("#Tbody6").css("display", "none");
                            jQuery("#Tbody7").css("display", "none");
                            jQuery("#TbodyUserVIP").css("display", "");
                            jQuery("#Tbody2").css("display", "");
                        }
                    }
                    var puburl="<%= BasicField.GetUserUrl("teacher/LiveList")%>";
                    function searchSJ() {
                    
                        var key = jQuery("#TxtSJKey").val();
                        if (key == '') {
                            KesionJS.Alert("请输入试卷关键字！", "jQuery('#TxtSJKey').focus()");
                            return false;
                        } else {
                            
                            puburl="/plus/course/CourseAjax.ashx?action=getsearchsj";
            
                            jQuery.ajax({ url: puburl, success: function (d) {
                                jQuery("#LstB2").empty();
                                jQuery("#LstB2").html(d);
                            }
                            });
                        
                        }
                    }
                    function iszhekou() {
                    
                        var ISLoad = jQuery("#ISLoad :radio[checked]").val();
                        
                        if (ISLoad == "1") {
                            //折扣价
                            jQuery("#Iszhekou").css("display", "");
                            jQuery("#IsFixedPrice").css("display", "none");
                        } else if (ISLoad == "0") {
                            //免费
                            jQuery("#Iszhekou").css("display", "none");
                            jQuery("#IsFixedPrice").css("display", "none");
                        } else {
                            //固定价格
                            jQuery("#Iszhekou").css("display", "none");
                            jQuery("#IsFixedPrice").css("display", "");
                        }
                    }
                    $(document).ready(function(){
                        free();
                        
                        iszhekou();
                        ShowNoteSetting();
                    })
                </script>
                     </td>
                </tr>
                  <tbody id="Tbody1" ></tbody>
                 
                 
                  <tbody id="Tbody8" style="display:none">
                     
                        <tr>
                            <td class="lefttd" height="30" style="width: 102px">促销类型：</td>
                            <td class="tag_left">
                                <table id="Promotion" class="radio" onclick="Promotion()" border="0" style="height:24px;">
                                        <tr>
                                            <td><input id="Promotion_0" type="radio" name="Promotion" value="0" <%=__info.Promotion==0?"checked":"" %> /><label for="Promotion_0">普通课程</label></td>
                                            <td>
                                            <input id="Promotion_1" type="radio" name="Promotion" value="1" <%=__info.Promotion==1?"checked":"" %> /><label for="Promotion_1">限时抢购</label></td>
                                        <td>
                                            <td><input id="Promotion_2" type="radio" name="Promotion" value="2" <%=__info.Promotion==2?"checked":"" %> /><label for="Promotion_2">课程团购</label></td>
                                            <td><input id="Promotion_3" type="radio" name="Promotion" value="3" <%=__info.Promotion==3?"checked":"" %> /><label for="Promotion_3">积分兑换</label></td>
                                        </tr>
                                    </table>
                                <span class="tips">促销属性，促销价格为最终价格</span>
                            </td>
                        </tr>

                      
                      <tr>
                        <td class="lefttd" height="30" ><font color=red >*</font>参考价格：</td>
                        <td class="tag_left">
                            <input name="Money" type="text" value="<%=__info.Money %>" id="Money" class="textbox" onfocus="zhekouss();" style="width:74px;" /> &nbsp; 元
                         
                        </td>
                      </tr> 
                      <tbody id="Tbody2"  style="display:none" >
                          <tr>
                            <td class="lefttd" height="30"> 折扣：</td>
                            <td class="tag_left">
                                <input name="zhekou" type="text" value="<%=__info.zhekou %>" class="textbox" id="zhekou" style="width:30px;" /> 折  
                          </td>
                      </tr> 
                      <tr>
                        <td class="lefttd" height="30" ><font color=red >*</font>课程价格：</td>
                          <td class="tag_left">
                              <input name="Price_Member" type="text" value="<%=__info.Price_Member %>" id="Price_Member" class="textbox" onKeyUp="zhekouss();" onkeydown="zhekouss();" style="width:74px;" /> &nbsp; 元
                              &nbsp; &nbsp; &nbsp;<input name="IsContainTax"  class="checkbtn" type="checkbox" value="1" <%=__info.IsContainTax1=="1"?"checked":"" %> /> 是否含税
                         </td>
                      </tr>  
                  </tbody>
                        <tbody id="Tbody5" style="display: <%= Utils.StrToInt(__info.Promotion)==1?"":"none" %>" >
                            <tr>
                                <td class="lefttd" height="30"><font color="red">*</font>抢购时间段：</td>
                                <td class="tag_left">
                                  <script>isHour = 1;</script>
                                    <input name="begintime" type="text" id="begintime" value="<%=__info.begintime %>" class="textbox  Wdate" onclick="WdatePicker({ dateFmt:&#39; yyyy-MM - dd HH: mm: ss&#39;, minDate:&#39;% y -% M -% d &#39;
});" />
                                    至
                                    <input name="endtime" type="text" id="endtime" value="<%=__info.endtime %>" class="textbox  Wdate" onclick="WdatePicker({ dateFmt:&#39; yyyy-MM - dd HH: mm: ss&#39;, minDate:&#39;% y -% M -% d &#39;
});" />
                                </td>
                            </tr>
                        </tbody>
                        <tbody id="Tbody6" style="display: <%= Utils.StrToInt(__info.Promotion)==1?"":(Utils.StrToInt(__info.Promotion)==2?"":"none") %>" >
                            <tr>
                                <td class="lefttd" height="30"><font color="red">*</font>抢购价：</td>
                                <td class="tag_left">
                                 	<input name="PanicMoney" type="text" id="PanicMoney" value="<%=__info.PanicMoney %>" class="textbox" style="width:74px;" />元       
                                </td>
                            </tr>
                            <tr>
                                <td class="lefttd" height="30">报名人数上限：</td>
                                <td class="tag_left">
                                    <input name="Limited" type="text" value="100" id="Limited" class="textbox" style="width:74px;" />人（设置“0”为不限）      
                                </td>
                            </tr>
                        </tbody>

                        <tbody id="Tbody7" style="display: <%= Utils.StrToInt(__info.Promotion)==3?"":"none" %>" >
                            <tr>
                                <td class="lefttd" height="30"><font color="red">*</font>兑换<%=MyCache.GetCacheConfig(90)  %>：</td>
                                <td class="tag_left">
                                    <input name="jifen" value="<%=__info.jifen %>" type="text" id="jifen" class="textbox" style="width:50px;" />分
                         			 <%if (__info.IsSetPrice == 1)
                                             { %> <input name="IsVip" class="checkbtn" type="checkbox" value="3" <%=__info.IsVip == 3 ? "checked" : "" %> />
                                是否VIP免费<%} %><span class="tips">纯<%=MyCache.GetCacheConfig(90)  %>兑换</span>
                                </td>
                            </tr>
                        </tbody>
                      
                       <tbody id="TbodyUserVIP"  style="display: <%=Utils.StrToInt(__info.IsSetPrice)==1?"":"none" %>">
                            <%if(__info.IsSetPrice==1){ %>
                         <tr>
                            <td class="lefttd" height="30" ><font color=red >*</font>VIP用户：</td>
                            <td class="tag_left">
                                <table id="ISLoad" onclick="iszhekou()" border="0">
                                    <tr>
                                        <td><input type="radio" id="ISLoad_0" name="ISLoad" value="0" <%= __info.ISLoad=="0"?"checked":"" %> /><label for="ISLoad_0">免费</label></td>
                                        <td><input type="radio" id="ISLoad_1" name="ISLoad" value="1"  <%= __info.ISLoad=="1"?"checked":"" %> /><label for="ISLoad_1">收费</label></td>
                                        <td><input type="radio" id="ISLoad_2" name="ISLoad" value="2"   <%= __info.ISLoad=="2"?"checked":"" %> /><label for="ISLoad_2">固定价格</label></td>
                                    </tr>
                                </table>  
                                <span id="Iszhekou" style="display:none;"> 折扣：
                                <input name="Loadzhekou" type="text" value=" <%=__info.Loadzhekou%>" class="textbox" style="width:30px;" />折（请输入0-10范围之内，例如 8.5 或者 6 ）
                                </span>
                                <span id="IsFixedPrice" style="display:none;"> 固定价格：<input name="FixedPrice" type="text" value="<%=__info.FixedPrice %>" class="textbox" />元</span>
                                <br /><font color=red >"收费"为年费用户购买付折扣费用,"免费"为对年费用户为免费课程，"固定价格"为年费用户购买的价格</font>
                            </td>
                        </tr> 
                           <%} %> 
                       </tbody>
                         
                  </tbody>
              
                  
                  <tr style="display:none">
                      <td class="lefttd" height="30" >购买课程有效时限：</td>
                      <td class="tag_left">                  
                         <input name="shixian" type="text" value="<%=__info.shixian %>" id="shixian" class="textbox" style="width:50px;text-align:center;padding-left:0;" /> &nbsp; 天 （设置“0”为不限） 
                      </td>
                  </tr> 
                  <tr>
                    <td class="lefttd">课程图片：</td>
                    <td class="tag_left" style="padding-left:0;"> 
                        <table class="coimgBox">
                            <tr>
                            <td>
                                <input id="DefaultPic" name="DefaultPic" width="350px" class="textbox" style="float:left"  type="text" value="<%=__info.DefaultPic%>" />
                            </td>
                            <td style="width:550px;" class="DefaultIframe"><%=Kesion.APPCode.UploadAPI.EchoUpload("courseUserPic","DefaultPic") %></td>
                          </tr>
                        </table>
                    </td>
                  </tr>
                  <tr>
                    <td class="lefttd" height="30">课程介绍：</td>
                    <td class="tag_left">
                       <textarea name="TxtIntro" rows="2" cols="20" id="TxtIntro" style="height:200px;width:80%;"><%=__info.TxtIntro %></textarea>
                       <% Kesion.APPCode.EditorAPI.EchoEditor("editor", "TxtIntro", "Basic", 0, false, true, true, false);     %>
                    </td>
                  </tr>  
                  <tr>
                    <td class="lefttd" height="30" style="width: 102px">出售方式：</td>
                    <td class="tag_left">
                         <table id="RBIsOff" class="radio" border="0" >
                            <tr>
                                <td class="bo-min"><input id="RBIsOff_0" type="radio" name="RBIsOff" value="1" <%=__info.RBIsOff=="1"?"checked":"" %> /><label for="RBIsOff_0">上架</label></td>
                                <td class="bo-min"><input id="RBIsOff_1" type="radio" name="RBIsOff" value="0" <%=__info.RBIsOff=="0"?"checked":"" %> /><label for="RBIsOff_1">下架</label></td>
                            </tr>
                        </table>
                    </td>
                  </tr>
                 </table>
			</div>
            <div class="tab-pane" style="display:none">
                <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="border">
                    <tr>
                        <td class="lefttd" height="30" style="width: 150px"><span>服务器选择</span>：</td>
                        <td class="tag_left">
                            <select name="LiveType" id="LiveType"  onchange=getaccountlist(this.value) >     
                                 <%=InniaLivePlay() %> 
                            </select>
                            <span id="showaccount" style="display: none">
								<select name="accountid" id="accountlist">
								</select></span>
                        </td>
                    </tr>              
         
                    <tr>
                        <td class="lefttd" height="30" style="width: 150px">是否开启课时管理：</td>
                        <td class="tag_left radio">
                            <table id="RadioButtonList4" onclick="doPeriod()" border="0">
                                <tr>
                                    <td class="bo-min"><input id="RadioButtonList4_0" type="radio" name="RadioButtonList4" value="0" <%=__info.RadioButtonList4=="0"?"checked":"" %> <%=KSCMS.S("do")=="modify"?"disabled='disabled'":"" %>/><label for="RadioButtonList4_0">关闭</label></td>
                                    <td class="bo-min"><input id="RadioButtonList4_1" type="radio" name="RadioButtonList4" value="1" <%=__info.RadioButtonList4=="1"?"checked":"" %> <%=KSCMS.S("do")=="modify"?"disabled='disabled'":"" %>/><label for="RadioButtonList4_1">开启</label></td>
                                 <span class="tips">TIPS:当一门课程有多个章节时，请启用课时管理，一旦设置，不允许修改。</span>
                                </tr>
                            </table>
                        </td>
                    </tr>
   				</table>
                <table id="Tbody10" style="display: none" width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="CTable border">  
                  <asp:PlaceHolder ID="LivePlace"  runat="server"></asp:PlaceHolder> 
                </table>
            </div>

            	<script>
    
                             jQuery(document).ready(function () {

                                 getaccountlist(0);

                             });
                             function getaccountlist(cid) {
                       
                                 livechecked0();
                                 var id = jQuery("#LiveType").val();
              var pid ='<%=pid%>';                    
                     
              if (id != '0') {
                  jQuery.get("/plus/course/LiveRoom.aspx", { a: "accountlist", id: id,pid:pid },
                      function (data) {
                      
                          if (data != null && data != '') {
                              jQuery("#showaccount").show();
                              jQuery("#accountlist").empty().append(data);
                          } else {
                              jQuery("#showaccount").hide();
                              jQuery("#accountlist").empty().append("<option value='0'>请选择账号...</option>");
                          }
                      });
              }else{
                  jQuery("#showaccount").hide();

                  jQuery("#accountlist").empty().append("<option value='0'>请选择账号...</option>");
              }
          }
				</script>
            <div class="tab-pane" style="display:none">
                <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="border">
                     <tr style="display:none">
		                 <td class="lefttd" height="30" >课程省市：</td>
		                 <td class="tag_left">
							 <script src="/plus/area.aspx?pid=<%=__info.Provinceid %>&cityid=<%=__info.CityId %>&CountyID=<%=__info.CountyId %>"></script>
                             <span class="tips">选择课程所在的省份和城市,方便检索。</span>
		                 </td>
	                 </tr>
                   	 <tr>
                         <td class="lefttd" height="30">是否邮寄资料：</td>
                         <td class="tag_left">
                             <table id="IsSendNote" class="radio" onclick="ShowNoteSetting()" border="0">
                                 <tr>
                                     <td class="bo-min">
                                         <input id="IsSendNote1_1" type="radio" name="IsSendNote1" value="1" <%=__info.IsSendNote1=="1"?"checked":"" %> />
                                         <label for="IsSendNote1_1">是</label></td>
                                     <td class="bo-min">
                                         <input id="IsSendNote1_0" type="radio" name="IsSendNote1" value="0" <%=__info.IsSendNote1=="0"?"checked":"" %> />
                                         <label for="IsSendNote1_0">否</label></td>
                                 </tr>
                             </table>
                         </td>
                     </tr>
                     <tr class="note">
                         <td class="lefttd" height="30">资料价格：</td>
                         <td class="tag_left">
                             <input name="NotePrice" type="text" value="<%=__info.NotePrice %>" id="NotePrice" class="textbox" style="width: 50px; text-align: center; padding-left: 0;" />
                             &nbsp; 元 
                             <span class="tips"></span><span class="tips">只保留两位小数</span>
                         </td>
                     </tr>
                     <tr class="note">
                         <td class="lefttd" height="30">资料简介：</td>
                         <td class="tag_left">
                             <textarea name="NoteContent" rows="2" cols="20" id="NoteContent" style="height: 100px; width: 40%;"><%=__info.NoteContent %></textarea>
                         </td>
                     </tr>
                     <tr>
                       <td class="lefttd" height="30" style="width:120px">课程目标：</td>
                       <td class="tag_left">
                           <textarea name="TxtTarget" rows="2" cols="20" id="TxtTarget" style="height:200px;width:80%;"><%=__info.TxtTarget %></textarea>
                          <% Kesion.APPCode.EditorAPI.EchoEditor("editor", "TxtTarget", "Basic", 0, false, true, true, false);     %>
                       </td>
		             </tr>
                     <tr>
                       <td class="lefttd" height="30" style="width:120px">课程公告：</td>
                       <td class="tag_left">
                           <textarea name="TxtNotice" rows="2" cols="20" id="TxtNotice" style="height:200px;width:80%;"><%=__info.TxtNotice %></textarea>
                            <% Kesion.APPCode.EditorAPI.EchoEditor("editor", "TxtNotice", "Basic", 0, false, true, true, false);     %>
                          </td>
                     </tr>
                </table>
            </div>
        </div>
       </div>
       <script>
          $('.tabs-spec li').click(function() {
              $(this).addClass('active').siblings().removeClass('active');
              $('.tab-content>.tab-pane:eq(' + $(this).index() + ')').show().siblings().hide();
          });
       </script>
 		<!--选项卡-->	
         <div class="cz_btn nofloat t-a-center" style="padding-top:10px;margin-bottom:100px;">
		
				<span><input type="submit" name="Button2" value="确定保存(O)" onclick="return (CheckForm());" id="Button2" class="button" /></span>
			<span><input type="button" class="button" onclick="window.history.go(-1);"value=" 返 回 "></span>
	     </div>
	  </form>
      <div class="clear blank10"></div>
	  
      </div>
	  </div>
<%} %>
	 <script>
	 
	     $(function () {
	         if ($(".price_cor font").text() == "免费") {
	             $(".price_cor font").css("color", "green");
	         }
	     })
	
	     $(document).ready(function(){
	         doPeriod();

	     }); 
	 
	     function zhekouss() {
	         var money = document.getElementById('Money').value;
	         var Price = document.getElementById('Price_Member').value;
	         var zhekou = (parseFloat(Price / money) * 10).toFixed(1);

	         if (zhekou == "NaN" || zhekou <= 0) {
	             zhekou = 0;
	         } else if (zhekou == "Infinity" || zhekou >= 10) {
	             zhekou = 10;
	         }
	         document.getElementById('zhekou').value = zhekou;
	     }

	     function ShowNoteSetting(){
	         var checkrad2 = jQuery("#IsSendNote :radio[checked]").val();
	         if(checkrad2=='1')
	         {
	             jQuery(".note").show();
	         }
	         else 
	         {
	             jQuery(".note").hide();
	         }
	     }

	     function CheckForm() {

	         if (jQuery('#TxtName').val() == '') {
	             KesionJS.Alert('课程名称必须输入!', "jQuery('#TxtName').focus()");
	             return false;
	         }
	         var dest = document.getElementById('teacherlist').value;

	         if (dest == '') {
	             KesionJS.Alert('请选择课程教师!', "jQuery('#teacherlist').focus()");
	             return false;
	         }
             var checkrad = jQuery("#RadioButtonList2 :radio[checked]").val();
               var promotion1 = jQuery("#Promotion :radio[checked]").val();
	         if (checkrad == "1") {
	             if ($('#Money').val() == "") {
	                 KesionJS.Alert("请设置参考价格！", "jQuery('#Money').focus()");
	                 return false;
                 }
                 if (promotion1 == "0") {
                     if ($('#Price_Member').val() == "") {
                         KesionJS.Alert("请设置课程价格！", "jQuery('#Price_Member').focus()");
                         return false;
                     }
                     if (parseFloat($('#Price_Member').val()) > parseFloat($('#Money').val())) {
                         KesionJS.Alert("课程价格不能大于参考价格！", "jQuery('#Price_Member').focus()");
                         return false;
                     }
                 }
	         }else if(checkrad == "0"){
	             if(jQuery("#IsSendNote :radio[checked]").val() == "1"){
	                 KesionJS.Alert("免费课程不能邮寄资料啦！", "jQuery('#NotePrice').focus()");
	                 return false;
	             }
	         }
             if (jQuery("#IsSendNote :radio[checked]").val() == "1" && parseFloat(jQuery('#NotePrice').val()) < 0){
                 KesionJS.Alert("资料价格不能小于0，请重新输入！", "jQuery('#NotePrice').focus()");
                 return false;
             }
	         return true;
	     }
		
	     function doPeriod(){
	         var checkrad1 = jQuery("#RadioButtonList4 :radio[checked]").val();
	 	   
	         if(checkrad1=='0')
	         {
                 jQuery("#Tbody10").show();
                   playback();
	             livechecked0();
	             checked();
	         }
	         else 
	         {
	             jQuery("#Tbody10").hide();
	             jQuery("#Tr1").hide();
	             $("#playothervideo").hide();
	             $("#othervideo").hide();
	         }
	     }
	     function livechecked0(){

	         var a=jQuery("#LiveType").val();
	 	  
	         if (a == 0) {
	             
	             $("#othervideo").show();
	             $("#zdylive").hide();
             } else if (a > 4 && a != 6) {
	             $("#zdylive").show();
	             $("#othervideo").hide();
	            
             }
             else
	         {
	            
	             $("#zdylive").hide();
	             $("#othervideo").hide();
	         }
	     }
	     function checked(){
						
	         var a=  jQuery("#moveplaytype").val();
	         if (a==0){
						   
	             $("#letv").show();    
	             $("#showlist").hide();
	             $("#YunVideo").hide();
	             $("#playothervideo").hide();
					  
	         }else{
	             var isyun='1';
	             if(isyun=='2')//新客户
	             {
						   
	                 if(a==100)
	                 {
	                     $("#playothervideo").show();
	                     $("#YunVideo").hide();
	                     $("#letv").hide();
	                 }
	                 else if(a==0)
	                 {
						
	                     $("#YunVideo").hide();
	                     $("#playothervideo").hide();
	                     $("#letv").show();
	                 }
	                 else 
	                 {
	                     $("#TxtYunVideoID").val("");
	                     $("#YunVideo").show();
	                     $("#playothervideo").hide();
	                     $("#letv").hide();
	                 }
	                 $("#showlist").hide();
	             }
	             else{
	                 $("#letv").hide();
	                 $("#showlist").show();
	                 $("#YunVideo").hide();
	                 $("#playothervideo").hide();
	             }
	         }
	     }   
	    
	     $(document).ready(function(){
	         //doPeriod();
	     });  


</script>