/home/mjc1/public_html/emillennium/include/change_pwd.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<style>
/*비밀번호변경*/
.change-pwd-container { position:fixed;left:50%;top:61px;width:300px;height:230px;margin-left:140px;border:1px solid #2f6ba9;background:#f7f7f7;z-index:10005;display:none;}
.change-pwd-container h1 { height:45px;line-height:45px;border-bottom:1px solid #2f6ba9;background:#5a94ce}
.change-pwd-container h1 span { position:absolute;left:20px;color:#FFF;font-size:18px;font-weight:600}
.change-pwd-container h1 a.pwd-close-btn { position:absolute;top:5px;right:12px;width:70px;heigth:34px;color:#FFF;line-height:34px;text-align:center;font-size:14px;font-weight:600;border:1px solid #FFF;}
.change-pwd-container .change-pwd { margin:15px;padding:10px 15px 5px;width:240px;border:1px solid #BBB;background:#FFF;}
.change-pwd label { margin-right:10px;font-size:13px;}
.change-pwd input[type=password] { margin-bottom:3px;padding:0 3px;width:145px;height:24px;line-height:24px;border:1px solid #E1E1E1;}
.change-pwd .change-pwd-btn { margin:0 auto;padding:10px 0;width:155px;}
.change-pwd a:first-child { margin-right:5px;}
.change-pwd a { display:inline-block;width:75px;height:24px;line-height:24px;text-align:center;color:#FFF;font-weight:600;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;
}
</style>
<div class="change-pwd-container">
    <h1>
        <span>비밀번호변경</span>
        <a class="pwd-close-btn">닫기</a>
    </h1>
    <!-- 검색 -->
    <div class="change-pwd">
    <form name="chgpassword" method="post" action="chgpassProcess.php" enctype="multipart/form-data">
        <fieldset>
            <legend class="screen_out">비밀번호 변경</legend>
            <label for="pwd">이전 비밀번호</label><input type="password" id="pwd" name='oldpass' placeholder="이전 비밀번호"><br />
            <label for="pwd-new1">신규 비밀번호</label><input type="password" id="pwd-new1" name='newpass' placeholder="신규 비밀번호"><br />
            <label for="pwd-new2">비밀번호 확인</label><input type="password" id="pwd-new2" name='newpass2' placeholder="비밀번호 확인">
        </fieldset>
        
        <div class="change-pwd-btn">
            <a href="#" class="blue-btn pop_pwsave_class" id='pop_pwsave_btn'><span>저장</span></a><a href="#" class="black-btn" id='pop_pwcancel_btn'><span>취소</span></a>
        </div>
    </form>
    </div><!--//change-pwd-->
    <!-- //검색 -->


</div><!--//change-pwd-->

<script type="text/javascript">
    $(function(){ 
        $(".change-pwd-container").hide();// 일단숨김

        $(".pwd-close-btn, #pop_pwcancel_btn").click(function () { 
            $(".change-pwd-container").fadeOut();
        });

        $("#pop_pwsave_btn").click(function(){ 
            chgpass();
        });

    });

    function chgpass()
    { 
        var oldpass = document.getElementsByName('oldpass')[0].value;
        var newpass = document.getElementsByName('newpass')[0].value;
        var newpass2 = document.getElementsByName('newpass2')[0].value;

        if (oldpass == ''){ 
            alert('이전 비밀번호를 입력해 주십시오.');
            chgpassword.oldpass.focus();
            return;
        }

        if (newpass == ''){ 
            alert('신규 비밀번호를 입력해 주십시오.');
            chgpassword.newpass.focus();
            return;
        }

        if (newpass2 == ''){ 
            alert('신규 비밀번호 확인을 입력해 주십시오.');
            chgpassword.newpass2.focus();
            return;
        }

        if (newpass !== newpass2){ 
            alert('신규 비밀번호가 일치하지 않습니다.');
            chgpassword.newpass2.focus();
            return;
        }

        var form_data =     $("form[name='chgpassword']").serialize();
            //alert(form_data);
            $.ajax({ type:"post", url:"ajax_chgpassProcess.php",data:form_data, dataType : "xml", 
                success:function(xml){     
                    var v_mode_ok = $(xml).find("mode_ok").text();
                    var v_msg = $(xml).find("msg").text();
                    if(v_mode_ok=='Y'){ 
                        alert(v_msg);
                        document.location.reload();
                    } else { 
                        alert(v_msg);
                    }

                },
                error:function(rtn,status,error){ 

                }
            });

        //chgpassword.submit();
    }
</script>