<!--#include virtual="/common/lib/dbcon.asp"-->
<!--#include virtual="/common/lib/func.asp"-->
<%
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").b_zip1.value=post1;
	window.parent.document.getElementById("frm").b_zip2.value=post2;
	window.parent.document.getElementById("frm").b_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 ZC_SG <> "" then

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

			if rs1.bof Or rs1.eof 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 & "동"
						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
		End if
	%>
</body>
</html>
<%
dbcon.close
Set dbcon =nothing

%>
