<!--#include virtual="/common/lib/dbcon.asp"-->
<!--#include virtual="/common/lib/func.asp"-->
<%
	'memgr_logincookie "itech", "qhdkswjqth"
	
	Dim searchType, searchValue
	searchType = inputValue(Request.QueryString("searchType"))
	searchValue = inputValue(Request.QueryString("searchValue"))
	If searchType = "m_mobile" Then
		searchTypeQ = "m_mobile1+m_mobile2+m_mobile3"
		searchValue = Replace(searchValue, "-", "")
	else
		searchTypeQ = searchType
	End if

	
	If searchValue <> "" Then
		If searchValue = "all" Then
			sql = "select m_name, m_mobile1+m_mobile2+m_mobile3 from member where m_level <> 2"
		else
			sql = "select m_name, m_mobile1+m_mobile2+m_mobile3 from member where " & searchTypeQ & " like '%" & searchValue & "%'"			
		End if
		'response.write sql
		Set rs = Dbcon.Execute( sql )
		
		If rs.bof Or rs.eof Then
			mem_list = Null
		Else
			mem_list = rs.getrows
		End If
		Set rs = nothing
	Else
		mem_list = null
	End If

%>
<html>
<head>
<title>구성원 검색</title>
	<link rel="stylesheet" type="text/css" href="/common/css/sub_layout.css" />
	<link rel="stylesheet" type="text/css" href="/common/css/all.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript"> 
//<![CDATA[
	function searchGo(type){
		if(type == "S"){
			location.href="?searchType="+standard.value+"&searchValue="+keyword.value;
		}else if(type == "A"){
			location.href="?searchType="+standard.value+"&searchValue=all";
		}
	}
 
//보낼사람 추가(구성원)
function memAdd(){
	if (document.mem_list2.check != null){
 
		var field = document.mem_list2.check;
		var selobj = opener.list_rec;
		var opt = selobj.length;
		//alert(field[1].value);	
		if(field.length == null){
			if(field.checked == true){
				//selobj.options[opt] = new Option("test", "test");//new Option(field.value, field.value);
				opener.add(field.value,field.value);
			}
		}else{
			for (i = 0; i < field.length; i++){
				opt = selobj.length;
				if(field[i].checked == true){
					//selobj.options[opt] = new Option("test", "test");//new Option(field[i].value, field[i].value);
					opener.add(field[i].value,field[i].value);
				}
			}
		}
	}
}
//]]>
</script>
</head>
 
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="yes" onLoad="keyword.focus();">
 
<table width="97%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
	<td style="padding:22px 0 0 17px;"><img src="/sms_img/sub/addr_txt.gif" alt="그룹 중 메시지를 보내기 원하는 개인을 검색하세요." /></td>
</tr>




<tr>
	<td class="pr15 pl15" valign="top">
		<table width="100%" cellspacing="5" cellpadding="0" bgcolor="E1E1E1" align="center" class="board_search">
			<tr>
				<td style="padding:2 0 5 0;" class="t160">
					<table align="center" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td class="search_ic">
							<img src="/content/board/nninc_simple/img/search_ic.gif" width="21" height="25" alt="" />
						</td>
						<td>
							<select id="standard" name="standard" class="s_search">
							<option value="m_name" <%=chkSelect( "m_name", searchType )%>>이름</option>
							<option value="m_mobile" <%=chkSelect( "m_mobile", searchType )%>>전화</option>
							</select>
						</td>
						<td class="pl4 pb2"><input type=text  name="keyword" size="23" class="board_input" onKeyDown="if(event.keyCode == 13){searchGo('S');}" value="<%
							Select Case searchValue
								Case "all","sMaster"
								Case Else
									response.write searchValue
							End select%>"></td>
						<td class="pb2" style="padding-top:6px;"><a href="#search" onclick="searchGo('S');"><input type="image" src="/content/board/nninc_simple/img/search_bt.gif" id="search_bt" name="search_bt" class="search_bt" alt="검색" /></a><a href="#search" onclick="searchGo('A')"><input type="image" src="/sms_img/common/btn_totalsearch.gif" id="search_bt" name="search_bt" class="search_bt" alt="모두검색" /></a></td>
					</tr>
					</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
 
