<!--#include virtual="/manager/common/file/member_top.asp"-->
<!--#include file="config.asp"-->

<%

if is_write <> "Y" Then
	Call Back_back("쓰기권한이 없습니다.")
End If


' 파라미터정보 *************************************************************************************
m_num		= InputValue(request("m_num"))
' **************************************************************************************************


If m_num = "" then	' 등록

	b_l_sdate = getDateFm(now,4)
	b_l_edate = getDateFm(now,4)

	' 자동가입방지
	randomize
	autoimg_str	= Int((5 * Rnd) + 1)
	' 01.png = DF4PH3
	' 02.png = HS42YP
	' 03.png = S8VP3X
	' 04.png = N4CW2U
	' 05.png = 9SK6GR


	' $autoimg_str = "1";
	m_pwd_type = "password"
	reset_url = "write.asp"
	is_title_str = "신규 회원 생성"

	m_div = "0||0"


else	' 수정

	
	' 레코드필드
	R_Fields = "m_num, m_id, m_pwd, m_name, m_nickname, m_jumin, m_zipcode, m_addr1, m_addr2, m_phone1, m_phone2, m_phone3, m_email, m_mobile1, m_mobile2, m_mobile3, m_fax1, m_fax2, m_fax3, m_homepage, m_date, m_modymate, m_lastdate, m_chuchun, m_ip, m_level,m_autoimg_str, m_temp1, m_temp2, m_temp3"	', m_div1, m_div2, m_rank, m_work, m_etc, m_subname"

	R_tablename_str = "member"

	R_WHERE_str = " WHERE m_num=" & m_num

	Call SelectQuery(R_Fields, R_tablename_str, R_WHERE_str)

	disabled_opt = "disabled ='disabled'"
	m_pwd_type = "text"
	reset_url = "list.asp?"&page_info
	is_title_str = "회원 정보 수정"

	m_div = m_div1&"||"&m_div2


End if


' 회원환경설정
R_Fields = "mc_idx, mc_agree, mc_addr, mc_nickname, mc_phone, mc_mobile, mc_email, mc_homepage, mc_joinlevel, mc_wdate, mc_agree_str, mc_jumin"

R_tablename_str = "member_config"

R_WHERE_str = " WHERE mc_idx=1"

Call SelectQuery(R_Fields, R_tablename_str, R_WHERE_str)


%>
<script type="text/javascript">
<!--
function w_chk(){
	
	
	
	if( CheckSpaces(document.getElementById('frm').m_name, '이름') ) { return ; }
	
	<%if mc_jumin = "Y" then%>
	else if( Number(document.getElementById('frm').m_jumin1, '주민번호앞자리') ) { return ; }
	else if( Number(document.getElementById('frm').m_jumin2, '주민번호뒷자리') ) { return ; }
	else if(jumin_chk(document.getElementById('frm').m_jumin1,document.getElementById('frm').m_jumin2) ) { return ; }
	<%end if%>

	else if (CheckSpaces(document.getElementById('frm').m_id, 'ID')) { return ; }
	else if (alphaDigit(document.getElementById('frm').m_id, 'ID')) { return ; }
	else if (CheckLen(document.getElementById('frm').m_id, '4', '30')) { return ; }
	
	<%if m_num = "" then %> ////등록일대만 보임
	/*
	else if (document.getElementById('frm').m_id_chk.value == ""){

		alert("아이디 중복체크를 확인하세요");
		//document.getElementById('frm').agree_chk.focus();
		return false; 
	
	}
	*/
	<%end if%>

	
	else if( CheckSpaces(document.getElementById('frm').m_pwd, '비밀번호') ) { return;  }
	<%if m_num = "" then%> //등록일대만 보임
	else if( CheckSpaces(document.getElementById('frm').m_pwdchk, '비밀번호확인') ) { return ; }
	else if( CheckEqual(document.getElementById('frm').m_pwd,document.getElementById('frm').m_pwdchk,'비밀번호')) { return ; }
	
	else if( CheckSpaces(document.getElementById('frm').m_autoimg_str,'자동가입방지')) { return ; }


	<%end if%>


	else {
		loading_st(1);
		document.getElementById('frm').submit();
	}

}

