<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' index.asp
'----------------------------------------------------
' 蜃ヲ縲逅�:TOP逕サ髱「縲繧ュ繝シ繝ッ繝シ繝画、懃エ「
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Option Explicit
Response.Buffer = True
%>
<%
'--- 蜈ア騾壼、画焚 ----
dim cn
dim MaxCont '逋サ骭イ莉カ謨ー
dim arrCtg()
call Main()
sub Main()
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' Main
'----------------------------------------------------
'蜃ヲ縲逅�シ壹Γ繧、繝ウ繝ォ繝シ繝√Φ
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dim ErrMsg '繧ィ繝ゥ繝シ繝。繝�そ繝シ繧ク
dim strSQL 'SQL譁�ュ怜�
dim rs '繝ャ繧ウ繝シ繝峨そ繝�ヨ
dim flg '繧ィ繝ゥ繝シ繝輔Λ繧ー
dim strMsg '繧ィ繝ゥ繝シ陦ィ遉コ繝。繝�そ繝シ繧ク
strMsg=""
'-- DB Connect
if dbConnect(ErrMsg,cn) = false then
call dispErrWrite(ErrMsg)
call dbClose(cn)
exit sub
end if
Set rs = Server.CreateObject("ADODB.RecordSet")
'-- 邱丈サカ謨ー蜿門セ�
strSQL ="SELECT COUNT(ID) AS DCNT FROM TBL_REPORT;"
rs.Open strSQL, cn, adOpenStatic, adLockReadOnly
MaxCont=FormatNumber(rs("DCNT"),0,true,false,true)
rs.close
set rs = nothing
'-- 讀懃エ「鬆�岼蜈・蜉帙メ繧ァ繝�け
select case request.querystring("PG")
case "T"
'-- 繧ソ繧、繝�繧「繧ヲ繝�
strMsg="謗・邯壹′蛻�l縺セ縺励◆縲ゅ♀謇区焚縺ァ縺吶′縲∝�蠎ヲ讀懃エ「縺励※縺上□縺輔>縲�"
session.Contents.removeall
case "SRC"
if fncInputCheck(ErrMsg) then
call dispComplete(ErrMsg, "index.asp", "蜈・蜉帙↓繧ィ繝ゥ繝シ縺後≠繧翫∪縺�")
response.End()
exit sub
else
response.Redirect("result.asp")
end if
case "ERR"
'-- 讀懃エ「邨先棡荳隕ァ縺ォ縺ヲ荳肴ュ」蜈・蜉帙メ繧ァ繝�け
session.Contents.removeall
case else
call GetDispCategoryStr(cn)
call DispBody(strMsg)
end select
call dbClose(cn)
end sub
function fncInputCheck(strMsg)
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' fncInputCheck(msg)
'----------------------------------------------------
'蜃ヲ縲逅�シ壼�蜉帙メ繧ァ繝�け
'蠑輔謨ー�嗄sg(O)縲繧ィ繝ゥ繝シ繝。繝�そ繝シ繧ク
'謌サ繧雁、�啜rue 繧ィ繝ゥ繝シ譛峨False縲豁」蟶ク邨ゆコ�
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dim blnRet
dim blnInputChk
dim i
dim BaspObj
dim arrInp
dim marrKw(10)
dim flg
'蛻晄悄蛹�
blnRet=false
blnInputChk=false
strMsg=""
flg=false
set BaspObj = createobject("BASP21")
'繝輔か繝シ繝�縺ョ蛟、繧剃ス懈・ュ逕ィ驟榊�縺ォ譬シ邏�
marrKw(0)=trim(request.form("txtNenFm"))
marrKw(1)=trim(request.form("txtNenTo"))
marrKw(2)=trim(request.form("txtGoFm"))
marrKw(3)=trim(request.form("txtGoTo"))
marrKw(4)=trim(request.form("txtTitle"))
marrKw(5)=trim(request.form("txtKeyword"))
marrKw(6)=trim(request.form("txtReporter"))
marrKw(7)=trim(request.form("rep_and_or"))
marrKw(8)=setCheckBoxValue(cn)
marrKw(9)=trim(request.form("sel1"))
marrKw(10)=trim(request.form("sel2"))
arrInp=Array("逋コ陦悟ケエ(FROM)","逋コ陦悟ケエ(TO)","險倩シ牙捷(FROM)","險倩シ牙捷(TO)","繧ソ繧、繝医Ν","繧ュ繝シ繝ッ繝シ繝�","蝣ア蜻願�")
'蛟、縺ョ繝√ぉ繝�け
if marrKw(0)<>"" and isnull(marrKw(0))=false then
blnInputChk=true
if len(marrKw(0)) > 5 or isnumeric(marrKw(0))=false then
strMsg=strMsg & "繝サ" & arrInp(0) & "縺ッ4譯√�蜊願ァ呈焚蟄励〒蜈・蜉帙@縺ヲ縺上□縺輔>縲� "
blnRet=true
else
if cint(marrKw(0))< 1000 or cint(marrKw(0)) > 9999 then
strMsg=strMsg & "繝サ" & arrInp(0) & "縺ョ蜈・蜉帙′豁」縺励¥縺ゅj縺セ縺帙s縲� "
blnRet=true
else
if (marrKw(9)=1) then
if marrKw(1)="" or isnull(marrKw(1)) then
strMsg=strMsg & "繝サ遽�峇讀懃エ「縺ョ蝣エ蜷医�" & arrInp(1) & "繧貞�蜉帙@縺ヲ縺上□縺輔>縲� "
blnRet=true
else
if len(marrKw(1)) > 5 or isnumeric(marrKw(1))=false then
strMsg=strMsg & "繝サ" & arrInp(1) & "縺ッ4譯√�蜊願ァ呈焚蟄励〒蜈・蜉帙@縺ヲ縺上□縺輔>縲� "
blnRet=true
else
if cint(marrKw(1))< 1000 or cint(marrKw(1)) > 9999 then
strMsg=strMsg & "繝サ" & arrInp(1) & "縺ョ蜈・蜉帙′豁」縺励¥縺ゅj縺セ縺帙s縲� "
blnRet=true
end if
end if
end if
end if
end if
end if
end if
if marrKw(2)<>"" and isnull(marrKw(2))=false then
blnInputChk=true
if len(marrKw(2)) > 5 or isnumeric(marrKw(2))=false then
strMsg=strMsg & "繝サ" & arrInp(2) & "縺ッ2譯∽サ・蜀��蜊願ァ呈焚蟄励〒蜈・蜉帙@縺ヲ縺上□縺輔>縲� "
blnRet=true
else
if cint(marrKw(2))< 1 or cint(marrKw(2)) > 99 then
strMsg=strMsg & "繝サ" & arrInp(2) & "縺ョ蜈・蜉帙′豁」縺励¥縺ゅj縺セ縺帙s縲� "
blnRet=true
else
if (marrKw(10)=1) then
if marrKw(3)="" or isnull(marrKw(3)) then
strMsg=strMsg & "繝サ遽�峇讀懃エ「縺ョ蝣エ蜷医�" & arrInp(3) & "繧貞�蜉帙@縺ヲ縺上□縺輔>縲� "
blnRet=true
else
if len(marrKw(3)) > 5 or isnumeric(marrKw(3))=false then
strMsg=strMsg & "繝サ" & arrInp(3) & "縺ッ蜊願ァ呈焚蟄励〒蜈・蜉帙@縺ヲ縺上□縺輔>縲� "
blnRet=true
else
if cint(marrKw(3))< 1 or cint(marrKw(3)) > 99 then
strMsg=strMsg & "繝サ" & arrInp(3) & "縺ョ蜈・蜉帙′豁」縺励¥縺ゅj縺セ縺帙s縲� "
blnRet=true
end if
end if
end if
end if
end if
end if
end if
for i=4 to 6
if marrKw(i)<>"" and isnull(marrKw(i))=false then
blnInputChk=true
'-- 蜊願ァ呈枚蟄� (1 繝舌う繝�) 繧貞�隗呈枚蟄� (2 繝舌う繝�) 縺ォ螟画鋤
marrKw(i)=BaspObj.StrConv(marrKw(i),4)
if len(marrKw(i))>100 then
strMsg=strMsg & "繝サ" & arrInp(i) & "縺ッ100譁�ュ嶺サ・蜀�〒蜈・蜉帙@縺ヲ縺上□縺輔>縲� "
blnRet=true
end if
end if
next
select case marrKw(8)
case "ERR"
strMsg=strMsg & "繝サ蛻�㍽縺ョ蜈・蜉帙′荳肴ュ」縺ァ縺吶� "
blnInputChk=true
blnRet=true
case "NO_DATA"
case else
blnInputChk=true
end select
set BaspObj=nothing
if blnInputChk=false then
blnRet=true
strMsg=strMsg & "繝サ讀懃エ「鬆�岼繧貞�蜉帙@縺ヲ縺上□縺輔>縲�"
else
session("SRC")=marrKw
end if
fncInputCheck=blnRet
end function
function setCheckBoxValue(cn)
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' setChekBoxValue()
'----------------------------------------------------
'蜃ヲ縲逅�シ壹メ繧ァ繝�け繝懊ャ繧ッ繧ケ縺ョ蜈・蜉帙メ繧ァ繝�け縺ィ蛟、縺ョ繧サ繝�ヨ
'蠑輔謨ー�壹↑縺�
'謌サ繧雁、��"NO_DATA"�壹メ繧ァ繝�け縺ェ縺�
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dim ret
dim i
dim rs2
dim strSQL
dim intCnt
dim intCode
intCnt=0
ret=""
Set rs2 = Server.CreateObject("ADODB.RecordSet")
strSQL="SELECT COUNT(CODE) AS CNT FROM MST_CATEGORY;"
rs2.Open strSQL, cn, adOpenStatic, adLockReadOnly
intCnt=rs2("CNT")
rs2.close
for i=0 to intCnt
intCode=request.Form("chk" & i)
if intCode<>"" then
if len(intCode) >5 or isnumeric(intCode)=false then
ret="ERR"
exit for
else
if ret="" then
ret= request.Form("chk" & i)
else
ret=ret & "," & request.Form("chk" & i)
end if
end if
end if
next
if ret="" then
ret="NO_DATA"
end if
setCheckBoxValue=ret
end function
sub GetDispCategoryStr(cn)
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' GetDispCategoryStr()
'----------------------------------------------------
'蜃ヲ縲逅�シ壼�驥弱�鬆�岼繧剃コ梧ャ。蜈��蛻励↓繧サ繝�ヨ縺吶k
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dim rs2
dim i
dim strSQL
i=0
Set rs2 = Server.CreateObject("ADODB.RecordSet")
strSQL="SELECT CODE, STR FROM MST_CATEGORY ORDER BY SORT_NO;"
rs2.Open strSQL, cn, adOpenStatic, adLockReadOnly
do until rs2.eof
redim preserve arrCtg(1,i)
arrCtg(0,i)="縲" & rs2("STR") & " "
rs2.movenext
if rs2.eof then
arrCtg(1,i)="DATA_END"
else
arrCtg(1,i)="" & rs2("STR") & " "
rs2.movenext
i=i+1
end if
loop
rs2.close
end sub
sub DispBody(msg)
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
' DispBody()
'----------------------------------------------------
'蜃ヲ縲逅�シ壽悽譁�。ィ遉コ
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dim i
%>
繝ェ繝舌�繝輔Ο繝ウ繝育�皮ゥカ謇蝣ア蜻頑、懃エ「繧キ繧ケ繝�Β