<!--#include virtual = "/common/lib/dbcon.asp" -->
<!--#include virtual = "/common/lib/func.asp" -->
<%
Dim bdm_idx, title_bdm_menuname
bdm_ref				= inputValue( request.queryString("bdm_idx") )
title_bdm_menuname	= inputValue( request.queryString("title_bdm_menuname") )
prepage				= Request.ServerVariables("path_info") & "?" & Request.ServerVariables("query_string")

If bdm_ref = "" Then

	bdm_ref = 0
	bdm_depth = 1
	title_bdm_menuname = "대구유아교육진흥원"

End if


r_fields_s = "bdm_idx, info_url, bdm_depth, bdm_code, bdm_ref, bdm_menuname, bdm_chk"
'sql = "select " & r_fields_s & " from bd_menu_page where bdm_chk = 'Y' and bdm_ref = '" & bdm_ref & "' order by bdm_code asc"
sql = "select " & r_fields_s & " from bd_menu_page where bdm_ref = '" & bdm_ref & "' order by bdm_code asc"

Set rs = dbcon.execute( sql )
If rs.bof Or rs.eof Then
	list_data = null
Else
	list_data = rs.getrows
End if
Set rs = nothing







%>
<html>
<head>
<title>메뉴관리</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="Stylesheet" type="text/css" href="/manager/common/css/all.css" />
<style type="text/css"> 
<!--
.bip	{border:1px solid #cdcdcd;background-color:#f7f7f7;height:20px;font-size:9pt;color:#000000;padding:3;}
-->
</style>
 
 
 
<SCRIPT LANGUAGE="JavaScript"> 
<!--
 
function sendit(frm){
	var eForm = frm;
	if(!valueChk(eForm.bdm_menuname, "메뉴명")){return;}
	//if(!valueChk(eForm.mn_url, "프로그램URL")){return;}
 
	//alert(eForm.bdm_menuname.value);
	eForm.submit();
}
function valueChk(obj, objName){
	if(obj.value.split(" ").join("") == ""){
		alert(objName+"을(를) 입력하세요");
		obj.focus();
		return false;
	}else{
		return true;
	}
}
function valueChkbox(obj, objName){
	var trueCnt = 0;
	for(i=0;i < obj.length;i++){
		if(obj[i].checked == true){
			trueCnt = trueCnt + 1;
		}
	}
	if(trueCnt == 0){
		alert(objName+"을(를) 체크하세요");
		obj[0].focus();
		return false;
	}else{
		trueCnt = 0;
		return true;
	}
}
function SetNum(obj){
val=obj.value;
re=/[^0-9]/gi;
obj.value=val.replace(re,"");
}
 
function del_ok(bdm_idx){
	if(confirm("하위부서까지 삭제됩니다.\n삭제하시겠습니까?")){
		location.href="buseo_delete_ok.asp?bdm_idx="+bdm_idx+"&prepage=<%=server.urlencode(prepage)%>";
	}
}
 
function URLuse(){
	var mn_url;
	var chkurl;
	mn_url = document.frm.mn_url;
	chkurl = document.frm.chkurl;
	if(mn_url.value != ""){
		mn_url.value = "";
		mn_url.disabled = true;
		chkurl.checked = false;
	}else{
		mn_url.value = "/program/";
		mn_url.disabled = false;
		chkurl.checked = true;
	}
 
}
//-->
</SCRIPT>
</head>
 
<body topmargin="0" leftmargin="10">
 
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<font style="font-size:15px"><b><font color="blue">[<%=title_bdm_menuname%>]</font> 하위부서생성</b></font>
		</td>
	</tr>
</table>
 
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td bgcolor="#5A9CD6" height="2"></td>
	</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="cdcdcd">
<form name="frm" method="post" action="buseo_write_ok.asp">
<input type="hidden" name="bdm_ref" value="<%=bdm_ref%>" />
<input type="hidden" name="prepage" value="<%=prepage%>" />

	<tr bgcolor="#ffffff" align="center" height="25">
		<td width="">
			<b>부 서 명</b>
		</td>
		<!--<td>
			<b>URL</b> <input type="checkbox" name="chkurl" onClick="URLuse();" checked><a href="javascript:URLuse();">URL사용</a>
		</td>-->
		<td width="150">
			<b>생 성</b>
		</td>
	</tr>
	<tr bgcolor="#ffffff" align="center" height="25">
		<td>
			<input type="text" name="bdm_menuname" style="width:200px" class="bip" maxlength="50">
		</td>
		<!--<td>
			<input type="text" name="mn_url" style="width:200px" class="bip" maxlength="200" value="/program/">
		</td>-->
		<td>
			<input type="button" value="생 성" onClick="sendit(document.frm);">
		</td>
	</tr>
</form>
</table>
<br>
 
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<font style="font-size:15px"><b><font color="blue">[<%=title_bdm_menuname%>]</font> 하위부서목록</b></font>
		</td>
	</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td bgcolor="#5A9CD6" height="2"></td>
	</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="cdcdcd">
	<tr bgcolor="#ffffff" align="center" height="25">
		<td width="40">
			<b>순서</b>
		</td>
		<td width="250">
			<b>부 서 명</b>
		</td>
		<!--<td>
			<b>URL</b>
		</td>-->
		<td width="70">
			<b>사용여부</b>
		</td>
		<td>
			<b>수정/삭제</b>
		</td>
	</tr>
<%
If isnull(list_data) Then
Else
	For i = 0 To Ubound(list_data, 2)
		Call arr2Value(r_fields_s, "list_data", i)
%>
	<tr bgcolor="#ffffff" align="center" height="25">
	<form id="editfrm<%=i%>" name="editfrm<%=i%>" method="post" action="buseo_write_ok.asp">
	<input type="hidden" name="bdm_idx" value="<%=bdm_idx%>">
	<input type="hidden" name="prepage" value="<%=prepage%>" />
		<td>
			<a href="move.asp?move=up&bdm_idx=<%=bdm_idx%>&bdm_code=<%=bdm_code%>&prepage=<%=server.urlencode(prepage)%>"><IMG src="/manager/img/ic_up.gif" border="0" align="absmiddle"></a><a href="move.asp?move=down&bdm_idx=<%=bdm_idx%>&bdm_code=<%=bdm_code%>&prepage=<%=server.urlencode(prepage)%>"><IMG src="/manager/img/ic_down.gif" border="0" align="absmiddle"></a>
		</td>
		<td>
			<input type="text" name="bdm_menuname" style="width:200px" class="bip" maxlength="50" value="<%=bdm_menuname%>">
		</td>
		<!--<td>
			<input type="text" name="mn_url" style="width:165px" class="bip" maxlength="200" value="">
		</td>-->
		<td>
			<select name="bdm_chk" style="width:50px">
				<option value="Y" <%=chkSelect(bdm_chk, "Y")%>>사용</option>
				<option value="N" <%=chkSelect(bdm_chk, "N")%>>중지</option>
			</select>
		</td>
		<td>
			<a href ="#" onClick="document.getElementById('editfrm<%=i%>').submit();">[수정]</a><a href="#del" onclick="del_ok(<%=bdm_idx%>);">[삭제]</a>
		</td>
	</form>
	</tr>
<%
	next
End if
%>
</table>
</body>
 
</html>

