<!--#include virtual="/common/lib/dbcon.asp"-->
<!--#include virtual="/common/lib/func.asp"-->
<%
Dim ZC_SG
Dim sql, rs1
Dim seq, zipcode, sido, gugun, dong, ri, st_bunji, ed_bunji
Dim addr_t1

ZC_SG = inputValue( Request.Form("ZC_SG") )
%>
<link rel="Stylesheet" type="text/css" href="/manager/common/css/all.css" />
<script type="text/javascript">
<!--
function wdZipcode(post,addr) {

	var post1 = post.substr(0,3);
	var post2 = post.substr(4,3);

	
	window.parent.document.getElementById("frm").m_zip1.value=post1;
	window.parent.document.getElementById("frm").m_zip2.value=post2;
	window.parent.document.getElementById("frm").m_addr1.value=addr;

	//parent.document.getElementById("frm").wd_addr2.focus();
	window.parent.document.getElementById("Addr_search1").style.display = "block";
	window.parent.document.getElementById("Addr_search2").style.display = "none";
}
//-->
</script>
<body>
	<%

		if InputValue(ZC_SG) <> "" then

			sql = "select * from zipcode where dong LIKE '%" & ZC_SG & "%'"
			Set rs1 = dbcon.execute( sql )

			If rs1.bof Or rs1.bof Then
%>
			<font color=#008E8B>등록된 데이터가 없습니다.</font>
<%

			Else
				Do Until rs1.eof
					seq			= rs1("SEQ")
					zipcode		= trim(rs1("ZIPCODE"))
					sido		= trim(rs1("SIDO"))
					gugun		= trim(rs1("GUGUN"))
					dong		= trim(rs1("DONG"))
					ri			= trim(rs1("RI"))
					st_bunji	= trim(rs1("ST_BUNJI"))
					ed_bunji	= trim(rs1("ED_BUNJI"))

					addr_t1		= sido & " " & gugun & " " & dong & " " & ri

					if st_bunji <> "" and ed_bunji <> "" then
'						addr_t2 = st_bunji & " ~ " & ed_bunji & "동"
						addr_t2 = st_bunji & " ~ " & ed_bunji
					else
						addr_t2 = ""
					End if

					addr_t = addr_t1 & addr_t2
%>
					<a href="javascript:wdZipcode('<%=left(zipcode,3)%>-<%=right(zipcode,3)%>','<%=addr_t1%>')">[<%=left(zipcode,3)%>-<%=right(zipcode,3)%>]
					<%=addr_t%></a><br><img width="0" height="6"><br>
<%

					rs1.movenext
				loop

			End If
			
			Set rs1 = nothing

		End if
%>
			
</body>
</html>
<%
dbcon.close
Set dbcon = nothing
%>