<!-- #include file="../../include.asp" -->

<%
'<!--
'################################################
'	 名称	:グループ照会
'	 作成日:2002/8/22
'	 作成者:徳田
'	 目的 :演習グループの入力画面を表示する。
'	 概要	:
'		<<表示>>
'	・演習グループの入力画面
'
'################################################
'-->
%>
<%
main()
Sub main()
	If Not(SessionCheck()) Then
		Exit Sub
	End If

	Dim Action , NRflg , ErrMSG
	Dim GroupCD, GroupName, Password, SakuseiID	 'グループCD、グループ名称、パスワード、作成者ID
	Dim Hihyoji

	Dim Query
	Dim Content

	NRflg = Request("nr")
	Action = Request("Syori")
	GroupCD = Request("GroupCD")
	SakuseiID = GB_GakuseiNo	'新規作成時は管理者ID
	Hihyoji = "0"	'新規作成時は表示
	If GB_Admin <> "2" Then
		SakuseiID = ""	'運用管理者はNULL
	End If
	ErrMSG = Request("ErrMSG")
	If NRflg = "r" then
		GroupName = Request("GroupName")
		Password = Request("Password")
	Else
		Query = "exec SPMグループ取得 '" & GB_SystemCD & "','" & GroupCD & "'"
		Set Content = OpenQuery(Query)
		If Not(Content.BOF Or Content.EOF) Then
			GroupName = Content.Fields("グループ名称")
			Password = Content.Fields("グループキー")
			SakuseiID = Content.Fields("作成者ID")	'更新時はテーブル内容
			Hihyoji = "" & Content.Fields("非表示フラグ")
		End If
	End If

	Dim RouteType
	RouteType = Request("RouteType")

%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="-1">
<link href="../../binx/sj3web.css?<% = TimeUniq() %>" rel="stylesheet" type="text/css">
<title><% = AppTitle %></title>
<script language="JScript" src="../../include.js?<% = TimeUniq() %>"></script>
<script language="JScript" src="../../includesj.js?<% = TimeUniq() %>"></script>
<script language="JScript.Encode" src="../../include_enc.js?<% = TimeUniq() %>"></script>
<script language="JScript.Encode" src="../../includesj_enc.js?<% = TimeUniq() %>"></script>
<script type="text/javascript" src="../../javascript.js?<% = TimeUniq() %>"></script>
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
	HomeAlias = "<% = HomeAlias %>";
	HomeAliasSL = "<% = HomeAliasSL %>";
	ExitFlg = 2;
-->
</SCRIPT>


