<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StuReview_UpForm.aspx.cs"
    Inherits="RM.Web.Training.Review.StuReview_UpForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("StuReview_up")  %></title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/jquery.form.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/Validator/JValidator.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.source.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <style type="text/css">
    #SharesInfo a{ color:Blue; }
    </style>
</head>
<body>
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("StuReview_up")  %>
        </div>
    </div>
    <form id="form1" runat="server">
    <%--获取附加信息值--%>
    <input id="AppendProperty_value" type="hidden" runat="server" />
    <div class="btnbarcontetn">
        <div style="text-align: right">
            <asp:LinkButton ID="Save" runat="server" class="l-btn" OnClientClick="return CheckValid();"
                OnClick="Save_Click">
                <span class="l-btn-left">
                    <img src="/Themes/Images/disk.png" alt="" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Save")%></span></asp:LinkButton>
        </div>
    </div>
    <div class="div-body">
        <table id="table1" border="0" cellpadding="0" cellspacing="0" class="frm">
            <tr>
                <th>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("StuReview_zpm") %>
                </th>
                <td>
                    <input id="TKS_Review_UploadNmae" maxlength="35" runat="server" type="text" class="txt"
                        datacol="yes" err="" checkexpession="NotNull" style="width: 200px" />
                </td>
            </tr>
            <tr>
                <th>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("StuReview_up")  %>
                </th>
                <td>
                    <input type="button" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("StuReview_select") %>" id="scbtn" onclick="upload()" /><input id="TKS_Review_UploadURL" type="hidden" runat="server" />
                    <span id="SharesInfo" style=" color:Red;"></span>
                    <div id="tksup" style=" position:absolute; display: none; border: 1px #ccc solid; width: 610px; margin-left: 0px;background-color: White; padding-left:10px;">
    </div>
                </td>
            </tr>
            
        </table>
        <table id="table2" border="0" cellpadding="0" cellspacing="0" class="frm">
            <%=str_OutputHtml.ToString()%></table>
    </div>
    </form>
    
    <script type="text/javascript" src="/Live/swfobject.js"></script>
    <script type="text/javascript">
    //初始化
        $(function () {
            if(QueryString("e") != "")
            {
                $("input").css("border","0px");
                $("#scbtn").hide();
                $("#Save").hide();
                disableForm("form1","disable");
            }
            Setform();
            if($("#TKS_Review_UploadURL").val() != "")
            {
                 $("#SharesInfo").html("<a href='"+$("#TKS_Review_UploadURL").val()+"'><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("StuReview_ups") %></a>");
            }
       });
        function upload() {
            var flashvars = {
                FileType: '<%=uemodel.RWorksAttribute_format %>',
                FileMaxCount: 1,
                FilePath: '/Training/Review/StuReview_Add.ashx',
                FileSize: <%=uemodel.RWorksAttribute_size %>
            };
            FlexUpload(flashvars);
        }
        //Flex文件上传
        function FlexUpload(flashvars) {
            $("#tksup").show();
            $("#tksup").append("<div id='ad1'></div>");

            var swfVersionStr = "10.0.0";
            var xiSwfUrlStr = "/live/playerProductInstall.swf";
            var params = {};
            params.quality = "high";
            params.bgcolor = "#ffffff";
            params.allowscriptaccess = "sameDomain";
            params.allowfullscreen = "true";
            var attributes = {};
            attributes.id = "ad1";
            attributes.name = "ad1";
            attributes.align = "middle";
            swfobject.embedSWF("/Live/TKS-UP.swf", "ad1", "600", "270", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
        }
        //Flex上传回调函数
        //---name:为文件名---data:FilePath地址返回值
        function uploadCompelete(name, data) {
            $("#SharesInfo").html("[<a href='"+data+"'>"+name+"</a>]<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("StuReview_ups") %>");
            $("#TKS_Review_UploadURL").val(data);
        }
        //全部文件上传结束后触发
        function uploadEnd(name) {
            $("#tksup").hide();
            $("#ad1").remove();
        }
        //删除视频
        function moviedelete(obj) {
            $(obj).parent("li").remove();
        }
         //附加信息表单赋值
        function Setform() {
            var pk_id = GetQuery('key');
            if (IsNullOrEmpty(pk_id)) {
                var strArray = new Array();
                var strArray1 = new Array();
                var item_value = $("#AppendProperty_value").val(); //后台返回值
                strArray = item_value.split(';');
                for (var i = 0; i < strArray.length; i++) {
                    var item_value1 = strArray[i];
                    strArray1 = item_value1.split('|');
                    $("#" + strArray1[0]).val(strArray1[1]);
                }
            }
        }
        //获取表单值
        function CheckValid() {
            if (!CheckDataValid('#form1')) {
                return false;
            }
            var item_value = '';
            $("#AppendProperty_value").empty;
            $("#table2 tr").each(function (r) {
                $(this).find('td').each(function (i) {
                    var pk_id = $(this).find('input,select').attr('id');
                    if ($(this).find('input,select').val() != "" && $(this).find('input,select').val() != "==<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("plaese_sel")%>==" && $(this).find('input,select').val() != undefined) {
                        item_value += pk_id + "|" + $(this).find('input,select').val() + ";";
                    }
                });
            });
            $("#AppendProperty_value").val(item_value);
            return true;
       }
       
//禁用form表单中所有的input[文本框、复选框、单选框],select[下拉选],多行文本框[textarea]

function disableForm(formId,isDisabled) {
    
    var attr="disable";
	if(!isDisabled){
	   attr="enable";
	}
	$("form[id='"+formId+"'] :text").attr("disabled",isDisabled);
  
	$("form[id='"+formId+"'] textarea").attr("disabled",isDisabled);
	$("form[id='"+formId+"'] select").attr("disabled",isDisabled);
	$("form[id='"+formId+"'] :radio").attr("disabled",isDisabled);
	$("form[id='"+formId+"'] :checkbox").attr("disabled",isDisabled);
   
    
	
	//禁用jquery easyui中的下拉选（使用input生成的combox）

	$("#" + formId + " input[class='combobox-f combo-f']").each(function () {
		if (this.id) {alert("input"+this.id);
			$("#" + this.id).combobox(attr);
		}
	});
	
	//禁用jquery easyui中的下拉选（使用select生成的combox）
	$("#" + formId + " select[class='combobox-f combo-f']").each(function () {
		if (this.id) {
		alert(this.id);
			$("#" + this.id).combobox(attr);
		}
	});
	
	//禁用jquery easyui中的日期组件dataBox
	$("#" + formId + " input[class='datebox-f combo-f']").each(function () {
		if (this.id) {
		alert(this.id)
			$("#" + this.id).datebox(attr);
		}
	});
}



    </script>
</body>
</html>
