<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog/DialogMaster.Master" AutoEventWireup="true"
    CodeBehind="ClueImportFileUpload.aspx.cs" Inherits="OAWeb.crm.clues.ClueImportFileUpload" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="form" style="width: 600px;">
        <table cellpadding="0" cellspacing="0" border="0" class="table_form">
            <tr>
                <td class="data_title" style="padding: 0px 10px;">
                    1、一次性导入最好不要超过2000-3000条.
                    <br />
                    2、如需导入大数据文件，可以拆分多个小文件然后再分别导入。
                </td>
            </tr>
        </table>
        <table cellpadding="0" cellspacing="0" border="0" class="table_form">
            <tr>
                <td class="right width120">
                    指定导入文件格式：
                </td>
                <td>
                    <asp:DropDownList ID="ddlFileExt" runat="server" CssClass="width180">
                        <asp:ListItem Value=".csv">CSV(*.CSV)</asp:ListItem>
                        <asp:ListItem Value=".xls">Excel(*.xls)</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr class="import_attr">
                <td colspan="2" style="padding-left: 10px">
                    <input name="rdoSign" type="radio" value="0" checked="checked" />
                    逗号分隔的文件<br />
                    <input name="rdoSign" type="radio" value="1" />
                    制表符分隔的文件<br />
                    <input name="rdoSign" type="radio" value="2" />
                    自定义分隔符分隔的文件
                    <input name="txtSign" type="text" class=" text width50" /><br />
                    <asp:DropDownList ID="ddlEncoding" runat="server">
                        <asp:ListItem Value="GB2312" Selected="True">GB2312 简体中文字符编码</asp:ListItem>
                        <asp:ListItem Value="UTF-8">UTF-8 </asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="padding-left: 10px">
                    <input name="file_uploader" type="file" /><input name="chkTitle" type="checkbox"
                        checked="checked" />有标题栏
                </td>
            </tr>
            <tr>
                <td class="right width120">
                </td>
                <td>
                    <input id="btnNext" type="button" value=" 下一步 " class="btn_77px" />
                    <input id="btnClose" type="button" value=" 返 回 " onclick="art.dialog.close();return false;"
                        class="btn_77px" />
                </td>
            </tr>
        </table>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#<%=ddlFileExt.ClientID %>").change(function () {
                if ($(this).val() == ".csv")
                    $(".import_attr").show();
                else
                    $(".import_attr").hide();
            })
            $("#btnNext").click(function () {
                $("#aspnetForm").ajaxSubmit({
                    url: "/crm/clues/ClueImportFileUpload.aspx?op=UploadFile&r=" + Math.random(),
                    success: function (result) {
                        if (result.indexOf("ok:") > -1) {
                            window.location.href = result.replace("ok:", "");
                        } else {
                            alert(result);
                        }
                    }
                });
                return false;
            })
        });
    </script>
</asp:Content>
