<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<!-- Required Parameter : CDANK(String) -->
<!-- Optional Parameter :,CONFIRM(boolean),ANSWER(boolean),PREVIEW(boolean) -->

<og:value command="SQL">
	select A.NMANK, A.SMANK, A.USERID, A.FGSHUBETSU, A.DYKEND
	from AN01 A
	where A.CDANK = '{@CDANK}'
	and A.FGJ in ('0','1')
</og:value>

<fieldset>
<table>
	<tr>
		<og:column name="NMANK" writable="false">
			<og:equals val1="{@SYS.USER_REGISTRATION}" val2="true">
				( <og:link gamenId="OP1013" href="index.jsp" target="_blank" keys="USERID" vals="{@USERID}" >
					<og:column name="USERID" writable="false" lbl="KUSERID" td="false" />
				  </og:link> )
			</og:equals>
			<og:equals val1="{@SYS.USER_REGISTRATION}" val2="true" notEquals="true">
				( <og:column name="USERID" writable="false" lbl="KUSERID" td="false" /> )
			</og:equals>
		</og:column>
	</tr>
	<tr>
		<og:column name="DYKKGN" writable="false" value='{@DYKEND}' />
	</tr>
	<og:equals val1="{@SMANK}" nullCheck="true" notEquals="true">
		<tr><td colspan="2"><hr width="95%" /></td></tr>
		<tr>
			<og:column name="SMANK" writable="false" renderer="PRE" />
		</tr>
	</og:equals>
<!--
	<tr>
		<td colspan="2">
			<og:link gamenId="customan" lbl="SECPOLICY" href="secpolicy.pdf" target="_blank" />
		</td>
	</tr>
-->
</table>
</fieldset>

<!-- エラーチェック(ここまで) -->
<og:query command="NEW" displayMsg="" scope="request" >
	select B.UNIQ AN02_UNIQS
	from AN01 A inner join AN02 B
	on A.USERID = B.USERID
	and A.CDANK = B.CDANK
	and B.FGJ in ('0','1')
	where A.CDANK = '{@CDANK}'
	and A.FGJ in ('0','1')
	order by B.SEQNO
</og:query>

<og:value command="SETTBL" action="ALL_APPEND" key="AN02_UNIQS" tblScope="request" />

<ol>
	<c:forTokens items="${AN02_UNIQS}" delims="," var="AN02_UNIQ" varStatus="sitsustatus">

		<og:value command="REMOVE" key="IMGNAI" />
		<og:value command="REMOVE" key="SITSUGRP" />
		<og:value command="REMOVE" key="SITSUSGRP" />
		<og:value command="REMOVE" key="KNOTE" />
		<og:value command="SQL">
			select A.CDSITSU,A.NAIYO,A.IMGNAI,A.SITSUGRP,A.SITSUSGRP
					,case when A.FGMUST = '1' then 'true' else 'false' end MUST
					,A.KBUNRUI,A.KLENGTH,A.KNOTE
					,'{@SYS.SYSTEM_ID}_'||A.CDANK||'_'||A.CDSITSU CLM
			from AN02 A
			where UNIQ = '{@AN02_UNIQ}'
		</og:value>

		<og:equals val1="{@SITSUGRP}" nullCheck="true" notEquals="true">
			<og:equals val1="{@SITSUGRP}" val2="{@SITSUGRP_OLD}" notEquals="true">
				<li style="list-style-type:none;">
					<p class="sitsuGrp">
						<b><og:text>{@SITSUGRP}</og:text></b>
					</p>
				</li>
				<og:value command="SET" key="SITSUGRP_OLD" value="{@SITSUGRP}" />
			</og:equals>
		</og:equals>

		<og:equals val1="{@SITSUSGRP}" nullCheck="true" notEquals="true">
			<og:equals val1="{@SITSUSGRP}" val2="{@SITSUSGRP_OLD}" notEquals="true">
				<li style="list-style-type:none;">
					<p class="sitsuSGrp">
						<b><og:text>{@SITSUSGRP}</og:text></b>
					</p>
				</li>
				<og:value command="SET" key="SITSUSGRP_OLD" value="{@SITSUSGRP}" />
			</og:equals>
		</og:equals>

		<li value="${sitsustatus.count}" style="margin-top:10px;">
			<div>
			<og:text>{@NAIYO}
			<og:equals val1="{@IMGNAI}" nullCheck="true" notEquals="true">
				<a href="/{@SYS.CONTEXT_NAME}/ankimages/{@IMGNAI}" target="IMAGE">
					<img src="/{@SYS.CONTEXT_NAME}/ankimages/{@IMGNAI}" width="50px" height="50px" />
				</a>
			</og:equals>
			</og:text>

			<og:equals val1="{@KNOTE}" nullCheck="true" notEquals="true">
				<og:equals val1="{@KBUNRUI}" val2="SCALE" notEquals="true">
					<br />&amp;nbsp&amp;nbsp;<og:text>{@KNOTE}</og:text>
				</og:equals>
			</og:equals>
			</div>

			<ul style="list-style-type:none; margin-top:5px;">
				<og:equals val1="{@CONFIRM}{@ANSWER}" nullCheck="true">
					<jsp:directive.include file="/jsp/customan/ankKomoku.jsp" />
				</og:equals>
				<og:equals val1="{@CONFIRM}" nullCheck="true" notEquals="true">
					<jsp:directive.include file="/jsp/customan/ankKomokuConfirm.jsp" />
				</og:equals>
				<og:equals val1="{@ANSWER}" nullCheck="true" notEquals="true">
					<jsp:directive.include file="/jsp/customan/ankKomokuAnswer.jsp" />
				</og:equals>
			</ul>
		</li>
	</c:forTokens>
</ol>

<og:hidden name="IPADDRESS" value="{@USER.IPADDRESS}" />

</jsp:root>