<tr>
	<td align="right" class="pt9" height="30">
		<a href="#search" onclick="opener.chkAll(document.mem_list2.check, true);"><input type="image" src="/sms_img/common/btn_allselect.gif" alt="전체선택" /></a>
		<a href="#search" onclick="opener.chkAll(document.mem_list2.check, false);"><input type="image" src="/sms_img/common/btn_allunselect.gif" alt="전체해제" /></a>
	</td>
</tr>
<tr>
	<td height="100%" valign="top" class="pl15 pr15" >
 
		<Table cellspacing="0" cellpadding="0" class="table9">
		<form id="mem_list2" name="mem_list2">
		<%
			If Not(IsNull(mem_list)) Then
				For i = 0 To UBound(mem_list, 2)
				mem_list(1,i) = Replace(mem_list(1,i),"-","")
				mem_list(1,i) = Replace(mem_list(1,i)," ","")
		%>


			<tr class="pb3">
				<td width="50"><input type="checkbox" id="check_<%=i%>" name="check" value="M;<%=mem_list(0,i)%>;<%=mem_list(1,i)%>"></td>
				<td width="150" class="pt4 pr10 bold"><label for="check_<%=i%>"><%=mem_list(0,i)%></label></td>
				<td class="num"><label for="check_<%=i%>"><%=mem_list(1,i)%></label></td>
			</tr>
		<%
				next
			End if
		%>
		</form>
		</table>
 
	</td>
</tr>
<tr>
	<td align="center" class="pb15">
 
		<script>
		if (!document.layers)
		document.write('<div id="divStayTopLeft" style="position:absolute">')
 
		function back_top()
		{
			x = document.body.scrollLeft;
			y = document.body.scrollTop;
			step = 2;
 
			while ((x != 0) || (y != 0)) {
					scroll (x, y);
					step += (step * step / 100);
					x -= step;
					y -= step;
					if (x < 0) x = 0;
					if (y < 0) y = 0;
			} 
			scroll (0, 0);
		}
		</script>
 
		<layer id="divStayTopLeft">
		<table width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td align="right"><a href="#memadd" onclick="memAdd();" onkeypress="memAdd();"><input type="image" src="/sms_img/sub/btn_plus.gif" alt="추가" /></a></td>
		</tr>
		</table>
		</layer>
 
		<script type="text/javascript">
		var verticalpos="frombottom"
 
		if (!document.layers)
			document.write('</div>')
 
		function JSFX_FloatTopDiv() {
			var startX = 0;
				startY = 70;
			var ns = (navigator.appName.indexOf("Netscape") != -1);
			var d = document;
			function ml(id) {
				var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
				if(d.layers)el.style=el;
				el.sP=function(x,y){this.style.left=x;this.style.top=y;};
				el.x = startX;
				if (verticalpos=="fromtop")
				el.y = startY;
				else{
				el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
				el.y -= startY;
				}
				return el;
			}
			window.stayTopLeft=function() {
				if (verticalpos=="fromtop"){
				var pY = ns ? pageYOffset : document.body.scrollTop;
				ftlObj.y += (pY + startY - ftlObj.y)/8;
				}
				else{
				var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
				ftlObj.y += (pY - startY - ftlObj.y)/8;
				}
				ftlObj.sP(ftlObj.x, ftlObj.y);
				setTimeout("stayTopLeft()", 10);
			}
			ftlObj = ml("divStayTopLeft");
			stayTopLeft();
		}
		JSFX_FloatTopDiv();
		</script> 
 
 
	</td>
</tr>
<tr>
	<td height="1" bgcolor="E7E7E7"></td>
</tr>
<tr>
	<td height="25" bgcolor="F5F5F5" align="right" class="pr5 fs11 bold"><a href="#close" onclick="javascript:window.close();">닫기X</a></td>
</tr>
</table>


</body>
</html>