/home/mjc1/public_html/onlinecs/mobile/postcode.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?
include_once("./_common.php");
include(
"./header.php"); 
include(
"./commonST.php");

if(!isset(
$_GET['uid'])) $_GET['uid'] = "";
if(!isset(
$_GET['detail'])) $_GET['detail'] = "";
if(!isset(
$_GET['txtdate'])) $_GET['txtdate'] = "";
if(!isset(
$_GET['txtdate2'])) $_GET['txtdate2'] = "";
if(!isset(
$_GET['new'])) $_GET['new'] = "";
?>

<script>
function addressSubmit(){
var keywordAddress = document.getElementById("keyword").value;
var addressValue = document.getElementById("address").value;
    if(keywordAddress == "" || keywordAddress == "읍/면/동을 입력하세요."){
        alert("주소를 선택하세요");
        return;
    }
    if(addressValue == ""){
        alert("주소를 선택하세요");
        return;        
    }
    var url = "./buyWrite_order.php?uid=<?=$_GET['uid']?>&detail=<?=$_GET['detail']?>&txtdate=<?=$_GET['txtdate']?>&txtdate2=<?=$_GET['txtdate2']?>&new=<?=$_GET['new']?>&addressValue="+addressValue;
    location.replace(url);
}
</script>
        <div class="snb">
            <p class="txt">주소검색 <span class="f11 blue">간편한 우편번호 찾기입니다.</span></p>
        </div>


        <div class="addrBtn">
            <ul>
                <li>
                    <a href="postcode.php?uid=<?=$_GET['uid']?>&detail=<?=$_GET['detail']?>&txtdate=<?=$_GET['txtdate']?>&txtdate2=<?=$_GET['txtdate2']?>&new=<?=$_GET['new']?>"><div class="b_on">(구)지번주소</div></a>
                </li>            
                <li>
                    <a href="postcode_doro.php?uid=<?=$_GET['uid']?>&detail=<?=$_GET['detail']?>&txtdate=<?=$_GET['txtdate']?>&txtdate2=<?=$_GET['txtdate2']?>&new=<?=$_GET['new']?>"><div class="b_off">도로명주소</div></a>
                </li>
            </ul>
        </div><!-- class=addrContents -->



        <span id='aaa' style='display:none;'>
            <div class="addrContents">
                <div class="postSearch">
                    <div class="books_carry"  style="height:300px;">도로명주소 나오는 란</div>
                </div>
            </div>
        </span>
        <!-- 도로명주소 끝 -->


        <span id='bbb' style='display:block;'>
            <div class="addrContents">

                <form name='searchFrm' id="searchFrm" method="post">
                <div class="postSearch">
                    <div class="books_carry">
                        <dl class="wr1">
                            <dt><label>읍/면/동</label></dt>
                            <dd>
                                <input type="text" name="keyword" id="keyword" maxlength="100" placeholder="읍/면/동을 입력하세요." class="it">
                                <input type="text" name="" id="" style="display:none;">
                            </dd>
                        </dl>    

                        <dl class="wr1">
                            <dt class="screen_out"><label>저장, 취소 버튼입니다.</label></dt>
                            <dd>
                                <ul class="btn_total">
                                    <li class="b_gray"><a href="javascript:chgpass();"><div>검 색</div></a></li>
                                    <li style="width:5px;"></li>
                                    <li class="b_blue"><a href="javascript:addressSubmit();"><div>선 택</div></a></li>
                                    <li style="width:5px;"></li>
                                    <li class="b_defn"><a href="javascript:location.replace('index.php');"><div>취 소</div></a></li>
                                </ul>
                            </dd>
                        </dl>

                        <p class="postcodeText">아래 주소를 선택하시고 <strong>[선택]</strong>버튼을 누르세요.</p>

                    </div><!-- <div class="books_carry"> -->
                </div><!-- <div class="pwd_section"> -->
                <!-- id="searchFrm" -->
                
                <div class="list">
                    <h2>주소내역</h2>
                    <div class="books_carry">
                        <select name="address" id="address" style='width:100%; height:50%;' size='6'>
                            <!--option value=''>대구 수성구 범어1동 대구지방노동청 │ 706-943</option-->
                        </select>
                    </div>
                </div><!-- id="list" -->
            <span> 
            <!-- 지번주소 끝 -->
            </form>


        </div><!-- <div class="addrContainer"> -->

<script>
function chgpass() {
    var keyword = document.getElementById("keyword").value;
    
    var code = keyword;
    var div    = $(".books_carry");                    // 셀렉트박스의 상위객체
    var idx = 0;
    var cnt = $('select', div).size();                // 셀렉트박스의 갯수
    var depth = cnt -1 + idx;
    var combo = $('select', div).eq(idx);
    var text = '<option value="">주소</option>';
    
    if(code == ''){                                    // 전체를 선택했을 경우
        $('select:gt('+ idx +')', div).html(text);
        return;
    }
    document.getElementById("address").options.length = 0;  //모두삭제
    
    $.post('./postAjax.php',{code:code,idx:idx}, function(rst) {
        var sel1 = $.trim(rst).split(/\n/);
        
        $('select:gt('+idx+')',div).html(text);
        // 데이터값이없으면..
        if (sel1 == '') {
            alert('데이터가 존재하지 않습니다.');
            return false;
        }
        for(var k in sel1) {
            var tmp = sel1[k].split(/\|/);
            combo.append('<option value="'+tmp[0]+'">' + tmp[1] + '</option>');
        }
    });
}        
</script>


<? include("./footer.php"); ?>



                <!-- <table>
                <caption>주소 조회 내역입니다.</caption>
                <thead>
                    <tr>
                        <th class="zipCode">우편번호</th>
                        <th class="city">시/도</th>
                        <th class="town">구/군</th>
                        <th class="district">동/면</th>
                        <th class="street">번지</th>
                    </tr>
                </thead>

                <tbody>
                    <tr>
                        <th colspan="5" bgcolor="#5076a9" style="height:3px;"></th>
                    </tr>
                    
                    <tr>
                        <td class="zipCode">140-021</td>
                        <td class="city">서울</td>
                        <td class="town">용산구</td>
                        <td class="district">용산5가 파크타워아파트</td>
                        <td class="street">(101~106동)</td>
                    </tr>

                </tbody>
            </table> -->