<body onkeydown="if(ExitFlg==2)ExitFlg=3;" onBeforeUnload="window.event.returnValue = ExitMsg(ExitFlg)" bgcolor="#5C70B6" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form OnKeyDown="FormKeyDown(this)"	method="POST" action="fm_group_bin.asp" name="form1" autocomplete="off">
<input type="hidden" name="Action" value="<% = Action %>">
<input type="hidden" name="RouteType" value="<% = RouteType %>">
<%
	Response.Write(HtmlDesign(1))

	Response.Write(HttpL1(4))

	If RouteType = "Kantan" Then
		Response.Write(HttpL2("運用管理メニュー" ,"tblbtn( '/" & HomeAlias & "/admin/admenu1.asp')", "グループ管理", "", "", "", "", "", "", "", "", ""))
	Else
		Response.Write(HttpL2("運用管理メニュー" ,"tblbtn( '/" & HomeAlias & "/admin/admenu_w.asp')", "グループ管理", "", "", "", "", "", "", "", "", ""))
	End If

	Response.Write(HttpL3("", "" ,"", "", "", "", "", "", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL3_1("保存", "SubmitCheck()", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL3_2("一覧表示", "tblbtn( 'fm_group_ichiran.asp?RouteType=" & RouteType & "')", "", "", "", "", "", "", "", ""))

	If Action = "1" Then
		Response.Write(HttpL4("グループ管理", "追加"))
	Else
		Response.Write(HttpL4("グループ管理", "修正"))
	End If

	Response.Write(HttpL5("<font color=""#FF0000"">" & ErrMsg & "</font>"))
%>

<div id="L0" style="position: absolute; visibility: hidden; left: 0px; top: -2000px;">
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="5">
										<tr>
											<td valign="middle">
												<table border="0" cellpadding="5" cellspacing="0" width="100%" height="100%">
													<tr>
														<td align="CENTER" valign="MIDDLE">
															<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="20" BGCOLOR="#FFFFFF" STYLE="BORDER:1px solid #000000" WIDTH="1" HEIGHT="1">
																<TR>
																	<TD ALIGN="CENTER" BACKGROUND="/<% = HomeAlias %>/images/window_bk.gif?<% = GB_STU %>">
																		<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="100%">
																			<TR>
																				<TD HEIGHT="90" VALIGN="middle">
																					<TABLE width="500" HEIGHT="90" BORDER="1" CELLPADDING="4" CELLSPACING="0" BORDERCOLOR="#000000" BGCOLOR="#FFFFCC" CLASS="tx1416" STYLE="border-collapse: collapse">
																						<tr>
																							<td width="100" height="30">グループコード</td>
																							<td height="30">
																							<% If Action = "1" Then %>
																								<input type="text" name="GroupCD" size="20" maxlength="13" value="<% = GroupCD %>" onkeyup="FormStrLeft(this,12,false,false);" onKeypress="FormStrLeft(this,12,false,false);" onBlur="FormStrTrim(this,true);" class="tbox4">
																							<% Else %>
																								<input type="hidden" name="GroupCD" value="<% = GroupCD %>">
																								<% = GroupCD %>
																							<% End If %>
																							</td>
																						</tr>
																						<tr>
																							<td height="30">グループ名称</td>
																							<td height="30">
																								<input type="text" name="GroupName" size="60" value="<% = GroupName %>" onBlur="FormStrLeftIME(this,40,true);" class="tbox4_ime">
																							</td>
																						</tr>
																						<tr>
																							<td height="30">グループキー</td>
																							<td height="30">
																								<input type="text" name="Password" size="20" maxlength="13" value="<% = Password %>" onkeyup="FormStrLeft(this,12,false,false);" onKeypress="FormStrLeft(this,12,false,false);" onBlur="FormStrTrim(this,true);"  class="tbox4">
																							</td>
																						</tr>
																					<% If GB_Admin <> "2" Then %>
																						<tr>
																							<td height="30">作成者ID</td>
																							<td height="30">
																								<select size="1" name="SakuseiID" class="tbox4">
																								<%
																									Query = "exec SPMシステム情報取得 '" & GB_SystemCD & "'"
																									Set Content = OpenQuery(Query)
																									If Not(Content.BOF Or Content.EOF) Then
																										Response.Write("<option value='" & Content.Fields("管理者コード") & "'")
																										If UCase(Content.Fields("管理者コード")) = UCase(SakuseiID) Or UCase(Content.Fields("管理者コード")) = UCase(GB_GakuseiNo) Then
																											Response.Write(" selected")
																										End If
																										Response.Write(">運用管理者</option>" & vbCrLf)
																									End If
																									Query = "exec SPM演習管理者一覧 '" & GB_SystemCD & "'"
																									Set Content = OpenQuery(Query)
																									Do While Not(Content.BOF Or Content.EOF)
																										Response.Write("<option value='" & Content.Fields("演習管理者ID") & "'")
																										If UCase(Content.Fields("演習管理者ID")) = UCase(SakuseiID) Then
																											Response.Write(" selected")
																										End If
																										Response.Write(">" & Content.Fields("演習管理者ID") & "</option>" & vbCrLf)
																										Content.MoveNext
																									Loop
																								%>
																								</select>
																							</td>
																						</tr>
																					<% Else %>
																						<input type="hidden" name="SakuseiID" value="<% = SakuseiID %>">
																					<% End If %>
																						<tr>
																							<td height="30" class="tx1214">新規ID作成に表示</td>
																							<td height="30">
									<INPUT type='radio'  name='Hihyoji' value="0"<% If Hihyoji <> "1" Then Response.Write(" checked") End If %>>表示 
									<INPUT type='radio'  name='Hihyoji' value="1"<% If Hihyoji = "1" Then Response.Write(" checked") End If %>>非表示
																							</td>
																						</tr>
																					</TABLE>
																				</TD>
																			</TR>
																		</TABLE>
																	</TD>
																</TR>
															</TABLE>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
</div>
</form>

</body>
<SCRIPT LANGUAGE="JavaScript">

	function SubmitCheck()
	{
<% If Action = "1" Then %>
		if (form1.GroupCD.value == "")
		{
			alert("グループコードを入力して下さい");
			return false;
		}
<% End If %>
		if (form1.GroupName.value == "")
		{
			alert("グループ名称を入力して下さい");
			return false;
		}

		if (form1.Password.value == "")
		{
			alert("グループキーを入力して下さい");
			return false;
		}
		SubmitReal(form1);
		return true;
	}


				</script>

<% = HtmlFooter %>
</html>
<%
End Sub
%>