<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" Inherits="Web.inherits.UserViewPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>商家资料-<%=WebSiteConfig.SiteTitle%></title>
    <link href="<%path:%>Css/common.css" rel="stylesheet" />
    <link href="<%path:%>Css/user.css" rel="stylesheet" />
    <script src="/Js/jquery-1.8.2.min.js"></script>
    <script src="/Js/data.js"></script>
    <script src="/Js/bx.library.js"></script>
    <script src="<%path:%>js/web.js"></script>  

    <link href="/plugin/Upload/upload.css" rel="stylesheet" />
    <script src="/plugin/Upload/upload.js"></script>
</head>
<body>
    <!--head-->
    <%template:_head.html%>
    <!--body-->
    <div class="body main">
        <div class="split">&nbsp;</div>
        <div class="usercenter">
            <div class="left"><%template:_usermenu.html%></div>
            <div class="right">
                <div class="content">
                    <div class="title">
                        <h3>商家信息 <span class="note">(<span class="nonullalert">*</span>为必须填写项)</span></h3>
                    </div>
                    <table class="infoform">
                        <tr>
                            <td class="itemtitle">当前状态:</td>
                            <td class="itemcontent">
                                <%=ValueToText(ShopConfig.Status,new Hashtable{{"","新申请"},{"0","等待审核"},{"1","已审核"},{"2","已关闭"}})%>
                               
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle"><span class="nonullalert">*</span>&nbsp;商家名称:</td>
                            <td class="itemcontent">
                                <input class="text" id="CompanyName" name="CompanyName" type="text" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle">二级域名:</td>
                            <td>
                                <input class="text" id="Domain" name="Domain" type="text" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle"><span class="nonullalert">*</span>&nbsp;联系人:</td>
                            <td class="itemcontent">
                                <input class="text" id="Contact" name="Contact" type="text" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle"><span class="nonullalert">*</span>&nbsp;联系电话:</td>
                            <td class="itemcontent">
                                <input class="text" id="Tel" name="Tel" type="text" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle">邮箱地址:</td>
                            <td class="itemcontent">
                                <input class="text" id="Email" name="Email" type="text" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle">商家地址:</td>
                            <td>
                                <input class="text" id="CompanyAddress" name="CompanyAddress" type="text" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle">横幅广告:</td>
                            <td class="itemcontent">
                                <script type="text/javascript">
                                    var ShopBanner = new UploadStyle("ShopBanner", true);
                                    ShopBanner.rootPath="/";
                                    document.write(ShopBanner.initialSingleFile("/Ashx/FileUpload.ashx?cmd=shop&source=html"));
                                </script>
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle">横幅广告链接:</td>
                            <td class="itemcontent">
                                <input class="text" id="txtShopBannerLink" name="ShopBannerLink" type="text" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle">商家Logo:</td>
                            <td class="itemcontent">
                                <script type="text/javascript">
                                    var CompanyLogo = new UploadStyle("CompanyLogo", true);
                                    CompanyLogo.rootPath="/";
                                    document.write(CompanyLogo.initialSingleFile("/Ashx/FileUpload.ashx?cmd=shop&source=html"));
                                </script>
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle">商家简介:</td>
                            <td class="itemcontent">
                                <textarea id="txtCompanyIntroduce" name="CompanyIntroduce" class="xheditor-simple editor" cols="60" rows="10"></textarea>
                            </td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                <input id="Button1" onclick="submitForm();" type="button" value="提交" /></td>
                            <td>&nbsp;</td>
                        </tr>
                    </table> 
                </div>
            </div>
        </div>
    </div>
    <!--foot-->
    <%template:_foot.html%>
    <script src="/Js/form.js"></script>
    <!--如果没有编辑器的需求,可以取消这两个链接-->
    <script type="text/javascript" class="xheditor_script" src="/Plugin/Editor/xheditor/xheditor.min.js"></script>
    <script type="text/javascript" src="/Plugin/Editor/xheditor/xheditor_lang/zh-cn.js"></script>

    <script type="text/javascript">
    form.set(<%=ShopConfigString%>)
    function submitForm() {
        $('#txtCompanyIntroduce').val(editor.getSource());
        form.init([
            {"Name":"CompanyName","Type":"text","Null":"0","Error":"商家名称不能为空"},
            {"Name":"Contact","Type":"text","Null":"0","Error":"联系人不能为空"},
            {"Name":"Tel","Type":"text","Null":"0","Error":"联系电话不能为空"},
            {"Name":"CompanyLogo","Type":"javascript","Call":"CompanyLogo.get()"}
        ]);
        if(form.check()=="")
        {
            var formValue = form.getJsonStr();
            User.updateShopConfig({ "cmd": "updateshopconfig","form":formValue },function(result){
                if (result.status == "success") {
                    Alert(result.message);
                } else {
                    Alert(result.message);
                }
            });
        }
    }
    var editor;
    window.onload = function () {
        editor=$('#txtCompanyIntroduce').xheditor();
    }
    </script>

</body>
</html>
