台灣最大程式設計社群網站
線上人數
1001
 
會員總數:242754
討論主題:187716
歡迎您免費加入會員
討論區列表 >> ASP >> 請問線上報名修改
[]  
[我要回覆]
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
請問線上報名修改
價值 : 50 QP  點閱數:168 回應數:0

樓主

雷帝
門外漢
0 3
104 5
發送站內信

這個程式碼是前人所留下來的,想請問這個程式碼只能單一一次報名,現在想要修改成可以重複報名要如何修改.謝謝
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@CodePage=65001%>
<%Session.CodePage=65001
response.charset="UTF-8"
Response.CacheControl="no-cache"
Response.AddHeader "Pragma","no-cache"
Response.Expires=-1%>
<title></title>
<link href="../StyleSheet/GRAStyleSheet.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div align="center">
<%If Len(Session("id"))=0 Then
msa="\n逾時30分鐘未操作,請重新登入!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "top.location.href='Logout.asp';</script>"
Else%>
<!-- #Include File="dbconn.asp" -->
<%Session("schoolname")="大陸地區大學學歷甄試"

Chktmp11=SortStr(Tmp_year,3)
Chktmp11=Chktmp11+SortStr(Tmp_examclass,1)
Chktmp11=Chktmp11+SortStr(Session("id"),10)
Chktmp11=Chktmp11+SortStr(Session("pdy"),2)
Chktmp11=Chktmp11+SortStr(Session("pdm"),2)
Chktmp11=Chktmp11+SortStr(Session("pdd"),2)
Chktmp11=Chktmp11+SortStr(Session("UserIP"),15)
Chktmp13=SortStrId(Session("id"))
Chktmp23=SortStrDD(Session("pdy"))
Chktmp33=SortStrDD(Session("pdm"))
Chktmp43=SortStrDD(Session("pdd"))
If Chktmp11>0 or Chktmp13>0 or Chktmp23>0 or Chktmp33>0 or Chktmp43>0 Then
msa="\n請與大陸地區大學學歷甄試大陸地區大學學歷甄試試務小組聯絡!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "top.location.href='Logout.asp';</script>"
Else

Set rs1=Server.CreateObject("ADODB.Recordset")
sqlstr1="select birthdayyear,birthdaymonth,birthdaydate,name,degreec,disciplinec"
sqlstr1=sqlstr1&" from dbo.examinee_base(nolock)"
sqlstr1=sqlstr1&" where id='"&Session("id")&"'"
sqlstr1=sqlstr1&" and year='"&Tmp_year&"'"
rs1.Open sqlstr1,conn

'取IP
dim strIPAddr
If Request.ServerVariables("HTTP_X_FORWARDED_FOR")="" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),"unknown")>0 Then
strIPAddr=Request.ServerVariables("REMOTE_ADDR")
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),",")>0 Then
strIPAddr=Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),1,InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),",")-1)
ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),";")>0 Then
strIPAddr=Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),1,InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),";")-1)
Else
strIPAddr=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
End If
Session("UserIP")=Trim(Mid(strIPAddr,1,30))

'login 階段寫入log防亂try的,01:登入系統
Set rsBt=Server.CreateObject("ADODB.Recordset")
sqlstrBt="insert into dbo.button_log("
sqlstrBt=sqlstrBt&"year,degreec,disciplinec,id,ip_address,buttonc,operatetime)"
sqlstrBt=sqlstrBt&" values(N'"&Tmp_year&"',N'"&Session("degreec")&"',N'"&Session("disciplinec")&"',"
sqlstrBt=sqlstrBt&"'"&Session("id")&"','"&Session("UserIP")&"','01',GETDATE())"
'response.Write(sqlstrBt)
'response.End()
conn.Execute sqlstrBt

'取報名期間
Set rs2=Server.CreateObject("ADODB.Recordset")
sqlstr2="select entertimebeg1,entertimeend1,entertimebeg2,entertimeend2"
sqlstr2=sqlstr2&" from dbo.param_base(nolock)"
sqlstr2=sqlstr2&" where year='"&Tmp_year&"'"
rs2.Open sqlstr2,conn

If rs2.Eof Then
%>
<div style="text-align:center;">
系統尚未開放使用!
</div>
<%
response.End()
End If

