<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Edit.aspx.cs" Inherits="Contact_Edit" ValidateRequest="false" meta:resourcekey="Page" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../libs/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../libs/bootstrapValidator.min.css">
    <link rel="stylesheet" href="../libs/fontawesome/css/all.min.css" >
    <script type="text/javascript" src="../libs/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="../libs/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../libs/bootstrapValidator.min.js"></script>
</head>
<body>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#form1").bootstrapValidator().on('success.form.bv', function (e) {
                // 폼 서브미션 금지하고 __doPostBack 호출
                e.preventDefault();
                __doPostBack("SaveButton", "");
            });

            $("form input:text").keydown(function () {
                if (event.keyCode == 13) {
                    return false;
                }
                return true;
            });
        });

        function OnNameChanged() {
            var lastName = $("#<%= LastNameTextBox.ClientID %>").val();
            var firstName = $("#<%= FirstNameTextBox.ClientID %>").val();
            $("#<%= DispNameTextBox.ClientID %>").val(lastName + firstName);
        }

        function GotoList() {
            location.href = "List.aspx?folder=<%=_folderId%>&page=<%=_page%>";
        }
    </script>

    <form id="form1" runat="server"
        data-bv-feedbackicons-valid="glyphicon glyphicon-ok" 
        data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
        data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <div class="container-fluid">
            <div class="row" id="toolBar" data-spy="affix">
                <div class="col-xs-12" style="padding-top:2px;padding-bottom:2px;">
                    <button type="submit" id="saveToolButton" class="btn btn-primary"><span class="fa-solid fa-download"></span> <asp:Localize ID="Localize1" runat="server" meta:resourcekey="L01">저장</asp:Localize></button>
                    <span>&nbsp;</span>
                    <button type="button" id="closeToolButton" class="btn btn-primary" onclick="GotoList();"><span class="fa-solid fa-xmark"></span></button>
                </div>
            </div>
        </div>

        <div class="container-fluid" style="padding-top:40px">
            <div class="panel panel-default">
                <div class="panel-heading"><asp:Localize ID="Localize2" runat="server" meta:resourcekey="L02">기본정보</asp:Localize></div>
                <div class="panel-body">
                    <div class="form-group">
                        <label for="LastNameTextBox"><asp:Localize ID="Localize3" runat="server" meta:resourcekey="L03">성</asp:Localize>:</label>
                        <input type="text" runat="server" id="LastNameTextBox" name="LastNameTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" onchange="OnNameChanged();" 
                            required data-bv-notempty-message="<%$ Resources:, Msg01%>" />
                    </div>
                    <div class="form-group">
                        <label for="FirstNameTextBox"><asp:Localize ID="Localize4" runat="server" meta:resourcekey="L04">이름</asp:Localize>:</label>
                        <input type="text" runat="server" id="FirstNameTextBox" name="FirstNameTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" onchange="OnNameChanged();"
                            required data-bv-notempty-message="<%$ Resources:, Msg02%>" />
                    </div>
                    <div class="form-group">
                        <label for="DispNameTextBox"><asp:Localize ID="Localize5" runat="server" meta:resourcekey="L05">표시 이름</asp:Localize>:</label>
                        <input type="text" runat="server" id="DispNameTextBox" name="DispNameTextBox" class="form-control" maxlength="255" placeholder="<%$ Resources:, Msg03%>" autocomplete="off"
                            required data-bv-notempty-message="<%$ Resources:, Msg04%>" data-bv-trigger="blur" />
                    </div>
                    <div class="form-group">
                        <label for="JobCompanyTextBox"><asp:Localize ID="Localize6" runat="server" meta:resourcekey="L06">회사</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobCompanyTextBox" name="JobCompanyTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="JobDepartmentTextBox"><asp:Localize ID="Localize7" runat="server" meta:resourcekey="L07">부서</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobDepartmentTextBox" name="JobDepartmentTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="JobTitleTextBox"><asp:Localize ID="Localize8" runat="server" meta:resourcekey="L08">직함</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobTitleTextBox" name="JobTitleTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" />
                    </div>
                    <div class="checkbox">
                        <label><input type="checkbox" id="FavoriteCheckBox" runat="server"><asp:Localize ID="Localize9" runat="server" meta:resourcekey="L09">자주 사용하는 연락처에 등록</asp:Localize></label>
                    </div>
                    <div class="form-group">
                        <label for="MemoTextBox"><asp:Localize ID="Localize10" runat="server" meta:resourcekey="L10">메모</asp:Localize>:</label>
                        <textarea class="form-control" rows="6" id="MemoTextBox" runat="server"></textarea>
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading"><asp:Localize ID="Localize11" runat="server" meta:resourcekey="L11">전화번호</asp:Localize></div>
                <div class="panel-body">
                    <div class="form-group">
                        <label for="JobPhoneTextBox"><asp:Localize ID="Localize12" runat="server" meta:resourcekey="L12">회사</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobPhoneTextBox" name="JobPhoneTextBox" class="form-control" maxlength="32" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="HomeMobileTextBox"><asp:Localize ID="Localize13" runat="server" meta:resourcekey="L13">휴대폰</asp:Localize>:</label>
                        <input type="text" runat="server" id="HomeMobileTextBox" name="HomeMobileTextBox" class="form-control" maxlength="32" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="JobFaxTextBox"><asp:Localize ID="Localize14" runat="server" meta:resourcekey="L14">팩스</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobFaxTextBox" name="JobFaxTextBox" class="form-control" maxlength="32" placeholder="" autocomplete="off" />
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <asp:Localize ID="Localize15" runat="server" meta:resourcekey="L15">전자메일</asp:Localize>
                    <button type="button" class="btn btn-default btn-xs pull-right" data-toggle="collapse" data-target="#InternetPanel"><span class="fa-solid fa-chevron-down"></span></button>
                </div>
                <div class="panel-body collapse" id="InternetPanel">
                    <div class="form-group">
                        <label for="EmailTextBox1"><asp:Localize ID="Localize16" runat="server" meta:resourcekey="L16">전자메일1</asp:Localize>:</label>
                        <input type="text" runat="server" id="EmailTextBox1" name="EmailTextBox1" class="form-control" maxlength="128" placeholder="" autocomplete="off"  
                            data-bv-emailaddress data-bv-emailaddress-message="<%$ Resources:, Msg05%>" />
                    </div>
                    <div class="form-group">
                        <label for="EmailTextBox2"><asp:Localize ID="Localize17" runat="server" meta:resourcekey="L17">전자메일2</asp:Localize>:</label>
                        <input type="text" runat="server" id="EmailTextBox2" name="EmailTextBox2" class="form-control" maxlength="128" placeholder="" autocomplete="off"  
                            data-bv-emailaddress data-bv-emailaddress-message="<%$ Resources:, Msg05%>" />
                    </div>
                    <div class="form-group">
                        <label for="EmailTextBox3"><asp:Localize ID="Localize18" runat="server" meta:resourcekey="L18">전자메일3</asp:Localize>:</label>
                        <input type="text" runat="server" id="EmailTextBox3" name="EmailTextBox3" class="form-control" maxlength="128" placeholder="" autocomplete="off"  
                            data-bv-emailaddress data-bv-emailaddress-message="<%$ Resources:, Msg05%>" />
                    </div>
                    <div class="form-group">
                        <label for="JobWebpageTextBox"><asp:Localize ID="Localize19" runat="server" meta:resourcekey="L19">홈페이지</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobWebpageTextBox" name="JobWebpageTextBox" class="form-control" maxlength="128" placeholder="" autocomplete="off" />
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <asp:Localize ID="Localize20" runat="server" meta:resourcekey="L20">회사 주소</asp:Localize>
                    <button type="button" class="btn btn-default btn-xs pull-right" data-toggle="collapse" data-target="#JobAddrPanel"><span class="fa-solid fa-chevron-down"></span></button>
                </div>
                <div class="panel-body collapse" id="JobAddrPanel">
                    <div class="form-group">
                        <label for="JobZipcodeTextBox"><asp:Localize ID="Localize21" runat="server" meta:resourcekey="L21">우편 번호</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobZipcodeTextBox" name="JobZipcodeTextBox" class="form-control" maxlength="32" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="JobCityTextBox"><asp:Localize ID="Localize22" runat="server" meta:resourcekey="L22">시/도</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobCityTextBox" name="JobCityTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="JobStateTextBox"><asp:Localize ID="Localize23" runat="server" meta:resourcekey="L23">구/군/시</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobStateTextBox" name="JobStateTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="JobStreetTextBox"><asp:Localize ID="Localize24" runat="server" meta:resourcekey="L24">주소</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobStreetTextBox" name="JobStreetTextBox" class="form-control" maxlength="255" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="JobCountryTextBox"><asp:Localize ID="Localize25" runat="server" meta:resourcekey="L25">국가</asp:Localize>:</label>
                        <input type="text" runat="server" id="JobCountryTextBox" name="JobCountryTextBox" class="form-control" maxlength="32" placeholder="" autocomplete="off" />
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <asp:Localize ID="Localize26" runat="server" meta:resourcekey="L26">집 주소</asp:Localize>
                    <button type="button" class="btn btn-default btn-xs pull-right" data-toggle="collapse" data-target="#HomeAddrPanel"><span class="fa-solid fa-chevron-down"></span></button>
                </div>
                <div class="panel-body collapse" id="HomeAddrPanel">
                    <div class="form-group">
                        <label for="HomeZipcodeTextBox"><asp:Localize ID="Localize27" runat="server" meta:resourcekey="L21">우편 번호</asp:Localize>:</label>
                        <input type="text" runat="server" id="HomeZipcodeTextBox" name="HomeZipcodeTextBox" class="form-control" maxlength="32" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="HomeCityTextBox"><asp:Localize ID="Localize28" runat="server" meta:resourcekey="L22">시/도</asp:Localize>:</label>
                        <input type="text" runat="server" id="HomeCityTextBox" name="HomeCityTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="HomeStateTextBox"><asp:Localize ID="Localize29" runat="server" meta:resourcekey="L23">구/군/시</asp:Localize>:</label>
                        <input type="text" runat="server" id="HomeStateTextBox" name="HomeStateTextBox" class="form-control" maxlength="64" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="HomeStreetTextBox"><asp:Localize ID="Localize30" runat="server" meta:resourcekey="L24">주소</asp:Localize>:</label>
                        <input type="text" runat="server" id="HomeStreetTextBox" name="HomeStreetTextBox" class="form-control" maxlength="255" placeholder="" autocomplete="off" />
                    </div>
                    <div class="form-group">
                        <label for="HomeCountryTextBox"><asp:Localize ID="Localize31" runat="server" meta:resourcekey="L25">국가</asp:Localize>:</label>
                        <input type="text" runat="server" id="HomeCountryTextBox" name="HomeCountryTextBox" class="form-control" maxlength="32" placeholder="" autocomplete="off" />
                    </div>
                </div>
            </div>
        </div>

        <div style="display:">
            <asp:LinkButton ID="SaveButton" runat="server" OnClick="SaveButton_Click" /> 
        </div>
    </form>
</body>
</html>
