%@LANGUAGE="VBSCRIPT" CODEPAGE="932"%>
<%
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' detail.asp
'----------------------------------------------------
' 処 理:資料明細画面
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Option Explicit
Response.Buffer = True
%>
<%
dim cn 'Connection
dim rs 'Recordset
dim mstrParam 'パラメータ
dim marrItems(7)
dim mstrFile '戻り先
dim mlngDtNo
call Main
sub Main()
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' Main
'----------------------------------------------------
' 処 理: メインルーチン
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dim strErrMsg 'エラーメッセージ
'パラメータチェック
'データ番号がなかった場合(通常有り得ないエラー処理)
mlngDtNo=clng(request.querystring("DTNO"))
if mlngDtNo=0 then
response.Redirect("index.asp")
end if
'DB Connect
if dbConnect(strErrMsg,cn) = false then
call dispErrWrite(strErrMsg)
exit sub
end if
'検索結果一覧画面に戻るためのURL
mstrParam = "SRC=" & request.QueryString("SRC") _
& "&PAGE=" & request.QueryString("PAGE") _
& "&DLINE=" & request.QueryString("DLINE") _
& "&S1=" & request.QueryString("S1") _
& "&S2=" & request.QueryString("S2") _
& "&DTNO=" & request.QueryString("DTNO")
'各項目の値を取得
call subGetItems
'----------------------------------------
'検索結果表示
if mlngDtNo = 0 then
strErrMsg = "
申し訳ございませんが、指定された報告書は現在表示できません。"
call dispComplete(strErrMsg, "f_result.asp?" & mstrParam, "明細画面は表示できません")
else
call subDispBody
end if
'----------------------------------------
set rs=nothing
call dbClose(cn)
end sub
sub subGetItems()
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' subGetItems()
'----------------------------------------------------
'処 理:各項目の値を取得し表示用に変換する
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dim strSQL 'SQL文字列
dim strCtg
strSQL ="SELECT * FROM TBL_REPORT" _
& " WHERE ID=" & mlngDtNo & ";"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open strSQL, cn, adOpenStatic, adLockReadOnly
if rs.recordcount=0 then
rs.close
mlngDtNo=0
exit sub
end if
'ID
marrItems(0) = fncNz(rs("ID"))
'発生年
marrItems(1) = fncNz(rs("fld_nen"))
'掲載号
marrItems(2) = fncNz(rs("fld_go"))
'タイトル
marrItems(3) = fncNz(rs("fld_title"))
'キーワード
marrItems(4) = fncNz(rs("fld_keyword"))
'報告者
marrItems(5) = fncNz(rs("fld_reporter"))
'分野
strCtg=fncNz(rs("fld_category"))
marrItems(6) = getCategory(strCtg)
'添付ファイル有無
marrItems(7) = fncNz(rs("fld_files"))
'添付ファイル名
'-- 添付画像有無
if trim(rs("fld_files"))=1 then
if (rs("fld_filename"))="" then
marrItems(7) = " "
else
marrItems(7) = "" _
& ""
end if
else
marrItems(7) = " "
end if
end sub
function getCategory(ctg)
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' getCategory(ctg)
'----------------------------------------------------
'処 理:分野をコードから文字列取得
'引 数:分野のコード
'戻り値:分野の文字列
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dim strSQL 'SQL文字列
dim ret
dim rs2
if isnumeric(ctg) then
strSQL ="SELECT STR FROM MST_CATEGORY WHERE CODE=" & ctg & ";"
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open strSQL, cn, adOpenStatic, adLockReadOnly
if rs2.recordcount=0 then
ret=" "
else
ret=rs2("STR")
end if
rs2.close
else
ret=" "
end if
getCategory=ret
end function
sub subDispBody()
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' subDispBody()
'----------------------------------------------------
'処 理:画面表示
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
%>
発 行 年 | <%= marrItems(1) %>年 |
---|---|
記 載 号 | <%= marrItems(2) %>号 |
タイトル | <%= marrItems(3) %> |
キーワード | <%= marrItems(4) %> |
報 告 者 | <%= marrItems(5) %> |
分 野 | <%= marrItems(6) %> |
報 告 書 | <%= marrItems(7) %> |