28,390
社区成员
发帖
与我相关
我的任务
分享
<%if len(session("Userid"))=0 then
Response.redirect "logon.asp"
else
Set Conn = Server.CreateObject("ADODB.Connection")
'*****************************
conn.Open "Compliance_CBT","szeofficeadmin","P@ssw0rd"
'*****************************
set adminRs = Server.CreateObject("ADODB.Recordset")
adminsql = "select * from sysadmin where admin_id = '"&trim(session("userid"))&"' and admin_type='S' and status='A'"
adminrs.Open adminsql,conn,3,3
if not adminrs.eof then%>
<HEAD>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<style>
<!--
h1{color:#004433;text-align:center}
h2{color:#6b8e23;font-size:8pt;font-family:Arial;font-weight:700;}
h3{text-align:center}
h5{color:#ff0000}
-->
</style>
<script language="VBS">
sub add_new
form.action="Question_add.asp"
form.submit
end sub
sub delete_q(row_num)
dim q_id
q_id="("
for i=0 to row_num-1
if document.form.checkbox(i).checked=true then
q_id=q_id&document.form.checkbox(i).value&","
end if
next
q_id=left(q_id,len(q_id)-1)&")"
document.form.qid.value =q_id
document.form.M_action.value="D"
if len(trim(document.form.qid.value))<3 then
alert("Sorry,you haven't choosed any item to delete!")
else
form.action="delete.asp"
form.submit
end if
end sub
sub update_q(row_num)
dim q_id
q_id="("
for i=0 to row_num-1
if document.form.checkbox(i).checked=true then
q_id=q_id&document.form.checkbox(i).value&","
end if
next
q_id=left(q_id,len(q_id)-1)&")"
document.form.qid.value =q_id
document.form.M_action.value ="U"
if len(trim(document.form.qid.value))<3 then
alert("Sorry,you haven't choosed any item to update!")
else
form.action="Delete.asp"
form.submit
end if
end sub
</script>
</HEAD>
<BODY background= strbkgde.gif bgcolor="#999966" text="#000000" link="#003399" vlink="#660000" alink="#666666">
<form name=form id=form method=post>
<h2>¡¡</h2>
<h2><br>
<a href="test_choose.asp">Main Menu</a> <font color="#FFFFFF">>>
</font>
<a href="sysad.asp">System Admin</a> <font color="#FFFFFF">>> Question Maintain
</font>
</h2>
<h1><font face="Verdana" size="5" color="#800000">Compliance CBT Test Questions</font></h1>
<%set quers=server.CreateObject("ADODB.Recordset")
set countrs=server.CreateObject("ADODB.Recordset")
quesql="select * from question_db where q_status='A' order by q_id"
quers.Open quesql,conn,3,3
if not quers.EOF then
countsql="select count(*) as total from question_db where q_status='A' "
countrs.Open countsql,conn,3,3
total=countrs("total")
countrs.Close
quers.MoveFirst %>
<TABLE WIDTH="90%" BORDER=0 CELLSPACING=0 CELLPADDING=0 align=center>
<tr><td colspan=10 valign="bottom"><h3><font face="Verdana" size="2">
<br>
Question List</font></h3>
</td></tr>
<tr><td colspan=10><h5>
<span style="FONT-FAMILY: 'Book Antiqua'">
<FONT
color=#FF0000 face=Arial size="2"> <b>If the answer is multiple-choice,
pls use ',' to seperate each choice.</b></FONT></h5>
</td></tr>
<%do while not quers.EOF%>
<tr>
<td colspan=1><INPUT type="checkbox" id=checkbox name=checkbox value=<%=quers("Q_ID")%>></td>
<td colspan=9><TEXTAREA rows=5 cols=100 id=textarea<%=quers("q_id")%> name=textarea<%=quers("q_id")%> style="font-family: Arial Unicode MS; border: 1px solid #D2D068; background-color: #E9E8BE" ><%=replace(quers("question"),"@",chr(13))%></TEXTAREA></td></tr>
<tr>
<td colspan=1><b><font face="Verdana" size="2">Answer:</font></b></td>
<td colspan=9><INPUT type="text" id=answer<%=quers("q_id")%> name=answer<%=quers("q_id")%> value="<%=quers("q_answer")%>"></td></tr>
<tr><td colspan=10><hr></td></tr>
<%quers.MoveNext
loop%>
</table>
<%end if%>
<br><br><INPUT type="text" id=qid name=qid style="width:0px;height:0px;"><INPUT type="text" id=M_action name=M_action style="width:0px;height:0px;">
<TABLE WIDTH="90%" BORDER=0 CELLSPACING=0 CELLPADDING=0 align=center>
<tr>
<td align=center>
<INPUT type="button" value="Add New" id=Add name=add onclick="call add_new" style="font-family: Verdana"></td>
<td align=center>
<INPUT type="button" value="Update" id=update name=update onclick="call update_q(<%=total%>)" style="font-family: Verdana"></td>
<td align=center>
<INPUT type="button" value="Delete" id=delete name=delete onclick="call delete_q(<%=total%>)" style="font-family: Verdana"></td></tr>
</table>
<P>¡¡</P>
</form>
</BODY>
</HTML>
<%else
Response.Redirect "default.asp"
end if
adminRS.Close
end if %>
<td colspan=9><TEXTAREA rows=5 cols=100 id=textarea<%=quers("q_id")%> name=textarea<%=quers("q_id")%> style="font-family: Arial Unicode MS; border: 1px solid #D2D068; background-color: #E9E8BE" ><%=replace(quers("question"),"@",chr(13))%></TEXTAREA></td></tr>
Response.ContentType = "text/html"
Response.Charset = "gb2312"