<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="New_Form.aspx.cs" Inherits="RM.Web.Mall.Admin.New_Form" %>

<!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 id="Head1" runat="server">
    <title><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_glsEdit")%></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/DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/Validator/JValidator.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <style type="text/css">
        #promptBg ul, #promptBg li { padding: 0; margin: 0; list-style: none; }
        .promptLink { display: block; padding: 0 3px; font-size: 10pt; }
        .activeLink { background-color: #e0f5bc; }
        .activePrompt { background-color: #E0ECCC; }
    </style>
    <script type="text/javascript">
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table border="0" cellpadding="0" cellspacing="0" class="frm">
    <tr>
            <th>
                <span style="color: Red; padding: 0 2px;">*</span><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_newTitle")%>:
            </th>
            <td>
                <input id="N_title" maxlength="50" runat="server" class="txt" style="width: 200px" />
            </td>
            <th><span style="color: Red; padding: 0 2px;">*</span><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Ques_fenlei")%>：</th>
            <td>
                <select id="N_type" class="select" runat="server" style="width: 206px;">
                </select>
            </td>
        </tr>
         <tr>
            <th>
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_Author")%>:
            </th>
            <td>
                <input id="N_Author" maxlength="50" runat="server" class="txt" style="width: 200px" />
            </td>
            <th>
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_newSource")%>:
            </th>
            <td>
                <input id="N_Source" maxlength="50" runat="server" class="txt" style="width: 200px" />
            </td>
        </tr>
        <tr>
            <th>
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_recommend")%>:
            </th>
            <td>
                <%--<input id="N_Recommend" maxlength="50" runat="server" class="txt" style="width: 200px" />--%>
                <select id="N_Recommend" class="select" runat="server" style="width: 206px;">
                    <option value="0" selected="selected">推荐</option>
                    <option value="1">不推荐</option>
                </select>
            </td>
            <th>
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_browse")%>:
            </th>
            <td>
                <input id="N_Number" maxlength="50" runat="server" class="txt" style="width: 200px" datacol="yes" err="浏览量"
                        checkexpession="Num" value="0" />
            </td>
        </tr>
        <tr>
            <th>
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_img")%>:
            </th>
            <td colspan="3">
                <asp:FileUpload ID="FileUpload1" runat="server" style=" width:252px;" />
                <img id="photo" width="50" style="position: absolute; top: 5px; left: 0px; width: 50px;" src="<%=img_url %>" />
            </td>
        </tr>
        <tr>
            <th>
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_webmate")%>:
            </th>
            <td colspan="3">
                <input id="mate" runat="server" class="txt" style="width: 606px" />
            </td>
        </tr>
        <tr>
            <th>
                <span style="color: Red; padding: 0 2px;">*</span><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_webcontent")%>:
            </th>
            <td colspan="3">
                <script src="/Themes/Scripts/kindeditor/kindeditor-min.js" type="text/javascript"></script>
                <script type="text/javascript">
                    var editor;
                    KindEditor.ready(function (K) {
                        editor = K.create('#N_cantent', {
                            allowFileManager: true,
                            allowUpload: true,
                            uploadJson: '/WeiXin/UploadImage.ashx',
                            minHeight: 250
                        });
                    });
                </script>
                <textarea id="N_cantent" runat="server" style="width: 670px;" ></textarea>
            </td>
        </tr>
    </table>
    </div>
    <div class="frmbottom" style="margin-top: 30px;">
        <asp:LinkButton ID="Save" runat="server" class="l-btn" OnClientClick="return checkedData()"
            OnClick="Save_Click"><span class="l-btn-left">
            <img src="/Themes/Images/disk.png" alt="" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Save")%></span></asp:LinkButton>
        <a class="l-btn" href="javascript:void(0)" onclick="OpenClose();"><span class="l-btn-left">
            <img src="/Themes/Images/cancel.png" alt="" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Close")%></span></a>
    </div>
    </form>
<script type="text/javascript">
    function checkedData() {
        if (!isIntegerOrNull(jQuery.trim($("#N_Number").val()))) {
            showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("lllwszx")%>', 1500, 3);
            return false;
        }
        if (jQuery.trim($("#N_title").val()).length < 1) {
            showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_intitle")%>', 1500, 3);
            return false;
        }
        var type = jQuery.trim($("#N_type").val()).length;
        if (type < 1) {
            showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_newType")%>', 1500, 3);
            return false;
        }
        if (editor.isEmpty()) {
            showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Mall_incontent")%>', 1500, 3);
            return false;
        }
        //同步数据到文本框
        editor.sync();
        return true;
    }
    function isIntegerOrNull(obj) {
        var controlObj = $.trim(obj);
        if (controlObj.length == 0 || controlObj == null || controlObj == undefined) {
            return true;
        }
        reg = /^[-+]?\d+$/;
        if (!reg.test(obj)) {
            return false;
        } else {
            return true;
        }
    }
    $(function () {
        $("#photo").hover(function () {
            $("#photo").css("width", "200px");
        }
        , function () {
            $("#photo").css("width", "50px");
        });
    });
    </script>
</body>
</html>