function disabled_chk(){
	
	alert("수정모드일때는 변경할수 없습니다.");

}
//-->
</script>


		<!-- 내용영역 -->
		<div id="contents">

			<div id="contents_head"> 
				<div id="contents_title">
					<img src="/manager/img/tit_ic03.gif" width="22" height="21" class="<%=skin%> center" alt="" /><h1><span><%=is_title_str%></span></h1>
				</div>
				<div id="location">
					<a href="/manager/">Home</a> &gt; <a href="/manager/content/03member/?sec=1">회원관리</a> &gt; <a href="write.asp" class="now"><%=is_title_str%></a>
				</div>
			</div>

			<!-- 내용들어가는곳 -->
			<div id="contents_area">


				<form id="frm" method="post" action="write_ok.asp?<%=page_info%>">

				<div>
				<input type="hidden" name="m_num" value="<%=m_num%>" /><!-- (수정일때사용) -->
				<input type="hidden" name="autoimg_str" value="<%=autoimg_str%>" />
				<input type="hidden" name="m_id_chk" value="" />
				<!--input type="hidden" name="m_level" value="<%=mc_joinlevel%>" /-->
				</div>


					<h2 class="<%=skin%>">회원 기본정보 <span><img src="/manager/img/ic_vcheck.gif" width="7" height="10" alt="*" /> 표시가 된 곳은 필수 항목입니다.</span></h2>
					<fieldset>
						<legend>회원 기본정보 서식 작성</legend>
						<table cellspacing="0" class="bbs_<%=skin%>" summary="신규 회원 기본정보를 위한 입력 양식입니다.">
						<caption>기능정보 서식</caption>
						<colgroup>
						<col width="140" />
						<col width="580" />
						</colgroup>
						<tr>
							<th scope="row"><label for="m_name"><img src="/manager/img/ic_vcheck.gif" width="7" height="10" alt="*" /> 이름</label></th>
							<td class="left"><input type="text" size="23" title="이름 입력" id="m_name" name="m_name" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_name%>" maxlength="30" tabindex="<%=getTabIndex()%>" <%'=disabled_opt %> /> <span class="text1">* 한글만 사용하실 수 있습니다. </span></td>
						</tr>
						<%If mc_jumin = "Y" then%>
						<tr>
							<th scope="row"><label for="m_jumin1"><img src="/manager/img/ic_vcheck.gif" width="7" height="10" alt="*" /> 주민등록번호</label></th>
							<td class="left"><input type="text" size="9" title="주민등록번호 앞자리(6자리) 입력" id="m_jumin1" name="m_jumin1" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" maxlength="6" value="<%=m_jumin1%>" tabindex="<%=getTabIndex()%>" /> - <input type="text" size="9" title="주민등록번호 뒷자리(7자리) 입력" id="m_jumin2" name="m_jumin2" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" maxlength="7" value="<%=m_jumin2%>" tabindex="<%=getTabIndex()%>" /> <span class="text1">* 숫자만 사용하실 수 있습니다. </span></td>
						</tr>
						<%End if%>
						<tr>
							<th scope="row"><label for="m_id"><img src="/manager/img/ic_vcheck.gif" width="7" height="10" alt="*" /> 아이디</label></th>
							<td class="left"><input type="text" size="23" title="아이디 입력" id="m_id" name="m_id" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_id%>" maxlength="30" tabindex="<%=getTabIndex()%>" <%=disabled_opt %> /> <span class="text1">* 10자 이내의 영문/숫자만 사용하실 수 있습니다. </span></td>
						</tr>
						<tr>
							<th scope="row"><label for="m_pwd"><img src="/manager/img/ic_vcheck.gif" width="7" height="10" alt="*" /> 비밀번호</label></th>
							<td class="left"><input type="<%=m_pwd_type%>" size="23" title="비밀번호 입력" id="m_pwd" name="m_pwd" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_pwd%>" maxlength="30" tabindex="<%=getTabIndex()%>" /></td>
						</tr>
						<%If m_num = "" then%><!--등록일대만 보임-->
						<tr>
							<th scope="row"><label for="m_pwd"><img src="/manager/img/ic_vcheck.gif" width="7" height="10" alt="*" /> 비밀번호확인</label></th>
							<td class="left"><input type="password" size="23" title="비밀번호 한번더 입력" id="m_pwdchk" name="m_pwdchk" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="" maxlength="30" tabindex="<%=getTabIndex()%>" /> <span class="text1">* 비밀번호를 한번 더 입력하세요.</span></td>
						</tr>
						<%End if%>

						<tr>
							<th scope="row"><label for="m_level"><img src="/manager/img/ic_vcheck.gif" width="7" height="10" alt="*" /> 그룹</label></th>
							<td class="left">
								<select id="m_level" name="m_level" title="회원가입시 등급 선택" tabindex="<%=getTabIndex()%>" >


									<%
										' 회원권한 부분										
										R_Fields_mg = "g_num, g_menuname"
										sql2 = "Select "&R_Fields_mg&" from member_group where g_chk='Y' order by g_code "
										Set Rs = Dbcon.Execute (sql2)
										
										Do While Not rs.eof
										
									%>
										<option value="<%=rs("g_num")%>" <%if m_level = rs("g_num") Then response.write "selected='selected'" End if %>><%=rs("g_menuname")%></option>
									<%
											rs.movenext
										loop

									%>
									
								</select>
							</td>
						</tr>

						<%If mc_homepage = "Y" Then %>
						<tr>
							<th scope="row"><label for="m_homepage">학력</label></th>
							<td class="left">
								<select name="m_homepage" id="m_homepage">
								<option>학력을 선택해주세요</option>
								<option value="1" <%if m_homepage = "1" Then response.write "selected='selected'" End if %>>초등학교 졸업</option>
								<option value="2" <%if m_homepage = "2" Then response.write "selected='selected'" End if %>>초등학교 재학</option>
								<option value="3" <%if m_homepage = "3" Then response.write "selected='selected'" End if %>>중학교 졸업</option>
								<option value="4" <%if m_homepage = "4" Then response.write "selected='selected'" End if %>>중학교 재학</option>
								<option value="5" <%if m_homepage = "5" Then response.write "selected='selected'" End if %>>고등학교 졸업</option>
								<option value="6" <%if m_homepage = "6" Then response.write "selected='selected'" End if %>>고등학교 재학</option>
								<option value="7" <%if m_homepage = "7" Then response.write "selected='selected'" End if %>>대학교 졸업</option>
								<option value="8" <%if m_homepage = "8" Then response.write "selected='selected'" End if %>>대학교 재학</option>
								</select>
							</td>
						</tr>
						<%End if%>

						<%If mc_addr = "Y" Then %>
						<tr>
							<th scope="row"><label for="m_zip1">주소</label></th>
							<td class="left">
								
								<div id="Addr_search1">

									<input type="button" value="우편번호찾기" class="ct_bt01" onclick="document.getElementById('Addr_search1').style.display='none';document.getElementById('Addr_search2').style.display='block';document.getElementById('frm').ZC_SG.focus();" tabindex="<%=getTabIndex()%>"/>

									<input type="text" size="4" title="우편번호 첫번째 3자리" id="m_zip1" name="m_zip1" class="input_box"  value="<%=left(m_zipcode,3)%>" tabindex="<%=getTabIndex()%>" />
									- 
									<input type="text" size="4" title="우편번호 두번째 3자리" id="m_zip2" name="m_zip2" class="input_box"  value="<%=mid(m_zipcode,3,3)%>" tabindex="<%=getTabIndex()%>" />

									<div class="pt3">
									<input type="text" size="26" title="주소" id="m_addr1" name="m_addr1" class="input_box" value="<%=m_addr1%>" tabindex="<%=getTabIndex()%>" />
									<input type="text" size="60" title="상세주소" id="m_addr2" name="m_addr2" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_addr2%>" maxlength="100" tabindex="<%=getTabIndex()%>" /><br />
									</div>

								</div>



								
								<!-- 우편번호 찾기 부분 -->
								<div id="Addr_search2" class="disnone" >
									<div class="post_write"><label for="ZC_SG">동이름</label> :
										<input type="text" id="ZC_SG" name="ZC_SG" size="10" class="input_box" onkeypress="if(event.keyCode==13){return false;}" value="" tabindex="<%=getTabIndex()%>" />
										<input type="button" value=" 검색 " class="post_btn" onclick="wdSearch_Addr()" tabindex="<%=getTabIndex()%>" />
										<input type="button" value=" 취소 " class="post_btn" onclick="document.getElementById('Addr_search1').style.display='block';document.getElementById('Addr_search2').style.display='none';"  tabindex="<%=getTabIndex()%>"/> 예)내당동, 수성구
									</div>
									<div class="post_search_wrap">
										<strong>↓ 기본 주소 </strong> - 동이름 검색 결과 목록입니다. 목록중 한개를 선택하세요.

										<!-- 우편번호 나열 -->
										<div id="Search_Form" class="post_search"></div>

									</div>
								</div>



								<script type="text/javascript">
								<!--
								function wdSearch_Addr(){

									if(!document.getElementById("frm").ZC_SG.value) {

										alert("검색어를 적어주세요");
										document.getElementById("frm").ZC_SG.focus();

									}else{
										//document.getElementById("Search_Form").innerHTML= " <table valign='top'><tr><td>찾는 중입니다!!!</td></tr><table> ";

										document.getElementById("frm_addr").ZC_SG.value = document.getElementById("frm").ZC_SG.value;

										document.getElementById("frm_addr").action = "/manager/content/01info/addr_search.asp";
										document.getElementById("frm_addr").target = "Search_Iframe";

										document.getElementById("Search_Form").innerHTML="<iframe name='Search_Iframe' width='100%' height='100%' frameborder='0'></iframe>";

										document.getElementById("frm_addr").submit();
									}
								}

								//-->
								</script>


							</td>
						</tr>
						<% End if%>

						<%If mc_nickname = "Y" then%>
						<tr>
							<th scope="row"><label for="m_nickname">닉네임(Nickname)</label></th>
							<td class="left"><input type="text" size="23" title="닉네임 입력" id="m_nickname" name="m_nickname" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_nickname%>" maxlength="30" tabindex="<%=getTabIndex()%>"  /> <span class="text1">* 10자이내의 한글만 사용하실 수 있습니다.</span></td>
						</tr>
						<%End if%>

						<%If mc_phone = "Y" Then %>
						<tr>
							<th scope="row"><label for="m_phone1">전화번호</label></th>
							<td class="left"><input type="text" size="4" title="연락처 첫번째 입력" id="m_phone1" name="m_phone1" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_phone1%>" maxlength="4" tabindex="<%=getTabIndex()%>" /> - <input type="text" size="4" title="연락처 두번째 입력" id="m_phone2" name="m_phone2" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_phone2%>" maxlength="4" tabindex="<%=getTabIndex()%>" /> - <input type="text" size="4" title="연락처 세번째 입력" id="m_phone3" name="m_phone3" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_phone3%>" maxlength="4" tabindex="<%=getTabIndex()%>" /></td>
						</tr>
						<%End if%>

						<%If mc_mobile = "Y" Then %>
						<tr>
							<th scope="row"><label for="m_mobile1">휴대폰</label></th>
							<td class="left"><input type="text" size="4" title="휴대폰 첫번째 입력" id="m_mobile1" name="m_mobile1" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_mobile1%>" maxlength="4" tabindex="<%=getTabIndex()%>" /> - <input type="text" size="4" title="휴대폰 두번째 입력" id="m_mobile2" name="m_mobile2" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_mobile2%>" maxlength="4" tabindex="<%=getTabIndex()%>" /> - <input type="text" size="4" title="휴대폰 세번째 입력" id="m_mobile3" name="m_mobile3" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_mobile3%>" maxlength="4" tabindex="<%=getTabIndex()%>" /></td>
						</tr>
						<%End if%>

						<%If mc_email = "Y" then%>
						<tr>
							<th scope="row"><label for="m_email">이메일</label></th>
							<td class="left"><input type="text" size="50" title=" 이메일 입력" id="m_email" name="m_email" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="<%=m_email%>" maxlength="100" tabindex="<%=getTabIndex()%>" /> <span class="text1"> * <strong>@</strong>포함한 이메일주소를 정확히 입력하세요.</span></td>
						</tr>
						<%End if%>

						

						<%If m_num = "" Then  %><!--등록일대만 보임-->
						<tr>
							<th scope="row"><label for="m_autoimg_str">자동가입방지</label></th>
							<td class="left"><img src="/manager/img/0<%=autoimg_str%>.png" width="156" height="62" alt="자동가입방지" class="img_center" /> &nbsp;<input type="text" size="20" title=" 자동가입방지 입력" id="m_autoimg_str" name="m_autoimg_str" class="input_box" onfocus="focus_on1_<%=skin%>(this);" onblur="focus_off1(this);" value="" maxlength="6" tabindex="<%=getTabIndex()%>" /><span class="text1"> * 왼쪽에 보이는 숫자 및 문자를 모두 입력하세요.</span></td>
						</tr>
						<%End if%>
						</table>
					</fieldset>




					<div class="contoll_box">
						<div id="<%=skin%>_bt"><span class="button"><input type="button" value="등록" onclick="w_chk();" tabindex="<%=getTabIndex()%>" /></span>  <span class="button"><input type="button" value="취소" onclick="page_go1('<%=reset_url%>');" tabindex="<%=getTabIndex()%>" /></span></div>
					</div>

				</form>

			</div>
			<!-- 내용들어가는곳 -->

		</div>
		<!-- //내용영역 -->
		

		<form id= "frm_addr" method='post' action="">
			<div>
				<input type="hidden" name="ZC_SG" />
			</div>
		</form>


<!--#include virtual = "/manager/common/file/sub_bottom.asp"-->

