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

<og:head headType="result" />
<jsp:directive.include file="/jsp/custom/result_info.jsp" />

<!-- ワーニングメッセージです。ここでは、登録完了のメッセージを表示します。 -->
<og:errorMessage command="{@command}" clear="{@clear}" displayMsg="{@displayMsg}" />

<og:columnCheck
	command   = "{@command}"
/>

<!-- 取り消しボタンが押された時に必要です。 -->
<og:entry command = "{@command}" />

<og:value command="SQL">
	select A.UNIQ,A.CRYPTKEY,A.FGSHUBETSU
	from AN01 A
	where A.CDANK = '{@CDANK}'
	and A.FGJ = '1'
</og:value>

<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}">
	<jsp:text>
		select A.CDANK,A.CDSITSU,A.KVAL,A.SEQNO,A.KNAME,A.KSCALE,A.FGCORRECT,A.IMGKVAL,A.FGOTHER,A.RKCODE,A.BIKO,A.FGJ,A.DYSET,A.DYUPD,A.UNIQ
				,case
					when A.IMGKVAL is null or A.IMGKVAL = '' then '0'
					when A.IMGKVAL like '%.png' or A.IMGKVAL like '%.PNG'
						or A.IMGKVAL like '%.jpg' or A.IMGKVAL like '%.JPG'
						or A.IMGKVAL like '%.jpeg' or A.IMGKVAL like '%.JPEG'
						or A.IMGKVAL like '%.gif' or A.IMGKVAL like '%.GIF'
						or A.IMGKVAL like '%.bmp' or A.IMGKVAL like '%.BMP' then '1'
					else '2' end FGIMG
		from AN03 A inner join AN02 B
		on A.USERID = B.USERID
		and A.CDANK = B.CDANK
		and A.CDSITSU = B.CDSITSU
		and '1' = B.FGJ
		where A.USERID = '{@USER.ID}'
	</jsp:text>
	<og:where startKey="and">
		<og:and value = "A.CDANK		=		'{@CDANK}'" />
		<og:and value = "A.CDSITSU		=		'{@CDSITSU}'" />
		<og:and value = "A.KNAME		like	'{@KNAME}%'" />
		<og:and value = "A.FGJ			=		'{@FGJ}'" />
	</og:where>
	<og:appear startKey = "order by" value = "{@ORDER_BY}"
				defaultVal = "B.SEQNO,A.SEQNO" />
</og:query>

<og:columnEditor columns="CDSITSU,SEQNO,KNAME" must="true" />
<og:columnEditor columns="CDSITSU" label="NAIYO" editor="DBMENU">
	select CDSITSU,NAIYO from AN02 where USERID='{@USER.ID}' and CDANK='{@CDANK}' and KBUNRUI in ('RADIO','CHBOX','MENU','SCALE') order by SEQNO
</og:columnEditor>

