<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-nested" prefix="nested" %>
<%@ page language="java" contentType="text/html; charset=SHIFT_JIS" pageEncoding="SHIFT_JIS" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>
<HEAD>
	<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
	<META HTTP-EQUIV="Expires" CONTENT="0">
	<META http-equiv="Content-Type" content="text/html; charset=SHIFT_JIS">
	<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
	<TITLE>blaocoStrutsSample UserSelect</TITLE>
	<link rel="stylesheet" type="text/css" href="./css/blancoSample.css">
	<link rel="stylesheet" type="text/css" href="./jsp/css/blancoSample.css">
  <script language="JavaScript" type="text/JavaScript">
		function fnOnEvent(element) {
			document.UserSelectForm.eventId.value=element.name;
			document.UserSelectForm.submit();
		}
		
		function fnSelectList(eventId,index) {
			document.UserSelectForm.selectIndex.value=index;
			document.UserSelectForm.eventId.value=eventId;
			document.UserSelectForm.submit();
		}
  </script>
	</HEAD>
	<BODY>
			<TABLE width="500" border="0">
				<TR>
					<TD width="400"><H1>UserSelect</H1></TD>
					<TD width="50"><html:button property="logout" value="ログアウト" onclick="fnOnEvent(this);"/></TD>
				</TR>
			</TABLE>
		<html:form action="UserSelect" method="post">
		<html:errors/>
			<TABLE>
				<TR>
					<TD class="title"><U>部署コード</U></TD>
					<TD><html:text property="bushoCode"/></TD>
					<TD>部署名</TD>
					<TD><bean:write name="UserSelectForm" property="bushoName" />　</TD>
					<TD><html:button property="search" value="検索" onclick="fnOnEvent(this);"/></TD>
				</TR>
			</TABLE>
			<hr>
			<br>
			<TABLE>
				<colgroup width="10%"></colgroup>
				<colgroup width="20%"></colgroup>
				<colgroup width="10%"></colgroup>
				<colgroup width="20%"></colgroup>
				<colgroup width="12%"></colgroup>
				<colgroup width="20%"></colgroup>
				<TR>
					<TD class="title">ユーザコード</TD>
					<TD><html:text property="userCode"/></TD>
					<TD class="title">名前</TD>
					<TD><html:text property="userName"/></TD>
					<TD class="title">年齢</TD>
					<TD><html:text property="age"/></TD>
				</TR>
				<TR>
					<TD class="title">性別</TD>
					<TD><html:radio name="UserSelectForm" property="sex" value="man"/>男　
					    <html:radio name="UserSelectForm" property="sex" value="woman"/>女
					</TD>
					<TD class="title">電話番号</TD>
					<TD><html:text property="telNo"/></TD>
					<TD class="title">メールアドレス</TD>
					<TD><html:text property="mailAddress"/></TD>
				</TR>
				<TR>
					<TD class="title">生年月日</TD>
					<TD><html:text property="birthday"/></TD>
					<TD class="title">管理職</TD>
					<TD><html:multibox property="kanri" value="true"/>管理職である</TD>
					<TD class="title">担当区</TD></TD>
					<TD>
						<html:select property="tantokubun">
							<html:optionsCollection property="tantokubunOptions"/>
						</html:select>
					</TD>
				</TR>
			</TABLE>
			<TABLE>
				<colgroup width="60%"></colgroup>
				<colgroup width="5%"></colgroup>
				<colgroup width="5%"></colgroup>
				<colgroup width="5%"></colgroup>
				<TR>
					<TD>　</TD>
					<TD><html:button property="add" value="追加" onclick="fnOnEvent(this);"/></TD>
					<TD><html:button property="update" value="更新" onclick="fnOnEvent(this);"/></TD>
					<TD><html:button property="delete" value="削除" onclick="fnOnEvent(this);"/></TD>
				</TR>
			</TABLE>
			<hr>
			<TABLE border="1">
				<colgroup width="10%"></colgroup>
				<colgroup width="10%"></colgroup>
				<colgroup width="5%"></colgroup>
				<colgroup width="5%"></colgroup>
				<colgroup width="8%"></colgroup>
				<colgroup width="10%"></colgroup>
				<colgroup width="8%"></colgroup>
				<colgroup width="5%"></colgroup>
				<colgroup width="5%"></colgroup>
				<TR>
					<TH>ユーザコード</TH>
					<TH>名前</TH>
					<TH>年齢</TH>
					<TH>性別</TH>
					<TH>電話番号</TH>
					<TH>メールアドレス</TH>
					<TH>誕生日</TH>
					<TH>管理職</TH>
					<TH>担当区</TH>
				</TR>
				<logic:iterate id="userItem" name="UserSelectForm" property="userItemList" scope="request" indexId="index">
					<TR>
						<TD styleClass="link" onmouseover="this.bgColor='#FFFACD';" onmouseout="this.bgColor='#FFFFFF'" onclick="fnSelectList('userCode',<%=index%>);">
							<html:text styleClass="tdlink"  onmouseover="this.fgColor='#FFF000';" onmouseout="this.bgColor='#FFFFFF'" name="userItem" property="userCode" readonly="true" indexed="true"/></TD>
						<TD><html:text styleClass="td" name="userItem" property="userName" readonly="true" indexed="true"/></TD>
						<TD><html:text styleClass="td" name="userItem" property="age" readonly="true" indexed="true" size="3"/></TD>
						<TD><html:text styleClass="td" name="userItem" property="sex" readonly="true" indexed="true" size="3"/></TD>
						<TD><html:text styleClass="td" name="userItem" property="telNo" readonly="true" indexed="true" size="15"/></TD>
						<TD><html:text styleClass="td" name="userItem" property="mailAddress" readonly="true" indexed="true" size="35"/></TD>
						<TD><html:text styleClass="td" name="userItem" property="birthday" readonly="true" indexed="true" size="13"/></TD>
						<TD><html:text styleClass="td" name="userItem" property="kanri" readonly="true" indexed="true" size="5"/></TD>
						<TD><html:text styleClass="td" name="userItem" property="tantokubun" readonly="true" indexed="true" size="5"/></TD>
					</TR>
				</logic:iterate>
			</TABLE>
			<html:hidden property="eventId"/>
			<html:hidden property="selectIndex"/>
		</html:form>
	</BODY>
</html:html>
