<?xml version="1.0" encoding="UTF-8" ?>
<jsp:directive.page pageEncoding="UTF-8" />

<style type="text/css">
	table.wd100 td { width: 100px;}
</style>

<table class="wd100">
	<!-- 帳票要求ﾃｰﾌﾞﾙ GE50 REP01 -->
	<tr>
		<td>
			<og:link gamenId="REP01" href="index.jsp" target="CONTENTS"
				keys="command,SYSTEM_ID,USRUPD,DYUPDFROM,DYUPDTO"
				vals="NEW,{@SYSTEM_ID},{@USRUPD},{@DYUPDFROM},{@DYUPDTO}" >{@LBL.REP01}
			</og:link>
		</td>
		<td>GE50.xml</td><td id="GE50"></td>
	</tr>

	<!-- 帳票ﾃﾞｰﾀﾃｰﾌﾞﾙ GE51 REP02 -->
	<tr>
		<td>
			<og:link gamenId="REP02" href="index.jsp" target="CONTENTS"
				keys="command,SYSTEM_ID,USRUPD,DYUPDFROM,DYUPDTO"
				vals="NEW,{@SYSTEM_ID},{@USRUPD},{@DYUPDFROM},{@DYUPDTO}" >{@LBL.REP02}
			</og:link>
		</td>
		<td>GE51.xml</td><td id="GE51"></td>
	</tr>
</table>
=============================================================================<br />

<!-- 帳票要求ﾃｰﾌﾞﾙ GE50 REP01 -->
<og:text caseNN="{@VIEW}">******************** GE50 {@LBL.GE50} ********************</og:text>
	<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}" dbid="{@DBID}" notfoundMsg="">
		select YKNO,GROUPID,LISTID,JOKEN,FGKAN,OUT_DIR,OUT_FILE,COMMENTS,SYSTEM_ID,PDF_PASSWD,SUDATA,SUPAGE,
				FGJ,DYSET,DYUPD,USRSET,USRUPD,PGSET,PGUPD
		from GE50
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and	FGJ = '1'
		<og:where startKey="and">
			<og:and value = "FGJ	=  '{@FGJ}'"				/>
			<og:and value = "USRUPD	=  '{@USRUPD}'"				/>
			<og:and value = "DYUPD	>= '{@DYUPDFROM}000000'"	/>
			<og:and value = "DYUPD	<= '{@DYUPDTO}999999'"		/>
		</og:where>
			order by SYSTEM_ID,YKNO
	</og:query>

	<og:value action="ADD" key="DBCNT" value="{@DBCNT}" defaultVal="{@DB.COUNT}" />

	<script type="text/javascript">
		ge50 = document.getElementById("GE50");
		ge50.textContent = "<og:text>{@DB.COUNT}</og:text>";
	</script>

	<og:view command="{@command}" selectedType="none" useScrollBar="false" pageSize="{@pageSize}" caseNN="{@VIEW}" />

	<og:writeTable
		fileURL		= "{@DIR}"
		filename	= "GE50.xml"
		writerClass	= "XML"
		encode		= "UTF-8" >
		<og:writeTableParam key="TableName" value="GE50" />
		<og:equals val1="{@EXT_SQL}" val2="DELETE" >
			<og:writeTableParam key="First" >
				delete from GE50 where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
			</og:writeTableParam>
		</og:equals>
		<og:equals val1="{@EXT_SQL}" val2="MERGE" >
			<og:writeTableParam key="MergeSql" >
				update GE50
				set
					GROUPID		= [GROUPID]
				,	LISTID		= [LISTID]
				,	JOKEN		= [JOKEN]
				,	FGKAN		= [FGKAN]
				,	OUT_DIR		= [OUT_DIR]
				,	OUT_FILE	= [OUT_FILE]
				,	COMMENTS	= [COMMENTS]
				,	PDF_PASSWD	= [PDF_PASSWD]
				,	SUDATA		= [SUDATA]
				,	SUPAGE		= [SUPAGE]
				,	FGJ			= [FGJ]
				,	DYSET		= [DYSET]
				,	DYUPD		= [DYUPD]
				,	USRSET		= [USRSET]
				,	USRUPD		= [USRUPD]
				,	PGSET		= [PGSET]
				,	PGUPD		= [PGUPD]
				where	SYSTEM_ID	= [SYSTEM_ID]
				and		YKNO		= [YKNO]
			</og:writeTableParam>
		</og:equals>
	</og:writeTable>

<!-- 帳票ﾃﾞｰﾀﾃｰﾌﾞﾙ GE51 REP02 -->
<og:text caseNN="{@VIEW}">******************** GE51 {@LBL.GE51} ********************</og:text>
	<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}" dbid="{@DBID}" notfoundMsg="">
		select YKNO,EDNO,KBTEXT,TEXT_DATA,SYSTEM_ID,
				FGJ,DYSET,DYUPD,USRSET,USRUPD,PGSET,PGUPD
		from GE51
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and FGJ = '1'
		<og:where startKey="and">
			<og:and value = "FGJ	=  '{@FGJ}'"				/>
			<og:and value = "USRUPD	=  '{@USRUPD}'"				/>
			<og:and value = "DYUPD	>= '{@DYUPDFROM}000000'"	/>
			<og:and value = "DYUPD	<= '{@DYUPDTO}999999'"		/>
		</og:where>
		order by SYSTEM_ID,YKNO,EDNO
	</og:query>

	<og:value action="ADD" key="DBCNT" value="{@DBCNT}" defaultVal="{@DB.COUNT}" />

	<script type="text/javascript">
		ge51 = document.getElementById("GE51");
		ge51.textContent = "<og:text>{@DB.COUNT}</og:text>";
	</script>

	<og:view command="{@command}" selectedType="none" useScrollBar="false" pageSize="{@pageSize}" caseNN="{@VIEW}" />

	<og:writeTable
		fileURL		= "{@DIR}"
		filename	= "GE51.xml"
		writerClass	= "XML"
		encode		= "UTF-8" >
		<og:writeTableParam key="TableName" value="GE51" />
		<og:equals val1="{@EXT_SQL}" val2="DELETE" >
			<og:writeTableParam key="First" >
				delete from GE51 where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
			</og:writeTableParam>
		</og:equals>
		<og:equals val1="{@EXT_SQL}" val2="MERGE" >
			<og:writeTableParam key="MergeSql" >
				update GE51
				set
					KBTEXT			= [KBTEXT]
				,	TEXT_DATA		= [TEXT_DATA]
				,	FGJ				= [FGJ]
				,	DYSET			= [DYSET]
				,	DYUPD			= [DYUPD]
				,	USRSET			= [USRSET]
				,	USRUPD			= [USRUPD]
				,	PGSET			= [PGSET]
				,	PGUPD			= [PGUPD]
				where	SYSTEM_ID	= [SYSTEM_ID]
				and		YKNO		= [YKNO]
				and		EDNO		= [EDNO]
			</og:writeTableParam>
		</og:equals>
	</og:writeTable>