<og:viewMarker command="{@command}">
	<og:columnMarker column="IMGKVAL" onMark="[FGIMG]" markList="1" >
		<a href="/{@SYS.CONTEXT_NAME}/ankimages/[IMGKVAL]" target="IMAGE">
			<img src="/{@SYS.CONTEXT_NAME}/ankimages/[IMGKVAL]" width="50px" height="50px" />
		</a>
		<a href="{@SYS.JSP}/customan/upload.jsp?action=DELETE&amp;FILE_PATH=ankimages/[IMGKVAL]&amp;TBLNAME=AN03&amp;CLMNAME=IMGKVAL&amp;CLMSNAME=IMGSKVAL&amp;UNIQ=[UNIQ]&amp;GAMENID={@GUI.KEY}">
			<img src="/{@SYS.CONTEXT_NAME}/jsp/image/DeleteFile.gif" />
		</a>
		<a href="{@SYS.JSP}/customan/filePopup.jsp?BASE_DIR=ankimages&amp;NEWPATH=[CDANK]/[CDSITSU]&amp;NEWNAME=[CDANK]/[CDSITSU]/[KVAL]&amp;TBLNAME=AN03&amp;CLMNAME=IMGKVAL&amp;CLMSNAME=IMGSKVAL&amp;UNIQ=[UNIQ]&amp;GAMENID={@GUI.KEY}">
			<img src="/{@SYS.CONTEXT_NAME}/jsp/image/search_18x16.gif" />
		</a>
	</og:columnMarker>
	<og:columnMarker column="IMGKVAL" onMark="[FGIMG]" markList="2" >
		<a href="/{@SYS.CONTEXT_NAME}/ankimages/[IMGKVAL]" target="IMAGE">
			<img src="/{@SYS.CONTEXT_NAME}/jsp/image/text.gif" width="30px" height="30px" />
		</a>
		<a href="{@SYS.JSP}/customan/upload.jsp?action=DELETE&amp;FILE_PATH=ankimages/[IMGKVAL]&amp;TBLNAME=AN03&amp;CLMNAME=IMGKVAL&amp;CLMSNAME=IMGSKVAL&amp;UNIQ=[UNIQ]&amp;GAMENID={@GUI.KEY}">
			<img src="/{@SYS.CONTEXT_NAME}/jsp/image/DeleteFile.gif" />
		</a>
		<a href="{@SYS.JSP}/customan/filePopup.jsp?BASE_DIR=ankimages&amp;NEWPATH=[CDANK]/[CDSITSU]&amp;NEWNAME=[CDANK]/[CDSITSU]/[KVAL]&amp;TBLNAME=AN03&amp;CLMNAME=IMGKVAL&amp;CLMSNAME=IMGSKVAL&amp;UNIQ=[UNIQ]&amp;GAMENID={@GUI.KEY}">
			<img src="/{@SYS.CONTEXT_NAME}/jsp/image/search_18x16.gif" />
		</a>
	</og:columnMarker>
	<og:columnMarker column="IMGKVAL" onMark="[FGIMG]" markList="0" >
		<a href="{@SYS.JSP}/customan/filePopup.jsp?BASE_DIR=ankimages&amp;NEWPATH=[CDANK]/[CDSITSU]&amp;NEWNAME=[CDANK]/[CDSITSU]/[KVAL]&amp;TBLNAME=AN03&amp;CLMNAME=IMGKVAL&amp;CLMSNAME=IMGSKVAL&amp;UNIQ=[UNIQ]&amp;GAMENID={@GUI.KEY}">
			<img src="/{@SYS.CONTEXT_NAME}/jsp/image/search_18x16.gif" />
		</a>
	</og:columnMarker>
</og:viewMarker>

<form onSubmit="return oneClick();" method="POST" action="forward.jsp" target="RESULT">
<og:writeCheck>
	<og:input name="repeatCount" value="1" lbl="" td="false" size="2"/>
	<og:submit  value="update"   lbl="COPY"      command="COPY"   accesskey="C"
		keys="noWritable" vals='"CDANK,KVAL,IMGKVAL,FGJ,DYSET,DYUPD"' />
	<og:submit  value="update"   lbl="MODIFY"    command="MODIFY" accesskey="M"
		keys="noWritable" vals='"CDANK,CDSITSU,KVAL,IMGKVAL,FGJ,DYSET,DYUPD"' />
	<og:submit  value="update"   lbl="DELETE"    command="DELETE" accesskey="D"
		keys="columnWritable" vals="null" />
	&amp;nbsp;
	<og:link gamenId="AN0008" href="index.jsp"
		keys="command,KEY" vals="NEW,{@CRYPTKEY}" lbl="ANKPREV" target="_top" />
<br />
</og:writeCheck>

<og:equals val1="{@FGSHUBETSU}" val2="2" notEquals="true">
	<og:value command="SET" key="NO_DISP" value=",FGCORRECT" />
</og:equals>
<og:hidden name="FGSHUBETSU" value="{@FGSHUBETSU}" />

<og:view
	viewFormType = "HTMLTable"
	command		= "{@command}"
	noDisplay	= "CDANK,KVAL,UNIQ,FGIMG{@NO_DISP}"
	columnGroup	= "CDSITSU"
	checked		= "{@checked}"
	startNo		= "{@startNo}"
	pageSize	= "{@pageSize}" />
</form>

<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
