Files
egbim_homepage/egbim/skin/member/basic/register_form.skin copy 2.php
T
2026-07-23 16:15:57 +09:00

483 lines
26 KiB
PHP

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
// add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
//add_javascript('<script src="'.G5_JS_URL.'/jquery.register_form.js"></script>', 0);
// if ($config['cf_cert_use'] && ($config['cf_cert_simple'] || $config['cf_cert_ipin'] || $config['cf_cert_hp']))
// add_javascript('<script src="'.G5_JS_URL.'/certify.js?v='.G5_JS_VER.'"></script>', 0);
//add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
?>
<!-- 회원정보 입력/수정 시작 { -->
<!-- <head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TOVA Join</title>
<link rel="stylesheet" href="../css/reset.css" />
<link rel="stylesheet" href="../css/font.css" />
<link rel="stylesheet" href="../css/style.css" />
<script src="../js/jquery-3.6.1.min.js"></script>
<script src="../js/common.js"></script>
</head> -->
<link rel="stylesheet" href="<?php echo G5_URL ?>/css/style.css" />
<!-- <body>
<div class="wrapper"> -->
<!-- Header -->
<!-- <header class="header">
<h1>
<img src="../img/logo_w.svg" alt="">
</h1>
<div class="menu_wrap">
<div class="menu_my"><img src="../img/ico_my.svg" alt=""></div>
<div class="menu_ham"><img src="../img/ico_ham.svg" alt=""></div>
</div>
</header> -->
<!-- //Header -->
<!--popup_wrap-->
<div id="pop_join" class="popup_wrap">
<!--popup_in-->
<div class="popup_in">
<button class="btn_close">
<div class="close_div"><img src="<?php echo G5_URL ?>/img/ico_close.svg" alt="sdi"></div>
</button>
<!--popup_content-->
<div class="popup_container register">
<!--pop_join_left-->
<div class="popup_tit">
<h1 class="h_1">회원가입</h1>
<ul>
<li class="join_step">
<h4 class="h_4">01</h4>
<h4 class="h_4 txt">약관동의</h4>
</li>
<li class="join_step on">
<h4 class="h_4">02</h4>
<h4 class="h_4 txt">계정 생성</h4>
</li>
<li class="join_step">
<h4 class="h_4">03</h4>
<h4 class="h_4 txt">사용자 인증</h4>
</li>
<li class="join_step">
<h4 class="h_4">04</h4>
<h4 class="h_4 txt">추가정보 입력</h4>
</li>
</ul>
</div>
<!--pop_join_right-->
<div id="reg_form_join" class="popup_contents_wrap">
<form id="fregisterform" name="fregisterform" action="<?php echo $register_action_url?>" onsubmit="return fregisterform_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="url" value="<?php echo $urlencode ?>">
<input type="hidden" name="agree" value="<?php echo $agree ?>">
<input type="hidden" name="agree2" value="<?php echo $agree2 ?>">
<input type="hidden" name="cert_type" value="<?php echo $member['mb_certify']; ?>">
<input type="hidden" name="cert_no" value="">
<!-- <?php //if (isset($member['mb_sex'])) { ?><input type="hidden" name="mb_sex" value="<?php //echo $member['mb_sex'] ?>"><?php //} ?> -->
<?php //if (isset($member['mb_nick_date']) && $member['mb_nick_date'] > date("Y-m-d", G5_SERVER_TIME - ($config['cf_nick_modify'] * 86400))) { // 닉네임수정일이 지나지 않았다면 ?>
<!-- <input type="hidden" name="mb_nick_default" value="<?php //echo get_text($member['mb_nick']) ?>">
<input type="hidden" name="mb_nick" value="<?php //echo get_text($member['mb_nick']) ?>"> -->
<?php //} ?>
<!-- 2025.07 디자인팀 수정 -->
<!-- 02 계정생성 -->
<!-- 왼쪽 "02 계정생성"에 on -->
<fieldset style="_display: none;">
<!--tbl_wrap-->
<div id="register_form" class="tbl_wrap">
<div class="guide_txt">
<p>계정을 생성합니다.</p>
<em>아이디와 비밀번호</em>를 입력해 주세요.
</div>
<table>
<tbody>
<tr>
<th class="h_4">아이디</th>
<td>
<div class="id_wrap">
<input type="text" class="frm_input full_input" id="reg_mb_id" name="mb_id" onchange="PG_pro('change');" placeholder="아이디 입력" <?php if($member['mb_id']!=""){ ?> style="width: 100% ;"<?php }?> autocomplete="off" value="<?php echo $member['mb_id'] ?>" <?php echo $required ?> <?php echo $readonly ?> maxlength="30"/>
<?php if($member['mb_id']==""){ ?>
<!-- <button type="button" class="chk_id" onclick="PG_pro('dupl_check');">중복확인</button> -->
<button type="button" class="chk_id" onclick="descopeEmailCheck();">중복확인</button>
<!-- hidden --><input type="hidden" id="dupl_check_yn" name="dupl_check_yn" value="" placeholder="아이디중복확인여부YN" style="width:250px; background-color:#dfe4ea "/>
<!-- hidden --><input type="hidden" id="GB_mb_id" name="GB_mb_id" value="<?php echo $member['mb_id'] ?>">
<?php }else{ ?>
<!-- hidden --><input type="hidden" id="reg_mb_id" name="mb_id" value="<?php echo $member['mb_id'] ?>">
<!-- hidden --><input type="hidden" id="dupl_check_yn" name="dupl_check_yn" value="Y" onclick="" style="width:250px; background-color:#dfe4ea "/>
<?php } ?>
</div>
<span class="important_msg h_6">이메일 형식으로 작성</span>
</td>
</tr>
<tr>
<th class="h_4">비밀번호</th>
<td>
<div class="password_wrap">
<input type="password" name="mb_password" id="reg_mb_password" <?php echo $required ?> class="frm_input full_input <?php echo $required ?>" minlength="3" maxlength="20" placeholder="비밀번호 입력">
<input type="password" name="mb_password_re" id="reg_mb_password_re" <?php echo $required ?> class="frm_input full_input <?php echo $required ?>" minlength="3" maxlength="20" placeholder="비밀번호 확인">
</div>
<span class="important_msg h_6">영문+숫자+특수기호 8자 이상</span>
</td>
</tr>
</tbody>
</table>
</div>
<!--//tbl_wrap-->
<div class="btn_confirm">
<button type="submit" id="btn_submit" class="btn_submit" >생성하기</button>
</div>
</fieldset>
<!-- 03 사용자 인증 -->
<!-- 왼쪽 "03 사용자 인증"에 on -->
<fieldset style="display: none;">
<!--tbl_wrap-->
<div id="register_form" class="tbl_wrap">
<div class="guide_txt">
<p>계정 생성이 완료되었습니다.</p>
사용자 인증을 위해 <em>aaa@gmail.com</em> <br>아이디로 전송된 인증번호를 입력해 주세요.
</div>
<div class="verify_wrap">
<div class="code_input">
<input type="text" maxlength="1" inputmode="numeric" pattern="[0-9]*" />
<input type="text" maxlength="1" inputmode="numeric" pattern="[0-9]*" />
<input type="text" maxlength="1" inputmode="numeric" pattern="[0-9]*" />
<input type="text" maxlength="1" inputmode="numeric" pattern="[0-9]*" />
<input type="text" maxlength="1" inputmode="numeric" pattern="[0-9]*" />
<input type="text" maxlength="1" inputmode="numeric" pattern="[0-9]*" />
</div>
<div>
<span class="important_msg h_6">인증번호 불일치</span>
<button class="btn_send">인증번호 재전송 ⭮</button>
</div>
</div>
</div>
<!--//tbl_wrap-->
<div class="btn_confirm">
<button type="submit" id="btn_submit" class="btn_submit" >인증하기</button>
</div>
<script>
const inputs = document.querySelectorAll('.code-input input');
inputs.forEach((input, index) => {
console.log('dd');
input.addEventListener('input', (e) => {
const value = e.target.value;
if (!/^[0-9]$/.test(value)) {
e.target.value = '';
return;
}
if (value && index < inputs.length - 1) {
inputs[index + 1].focus();
}
});
input.addEventListener('keydown', (e) => {
if (e.key === 'Backspace' && !e.target.value && index > 0) {
inputs[index - 1].focus();
}
});
});
</script>
</fieldset>
<!-- 04 추가정보 입력 -->
<!-- 왼쪽 "04 추가정보 입력"에 on -->
<fieldset style="display: none;">
<!--tbl_wrap-->
<div id="register_form" class="tbl_wrap">
<div class="guide_txt"><em>추가 정보를 입력</em>하여 <br class="brk">회원가입을 완료해 주세요.</div>
<table>
<tbody>
<tr>
<th class="h_4">가족사</th>
<td>
<div class="radio_wrap">
<label><input type="radio" class="on" name="family" value="hanmac" checked>한맥기술</label>
<label><input type="radio" name="family" value="saman">삼안</label>
<label><input type="radio" name="family" value="saman">장헌산업</label>
<label><input type="radio" name="family" value="saman">PTC</label>
<label><input type="radio" name="family" value="saman">바론컨설턴트</label>
<label><input type="radio" name="family" value="saman">한라산업개발</label>
</div>
</td>
</tr>
<tr>
<th class="h_4">이름</th>
<td>
<div class="name_wrap">
<input type="text" id="reg_mb_name" name="mb_name" value="<?php echo get_text($member['mb_name']) ?>" <?php echo $required ?> <?php echo $name_readonly; ?> class="frm_input full_input <?php echo $required ?> <?php echo $name_readonly ?>" size="10" placeholder="이름 입력">
</div>
</td>
</tr>
<tr>
<th class="h_4">직위 및 사번</th>
<td>
<div class="company_wrap">
<input type="text" name="mb_comp" value="<?php echo get_text($member['mb_comp'])?>" id="reg_mb_comp" size="70" maxlength="100" placeholder="직위 입력">
<input type="text" name="mb_comp_team" value="<?php echo get_text($member['mb_comp_team'])?>" id="reg_mb_comp_team" size="70" maxlength="100" placeholder="회사별 사번 입력">
</div>
</td>
</tr>
<tr>
<th class="h_4">소속</th>
<td>
<div class="team_wrap">
<input type="text" id="reg_mb_team" name="mb_team" value="<?php echo get_text($member['mb_team']) ?>" <?php echo $required ?> <?php echo $name_readonly; ?> class="frm_input full_input <?php echo $required ?> <?php echo $name_readonly ?>" size="10" placeholder="소속 입력">
</div>
</td>
</tr>
<tr>
<th class="h_4">휴대전화번호</th>
<td>
<div class="phone_wrap">
<input type="text" name="mb_hp" value="<?php echo get_text($member['mb_hp']) ?>" id="reg_mb_hp" <?php echo $hp_required; ?> <?php echo $hp_readonly; ?> class="frm_input full_input <?php echo $hp_required; ?> <?php echo $hp_readonly; ?>" maxlength="20" placeholder="휴대폰 번호">
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!--//tbl_wrap-->
<div class="btn_confirm">
<button type="submit" id="btn_submit" class="btn_submit" >저장하기</button>
</div>
</fieldset>
<!-- //2025.07 디자인팀 수정 -->
</form>
</div>
<!--//pop_join_right-->
<!-- 회원가입결과 시작 { register-->
<div id="pop_result" class="popup_wrap" style="display:none;">
<p class="reg_result_p">
<i class="fa fa-gift" aria-hidden="true"></i><br>
<strong><?php echo get_text($mb['mb_name']); ?></strong>님의 회원가입을 진심으로 축하합니다.
</p>
<?php if (is_use_email_certify()) { ?>
<p class="result_txt">
회원 가입 시 입력하신 이메일 주소로 인증메일이 발송되었습니다.<br>
발송된 인증메일을 확인하신 후 인증처리를 하시면 사이트를 원활하게 이용하실 수 있습니다.
</p>
<div id="result_email">
<span>아이디</span>
<strong><?php echo $mb['mb_id'] ?></strong><br>
<span>이메일 주소</span>
<strong><?php echo $mb['mb_email'] ?></strong>
</div>
<p>
이메일 주소를 잘못 입력하셨다면, 사이트 관리자에게 문의해주시기 바랍니다.
</p>
<?php } ?>
<p class="result_txt">
회원님의 비밀번호는 아무도 알 수 없는 암호화 코드로 저장되므로 안심하셔도 좋습니다.<br>
아이디, 비밀번호 분실시에는 회원가입시 입력하신 이메일 주소를 이용하여 찾을 수 있습니다.
</p>
<p class="result_txt">
회원 탈퇴는 언제든지 가능하며 일정기간이 지난 후, 회원님의 정보는 삭제하고 있습니다.<br>
감사합니다.
</p>
<!-- } 회원가입결과 끝 -->
<div class="btn_confirm_reg">
<a href="<?php echo G5_URL ?>/" class="reg_btn_submit">메인으로</a>
</div>
</div>
</div>
<!--//popup_content-->
</div>
<!--//popup_in-->
</div>
<!--//popup_wrap-->
<!-- </div>
</body> -->
<script>
function PG_changeSelect(p_list){
if(p_list.value == 'type'){
document.getElementById("register_domain2").style.display = "block";
}else{
document.getElementById("register_domain2").style.display = "none";
}
}//PG_changeSelect
// submit 최종 폼체크
// function fregisterform_submit(b)
// {
// var f = b.parentNode.parentNode.parentNode;
// // 회원아이디 검사
// if (f.w.value == "") {
// alert('id_check_before');
// var msg = reg_mb_id_check();
// if (msg) {
// f.mb_id.select();
// return false;
// }
// }
// if (f.w.value == "") {
// if (f.mb_password.value.length < 3) {
// alert("비밀번호를 3글자 이상 입력하십시오.");
// f.mb_password.focus();
// return false;
// }
// }
// if (f.mb_password.value != f.mb_password_re.value) {
// alert("비밀번호가 같지 않습니다.");
// f.mb_password_re.focus();
// return false;
// }
// if (f.mb_password.value.length > 0) {
// if (f.mb_password_re.value.length < 3) {
// alert("비밀번호를 3글자 이상 입력하십시오.");
// f.mb_password_re.focus();
// return false;
// }
// }
// if ($("#dupl_check_yn").val() != 'Y') {
// alert('아이디(이메일) 중복 확인을 해주세요.');
// $("#reg_mb_id").focus();
// return false;
// }
// // E-mail 검사
// var mail_temp = f.reg_mb_email1.value+''+f.reg_mb_email2.value;
// f.reg_mb_email.value = mail_temp;
// if ((f.w.value == "") || (f.w.value == "u" && f.reg_mb_email.defaultValue != mail_temp)) {
// var msg = reg_mb_email_check();
// if (msg) {
// alert(msg);
// f.reg_mb_email1.select();
// return false;
// }
// }
// }
function descopeEmailCheck() {
var email = $("#reg_mb_id").val().trim();
if (email === "") {
alert("아이디(이메일)를 입력해 주세요.");
$("#reg_mb_id").focus();
return;
}
// 이메일 유효성 검사
var re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!re.test(email)) {
alert("유효한 이메일 형식으로 입력해 주세요.");
$("#reg_mb_id").focus();
return;
}
$.ajax({
url: '/egbim/skin/member/basic/descope_check_email.php',
type: 'POST',
data: { email: email },
dataType: 'json',
success: function(res) {
if (res.status === 'ok') {
if (confirm("사용 가능한 이메일입니다.\n이 이메일로 가입하시겠습니까?")) {
$("#dupl_check_yn").val('Y');
$("#reg_mb_password").focus();
} else {
$("#reg_mb_id").val('').focus();
$("#dupl_check_yn").val('N');
}
} else if (res.status === 'duplicate') {
alert('이미 가입된 이메일입니다.\n다른 이메일을 사용해 주세요.');
$("#reg_mb_id").val('').focus();
$("#dupl_check_yn").val('N');
} else {
alert('오류가 발생했습니다:\n' + res.message);
}
},
error: function(xhr, status, error) {
alert(
'통신 중 오류가 발생했습니다.\n' +
'상태: ' + status + '\n' +
'에러: ' + error + '\n' +
'응답: ' + xhr.responseText
);
}
});
}
async function fregisterform_submit(b) {
var f = b.parentNode.parentNode.parentNode;
// 기존 유효성 검사 로직 유지
if (f.mb_password.value.length < 8) {
alert("비밀번호는 8자 이상 입력하십시오.");
f.mb_password.focus();
return false;
}
if (f.mb_password.value !== f.mb_password_re.value) {
alert("비밀번호가 같지 않습니다.");
f.mb_password_re.focus();
return false;
}
if ($("#dupl_check_yn").val() !== 'Y') {
alert('아이디(이메일) 중복 확인을 해주세요.');
$("#reg_mb_id").focus();
return false;
}
// Descope 회원가입 및 OTP 전송
const email = $("#reg_mb_id").val().trim();
const password = $("#reg_mb_password").val().trim();
try {
const res = await $.ajax({
url: '/egbim/skin/member/basic/descope_signup.php',
type: 'POST',
dataType: 'json',
data: { email: email, password: password }
});
if (res.status === 'ok') {
alert('Descope 계정 생성 및 OTP 전송 완료. 인증 단계로 진행합니다.');
// 실제 인증 단계로 UI 전환 (예: fieldset 전환)
$("fieldset").hide().eq(1).show(); // 03 사용자 인증 단계로
return false; // GnuBoard form submit 방지 후 OTP 인증 진행
} else {
alert('Descope 가입 중 오류 발생: ' + res.message);
return false;
}
} catch (err) {
alert('통신 오류가 발생했습니다.');
console.error(err);
return false;
}
}
</script>
<!-- } 회원정보 입력/수정 끝 -->