[g5] 회원 이름 검색후 아이디 불러오기
페이지 정보
본문
<script type='text/javascript'>
<!-- // 회원ID 찾기
function popup_id(frm_name, mb_id, top, left)
{
url = '<?php echo G5_SHOP_URL?>/mb_id.php?frm_name='+frm_name+'&mb_id='+mb_id;
opt = 'scrollbars=yes,width=300,height=400,top='+top+',left='+left;
window.open(url, "mb_id", opt);
}
//-->
</script>
<a href="javascript:popup_id('forderform','mb_id',100 ,200);" class="btn02">회원검색</a>
mb_id.php 파일생성
<?php
include_once('./_common.php');
if($sname) {
$sql = " select * from {$g5[member_table]} where mb_name like '%$sname%' order by mb_id ";
$result = sql_query($sql);
$search_count = mysql_num_rows($result);
if($search_count > 0) {
for ($i=0; $row=mysql_fetch_array($result); $i++) {
$list[$i]->id = $row['mb_id'];
$list[$i]->name = $row['mb_name'];
}
} else {
alert("찾으시는 ID가 없습니다.");
}
mysql_free_result($result);
}
$g5['title'] = "사용자ID 검색";
include_once(G5_PATH."/head.sub.php");
?>
<h3 style="padding:20px 0 0 0"><?php echo $g5['title']?></h3>
<form name="frmid" method="get" autocomplete="off">
<input type="hidden" name="frm_name" value="<?php echo $frm_name?>">
<input type="hidden" name="mb_id" value="<?php echo $mb_id?>">
<div style="padding:20px 20px 0px 20px">
찾는 이름을 입력하세요. (두글자 이상)
</div>
<div style="padding:20px">
<label for="sname">회원이름<strong class="sound_only"> 필수</strong></label>
<input type="text" id="sname" name="sname" required class="frm_input required" value="<?php echo $sname?>">
<input type="submit" value="확인" class="btn_submit">
</div>
</form>
<!-- 검색결과 여기서부터 -->
<script type='text/javascript'>
document.frmid.sname.focus();
</script>
<div style="padding:20px">
<?php if($search_count > 0) { ?>
총 <?php echo $search_count?>건 가나다순
<div>
<div>
<ul>
<?php
for ($i=0; $i<count($list); $i++)
{
echo "<li><a href=javascript:setid('{$list[$i]->name}','{$list[$i]->id}')>{$list[$i]->name} - {$list[$i]->id}</a></li>\n";
}
?>
</ul>
<br />[END]
</div>
<script type='text/javascript'>
function setid(sname, sid)
{
var ov = top.opener.document.<?php echo $frm_name?>.<?php echo $mb_id?>.value;
var of = top.opener.document.<?php echo $frm_name?>.<?php echo $mb_id?>;
if(ov.length>0) {
of.value = (ov + "," + sid);
}else{
of.value = sid;
}
top.opener.focus();
top.close();
return false;
}
</script>
<?php } ?>
<?php
include_once(G5_PATH."/tail.sub.php");
?>
댓글목록
등록된 댓글이 없습니다.