If not rs2.Eof Then
'筆試階段
If mid(rs2("entertimebeg1"),1,1)="1" Then
begdate1=CStr(CInt(mid(rs2("entertimebeg1"),1,3))+1911)
For i=4 to len(rs2("entertimebeg1"))-5
If mid(rs2("entertimebeg1"),i,1)="年" or mid(rs2("entertimebeg1"),i,1)="月" Then
begdate1=begdate1+"/"
ElseIf mid(rs2("entertimebeg1"),i,1)<>"日" Then
begdate1=begdate1+mid(rs2("entertimebeg1"),i,1)
End If
Next
enddate1=CStr(CInt(mid(rs2("entertimeend1"),1,3))+1911)
For i=4 to len(rs2("entertimeend1"))-5
If mid(rs2("entertimeend1"),i,1)="年" or mid(rs2("entertimeend1"),i,1)="月" Then
enddate1=enddate1+"/"
ElseIf mid(rs2("entertimeend1"),i,1)<>"日" Then
enddate1=enddate1+mid(rs2("entertimeend1"),i,1)
End If
Next
Else
begdate1=CStr(CInt(mid(rs2("entertimebeg1"),1,2))+1911)
For i=3 to len(rs2("entertimebeg1"))-5
If mid(rs2("entertimebeg1"),i,1)="年" or mid(rs2("entertimebeg1"),i,1)="月" Then
begdate1=begdate1+"/"
ElseIf mid(rs2("entertimebeg1"),i,1)<>"日" Then
begdate1=begdate1+mid(rs2("entertimebeg1"),i,1)
End If
Next
enddate1=CStr(CInt(mid(rs2("entertimeend1"),1,2))+1911)
For i=3 to len(rs2("entertimeend1"))-5
If mid(rs2("entertimeend1"),i,1)="年" or mid(rs2("entertimeend1"),i,1)="月" Then
enddate1=enddate1+"/"
ElseIf mid(rs2("entertimeend1"),i,1)<>"日" Then
enddate1=enddate1+mid(rs2("entertimeend1"),i,1)
End If
Next
End If
'論文審查階段
If mid(rs2("entertimebeg2"),1,1)="1" Then
begdate2=CStr(CInt(mid(rs2("entertimebeg2"),1,3))+1911)
For i=4 to len(rs2("entertimebeg2"))-5
If mid(rs2("entertimebeg2"),i,1)="年" or mid(rs2("entertimebeg2"),i,1)="月" Then
begdate2=begdate2+"/"
ElseIf mid(rs2("entertimebeg2"),i,1)<>"日" Then
begdate2=begdate2+mid(rs2("entertimebeg2"),i,1)
End If
Next
enddate2=CStr(CInt(mid(rs2("entertimeend2"),1,3))+1911)
For i=4 to len(rs2("entertimeend2"))-5
If mid(rs2("entertimeend2"),i,1)="年" or mid(rs2("entertimeend2"),i,1)="月" Then
enddate2=enddate2+"/"
ElseIf mid(rs2("entertimeend2"),i,1)<>"日" Then
enddate2=enddate2+mid(rs2("entertimeend2"),i,1)
End If
Next
Else
begdate2=CStr(CInt(mid(rs2("entertimebeg2"),1,2))+1911)
For i=3 to len(rs2("entertimebeg2"))-5
If mid(rs2("entertimebeg2"),i,1)="年" or mid(rs2("entertimebeg2"),i,1)="月" Then
begdate2=begdate2+"/"
ElseIf mid(rs2("entertimebeg2"),i,1)<>"日" Then
begdate2=begdate2+mid(rs2("entertimebeg2"),i,1)
End If
Next
enddate2=CStr(CInt(mid(rs2("entertimeend2"),1,2))+1911)
For i=3 to len(rs2("entertimeend2"))-5
If mid(rs2("entertimeend2"),i,1)="年" or mid(rs2("entertimeend2"),i,1)="月" Then
enddate2=enddate2+"/"
ElseIf mid(rs2("entertimeend2"),i,1)<>"日" Then
enddate2=enddate2+mid(rs2("entertimeend2"),i,1)
End If
Next
End If
End If
begdate1=begdate1+" "+right(rs2("entertimebeg1"),5)+":01"
enddate1=enddate1+" "+right(rs2("entertimeend1"),5)+":01"
begdate2=begdate2+" "+right(rs2("entertimebeg2"),5)+":01"
enddate2=enddate2+" "+right(rs2("entertimeend2"),5)+":01"
rs2.Close

If not rs1.Eof then
'資料存在
If strcomp(Session("pdy"),rs1("birthdayyear"),0)=0 and strcomp(Session("pdm"),rs1("birthdaymonth"),0)=0 and strcomp(Session("pdd"),rs1("birthdaydate"),0)=0 Then
'比對正確
Session("name")=rs1("name")
Session("degreec")=rs1("degreec")
Session("disciplinec")=rs1("disciplinec")

