<%@ page language="C#" autoeventwireup="true" inherits="Course_CourseEFRM, App_Web_vzflj4p3" stylesheettheme="Themes" theme="Themes" %>

<!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>编辑课程信息</title>
    <link rel="stylesheet" href="../css/form-field-tooltip.css" media="screen" type="text/css">

    <script type="text/javascript" src="../js/rounded-corners.js"></script>

    <script type="text/javascript" src="../js/form-field-tooltip.js"></script>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <script type="text/javascript" src="../Js/jquery.js"></script>

    <script type="text/javascript" src="../Js/jquery.pngFix.pack.js"></script>

    <script type="text/javascript" src="../Js/WebValidator.js"></script>

    <script type="text/javascript" src="../Js/InterfaceContrl.js"></script>
        <script src="../js/artDialog3/artDialog.min.js"></script>
      <script>          (function($) { var d = $.dialog.defaults; d.skin = ['chrome']; })(art);</script>
    <style type="text/css">
        .style1
        {
            width: 6%;
        }
    </style>


</head>
<body>
<div id="loading">
        <div style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background-color: #ffffff;
            z-index: 10; filter: alpha(opacity=90); opacity: 0.9;">
        </div>
        <div id="msg_area" style="z-index: 200; left: 289px; position: absolute; top: 202px;">
            <div id="msgPanel" style="z-index: 200;" height="24px" width="100px" bordercolor="#eeeeee"
                borderstyle="Solid" borderwidth="1px">
                <asp:Image ID="img" runat="server" ImageUrl="~/images/loading.gif" />
                <font style="font-size: 9pt;color:Gray;">loading...读取中......</font>
            </div>
        </div>
    </div>
    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="0" class="table_box">
        <tr>
            <td class="r_top_box margintop5">
                <table cellspacing="0" cellpadding="5" class="r_top_title_box">
                    <tr>
                        <td align="right">
                            <asp:Button ID="btnSave" runat="server" SkinID="big_btn" Text="保存课程基本信息" OnClick="btnSave_Click"
                                ValidationGroup="save" />
                            &nbsp;&nbsp;
                            <asp:Button ID="btnReturn" runat="server" Text="返回" OnClick="btnReturn_Click" Visible="False" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="margintop5">
                <table cellpadding="0" cellspacing="1" width="100%" class="table_notitle">
                    <tr>
                        <td class="td02" align="left" colspan="2">
                            基本设置
                        </td>
                    </tr>
                    <tr>
                        <td bgcolor="#ffffff" align="right" class="td01" height="20" style="width: 6%">
                            课程名称:
                        </td>
                        <td bgcolor="#ffffff" width="30%" align="left" height="20">
                            <asp:TextBox ID="txtName" runat="server" Width="150px" MaxLength="25"></asp:TextBox><font
                                color="red"> *</font>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
                                ErrorMessage="请填写课程名称" ValidationGroup="save" SetFocusOnError="True"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                            所属类型:
                        </td>
                        <td bgcolor="#ffffff" height="20" align="left">
                            <asp:DropDownList ID="ddlTypeID" runat="server" Width="155px">
                            </asp:DropDownList>
                            <font color="red">*</font>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddlTypeID"
                                ErrorMessage="请选择所属类型" ValidationGroup="save" InitialValue="0" SetFocusOnError="True"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                            标准课时:
                        </td>
                        <td bgcolor="#ffffff" height="20" align="left">
                            <asp:TextBox ID="txtMinutes" runat="server" Text="5" Width="150px"></asp:TextBox>
                            分钟<asp:Image ID="Image1" runat="server" ImageUrl="../images/helpnew.gif" CssClass="img_style"
                                tooltipText="提示：课时是指该课程理论上的学习时间，或者表示为希望学员学习的时间（会影响到学员的学习进度）。最小时间为5分钟。" Height="16px"
                                Width="16px" />
                            <font color="red">*</font><asp:RequiredFieldValidator ID="RequiredFieldValidator2"
                                runat="server" ControlToValidate="txtMinutes" ErrorMessage="请填写课时" ValidationGroup="save"
                                SetFocusOnError="True"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                            课程描述: <span style="color: Red;">(限200字)</span>
                        </td>
                        <td bgcolor="#ffffff" height="20" align="left">
                            <asp:TextBox ID="txtDescrip" runat="server" Width="400px" Height="100px" TextMode="MultiLine"
                                MaxLength="200"></asp:TextBox><font color="red"> *</font>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtDescrip"
                                ErrorMessage="请填写课程描述" ValidationGroup="save"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td bgcolor="#ffffff" align="right" class="td01" style="width: 6%">
                            是否允许申请选修:
                        </td>
                        <td bgcolor="#ffffff" align="left">
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        <asp:RadioButtonList ID="rbtIsCanApply" runat="server" RepeatDirection="Horizontal">
                                            <asp:ListItem Value="1">是</asp:ListItem>
                                            <asp:ListItem Selected="True" Value="0">否</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td>
                                    <td>
                                        <asp:Image ID="Image2" runat="server" ImageUrl="../images/helpnew.gif" CssClass="img_style"
                                            tooltipText="提示：指该课程是否允许学员申请（此设置只针对选修课）。" Height="16px" Width="16px" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                            &nbsp;</td>
                        <td bgcolor="#ffffff" height="20" align="left">
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        <asp:RadioButtonList ID="rbtIsMustExam" runat="server" RepeatDirection="Horizontal"
                                            AutoPostBack="true" 
                                            OnSelectedIndexChanged="rbtIsMustExam_SelectedIndexChanged" Visible="False">
                                            <asp:ListItem Value="1">是</asp:ListItem>
                                            <asp:ListItem Selected="True" Value="0">否</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td>
                                    <td>
                                        <asp:Image ID="Image3" runat="server" ImageUrl="../images/helpnew.gif" CssClass="img_style"
                                            tooltipText="提示：指该课程是作为选修课是否需要考试（此设置只针对选修课）。" Height="16px" Width="16px" 
                                            Visible="False" />
                                    </td>
                                </tr>
                            </table>
                        </td></tr>
    </table>
    </td></tr>
    <tr>
        <td class="margintop5">
            <table cellpadding="0" cellspacing="1" width="100%" class="table_notitle">
                <tr>
                    <td align="left" colspan="2" class="td02">
                        可选设置
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                        图片:
                    </td>
                    <td bgcolor="#ffffff" height="20" width="30%" align="left">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td><img id="imgView" border="0" runat="server" name="imgBigView" src="../Upload/CourseImage/noimage.gif"
                            onerror="this.src='../Upload/CourseImage/noimage.gif'" width="90" height="120" /></td>
                                <td><input id="fileImg" class="txt" runat="server" onchange="check(form1.fileImg);" type="file"
                            accept="image/*" /><br /><br />
                        <span>（*图片仅限GIF、JPG、PNG）</span><br />
                        <span>（*分辨率控制为90px * 120px）</span></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                        学分:
                    </td>
                    <td bgcolor="#ffffff" height="20" align="left">
                        <asp:TextBox ID="txtCredit" runat="server" Text="0" Width="150px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtCredit"
                            ErrorMessage="请填写学分" ValidationGroup="save" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                        费用:
                    </td>
                    <td bgcolor="#ffffff" height="20" align="left">
                        <asp:TextBox ID="txtCost" runat="server" Text="0" Width="150px"></asp:TextBox>元
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                        点数:
                    </td>
                    <td bgcolor="#ffffff" height="20" align="left">
                        <asp:TextBox ID="txtPoint" runat="server" Text="0" Width="150px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff" height="20" align="right" class="td01" style="width: 6%">
                        备注:<span style="color: Red;">(限100字)</span>
                    </td>
                    <td bgcolor="#ffffff" height="20" align="left">
                        <asp:TextBox ID="txtRemark" runat="server" Width="400px" Height="160px" TextMode="MultiLine"
                            MaxLength="100"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff" height="20" align="right" class="style1">
                    </td>
                    <td bgcolor="#ffffff" height="20" align="left">
                        <asp:RadioButtonList ID="rbtState" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="rbtState_SelectedIndexChanged"
                            Visible="false" AutoPostBack="true">
                        </asp:RadioButtonList>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    </table>
    </form>

    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            Validator();
        });
        function Validator() {
            $('#<%= btnSave.ClientID %>').bind('click', function() {
                //                ValidatorEmpty($("#<%=txtName.ClientID %>"), "课程名称");
                //                ValidatorEmpty($("#<%=txtDescrip.ClientID %>"), "课程描述");
                ValidatorEmpty($("#<%=txtCost.ClientID %>"), "费用");
                //                ValidatorEmpty($("#<%=txtMinutes.ClientID %>"), "课时");
                ValidatorEmpty($("#<%=txtPoint.ClientID %>"), "点数");
                //                ValidatorEmpty($("#<%=txtCredit.ClientID %>"), "学分");
                //                ValidateDropdownList($("#<%= ddlTypeID.ClientID %>"), "所属类型");

                return GetValidatorMessage();
            });
            $("#<%=txtMinutes.ClientID %>").onlypressInt();
            $("#<%=txtCost.ClientID %>").onlypressDecimal(7, 2);
            $("#<%=txtPoint.ClientID %>").onlypressInt();
            $("#<%=txtCredit.ClientID %>").onlypressInt();
            $("#<%=txtName.ClientID %>").textlimit(25);
            $("#<%=txtDescrip.ClientID %>").textlimit(200);
            $("#<%=txtMinutes.ClientID %>").textlimit(5);
            $("#<%=txtCost.ClientID %>").textlimit(5);
            $("#<%=txtPoint.ClientID %>").textlimit(5);
            $("#<%=txtCredit.ClientID %>").textlimit(5);
            $("#<%=txtRemark.ClientID %>").textlimit(100);
        }
        function check(object) {
            var fileName = object.value;
            if (fileName.lastIndexOf(".") != -1) {
                var fileType = (fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length)).toLowerCase();
                var suppotFile = new Array();
                suppotFile[0] = "gif";
                suppotFile[1] = "png";
                suppotFile[2] = "jpg";
                for (var i = 0; i < suppotFile.length; i++) {
                    if (suppotFile[i] == fileType) {
                        form1.imgView.src = fileName;
                        //document.getElementById("imgView").visible = false;
                        //document.getElementById("imgPreview").filters.
                        //item("DXImageTransform.Microsoft.AlphaImageLoader").src = fileName;
                        return true;
                    }
                    else {
                        continue;
                    }
                }
                alert("不支持文件类型" + fileType);
                return false;
            }
            else {
                alert("文件只支持GIF，JPG，PNG");
            }
        }
    </script>

    <script type="text/javascript">
	
　　        var tooltipObj = new DHTMLgoodies_formTooltip();
        tooltipObj.setTooltipWidth('240');
        tooltipObj.setTooltipPosition('right');
        tooltipObj.setPageBgColor('#EEE');
        tooltipObj.setCloseMessage('');
        tooltipObj.initFormFieldTooltip();

    </script>
<script type="text/javascript">
    $("#loading").fadeOut()
</script>
</body>
</html>