'寫入Log,若有多筆報名僅記錄第一筆01:登入系統
Set rsBt=Server.CreateObject("ADODB.Recordset")
sqlstrBt="insert into dbo.button_log("
sqlstrBt=sqlstrBt&"year,degreec,disciplinec,id,ip_address,buttonc,operatetime)"
sqlstrBt=sqlstrBt&" values(N'"&Tmp_year&"',N'"&Session("degreec")&"',N'"&Session("disciplinec")&"',"
sqlstrBt=sqlstrBt&"'"&Session("id")&"','"&Session("UserIP")&"','01',GETDATE())"
'response.Write(sqlstrBt)
conn.Execute sqlstrBt

If begdate1 <> EMPTY then
If Now() >= CDate(begdate1) and Now() <= CDate(enddate1) Then
'報名期間
response.write "<script>location.href='SelSign.asp'</script>"
Else
'非報名期間
response.write "<script>location.href='Menu.asp'</script>"
End If
Else
msa="\n系統尚未開放使用!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "location.href='Logout.asp';</script>"
End If
Else
Session.abandon()
msa="\n該身分證件號碼資料已存在,但出生日期輸入錯誤,請重新輸入!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "window.history.back();</script>"
End If
Else
'資料不存在
If begdate1 <> EMPTY then
If Now() >= CDate(begdate1) and Now() <= CDate(enddate1) Then
'報名期間
ShowDetail
Else
msa="\n找不到輸入的身分證件號碼資料!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "location.href='Logout.asp';</script>"
End If
Else
msa="\n系統尚未開放使用!"
msa="alert('"&msa&"');"
response.write "<script>"& msa & "location.href='Logout.asp';</script>"
End If
End If
rs1.Close
conn.Close
End If
End If
Sub ShowDetail%>
<table border="0" id="table1" cellspacing="0" cellpadding="0" class="table-main">
<tr>
<td align="center" colspan="2" class="table-main-td1">
<b><span style="color: #0000FF"><%=Tmp_year&"年度"&Session("schoolname")%></span></b>
<hr />
</td>
</tr>
<tr>
<td style="color: #ffffff; height: 40px; background: #000066;">
報名流程:<b><span style="font-size: 15px; color: #FFFF00">►核對重要資料</span></b> ►選擇甄試學門領域 ►選擇選考科目 ►填寫基本資料 ►填寫完成
</td>
</tr>
<tr><td height="20"></td></tr>
<tr>
<td width="100%" height="40" align="center">
<table id="table12" cellspacing="0" cellpadding="0" style="width: 50%; border-color: #008080; border: 1px;">
<tr>
<td align="left" style="width: 12%; height: 25px; background: #FFD5AA; border: 1px solid #ffffff; padding: 0 5px 0 5px;">身分證件號碼</td>
</tr>
<tr>
<td align="center" style="width: 12%; height: 30px; border: 1px solid #ffffff; padding: 1px;">
<span style="font-size: 18px;"><b><%=Session("id")%></b></span></td>
</tr>
<tr>
<td align="left" style="width: 12%; height: 25px; background: #FFD5AA; border: 1px solid #ffffff; padding: 0 5px 0 5px;">出生日期</td>
</tr>
<tr>
<td align="center" style="width: 12%; height: 30px; border: 1px solid #ffffff; padding: 1px;">
<span style="font-size: 18px;"><b><%=Session("pdy")&"年"&Session("pdm")&"月"&Session("pdd")&"日"%></b></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="width: 100%; height:80px; line-height: 22px;">
<span style="color: #FF0000">※</span>請核對上列【<b>身分證號</b>】及【<b>出生日期</b>】是否正確,<br />
<span style="color: #FF0000;"><b>(如因身分證號錯誤造成無法應考,由考生自行負責,如有疑問請電洽 大陸地區大學學歷甄試試務小組:04-22851900)</b></span><br />
正確請按 <span style="color: #0000FF;"><b>下一步</b></span> ,錯誤請按 <span style="color: #0000FF;"><b>重新輸入</b></span> 。
</td>
</tr>
<tr>
<td align="center" style="width: 100%; padding: 5px 0 5px 0;">
<input type="button" value=" 重新輸入 " onclick="javascript:location.href='logout.asp'" style="padding: 3px 3px 3px 3px;" /> 
<input type="submit" value=" 下一步 " onclick="javascript:location.href='signlogin.asp'" style="padding: 3px 3px 3px 3px;" />
</td>
</tr>
<tr>
<td style="width: 100%;">
<hr />
</td>
</tr>
</table>
<%End Sub%>
</div>
</body>
</html>

搜尋相關Tags的文章: [ 報名 ] ,
本篇文章發表於2018-06-15 08:08
別忘捐VP感謝幫助你的人 新手會員瞧一瞧
目前尚無任何回覆
   

回覆
如要回應,請先登入.