📄 edittopic.asp
字号:
<!--#include file="Check.asp"-->
<!--#include file="Conn.asp"-->
<!--#include file="Config.asp"-->
<!--#include file="Functions.asp"-->
<%
id=request("id")
Pic=Trim(Request("Pic"))
sql="select * from TestTopic where id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
subjectview=rs("subject")
typeedit=rs("type")
question=rs("question")
text1=rs("text1")
text2=rs("text2")
text3=rs("text3")
text4=rs("text4")
text5=rs("text5")
text6=rs("text6")
answer=rs("answer")
PicList=rs("PicList")
If Pic<>"" Then
PicList=Replace(PicList,Pic&",","")
rs("PicList")=PicList
rs.Update
Call DelFile(Pic)
End If
If PicList<>"" Then
P=Split(PicList,",")
Count=Ubound(P)
Else
Count=0
End If
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=Application("TestVersion")%>_修改题库</title>
<script language="javascript">
function submitit()
{
if (document.all.question.value=="")
{
alert("标题不能为空!");
return false;
}
else
{
if (document.all.text1.value=="" )
{
alert("答案不能为空!");
return false;
}
else
return true;
}
return true;
}
function SetIt()
{
str='<br>';
if(!document.all.upcount.value)
document.all.upcount.value=1;
for(i=1;i<=document.all.upcount.value;i++){
str+='文件'+i+':<input type="file" name="Pic'+i+'" size="30" class=inputnormal maxlength="20" class="input1" onblur="this.className=\'inputnormal\'" onfocus="this.className=\'inputedit\'"><br>';
document.all.TextID.innerHTML=str+'<br>';
}
}
</script>
<link rel="stylesheet" type="text/css" href="css.css">
<style>body{color:black;font-family:宋体;font-size:9pt;background-color:#B1DB99;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}body,td,th {
font-size: 12px;
}
</style>
</head>
<body onLoad="SetIt();">
<table width="100%" height="18" border="0" cellspacing="1" bordercolor="#C0C0C0" bgcolor="#D9ECFF" id="AutoNumber2" style="border-collapse: collapse">
<tr>
<td width="100%" background="../images/Down_bg.gif"> ★ <strong>当前位置: <font color=red><%=typeedit%></font> </strong>编辑</td>
</tr>
</table>
<br>
<%
if typeedit="单选题" then
%>
<table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%" id="AutoNumber3">
<form name="adminsubjectsingle" method="post" action="EditTopicOK.asp" onSubmit="return submitit();" enctype="multipart/form-data">
<tr>
<td width="80" align="center" bgcolor="#D9ECFF"><font color="#666666"><strong>当前题库</strong></font></td>
<td> <input type="text" name="subjectview" size="40" value="<%=subjectview%>" readonly class="inputnormal">
</td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF"><font color="#666666"><strong>选择类型</strong></font></td>
<td> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber4">
<tr>
<td><input type="radio" value="单选题" name="typeadd" checked>
</td>
<td width="80">单选题</td>
<td><input type="radio" name="typeadd" disabled> </td>
<td width="80">多选题</td>
<td><input type="radio" name="typeadd" disabled> </td>
<td width="80">判断题</td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF"><font color="#666666"><strong>标
题</strong></font></td>
<td> <textarea rows="3" name="question" cols="60" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal"><%=question%></textarea>
</td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF"><font color="#666666"><strong>内
容</strong></font></td>
<td>A. <input type="text" name="text1" size="60" value="<%=text1%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
B. <input type="text" name="text2" size="60" value="<%=text2%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
C. <input type="text" name="text3" size="60" value="<%=text3%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
D. <input type="text" name="text4" size="60" value="<%=text4%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
E. <input type="text" name="text5" size="60" value="<%=text5%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
F. <input type="text" name="text6" size="60" value="<%=text6%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
</td>
</tr>
<tr>
<td align="center" height="20" bgcolor="#D9ECFF"><font color="#666666"><strong>答
案</strong></font></td>
<td height="20"> <input type="text" name="answer" size="20" value="<%=answer%>" onKeyUp="this.value.toUpperCase()" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal"></td>
</tr>
<tr>
<td align="center" height="20" bgcolor="#D9ECFF"><font color="#666666"><strong>文件上传:</strong></font></td>
<td>
<li>
现在有图片:<%
If Count=0 Then
Response.Write "<font color=red>无</font><BR>"
Else
Response.Write "<BR>"
For K=0 To Count-1
Response.Write"图片"&K+1&":<a href='"&SoftPath&Trim(P(k))&"' target=_blank>"&SoftPath&Trim(P(k))&"</a> [<a href='EditTopic.asp?id="&id&"&Pic="&Trim(P(k))&"' onclick=return(confirm('yes?'))>删除</a>]<BR>"
Next
End If
%>
文件个数
<input type="text" name="upcount" size=2 value="0" class='inputnormal' onblur='this.className="inputnormal"' onfocus='this.className="inputedit";'>
<input type="button" name="Button" onclick="SetIt();" value="· 添加 ·" class="b2">
<div id=TextID></div></li>
</td>
</tr>
<tr>
<td align="center" height="20" colspan="2"> <div align="right">
<input type="hidden" value="<%=id%>" name="id">
<input type="submit" value="保存" name="B1" class="b2">
<input type="button" value="关闭窗口" name="B2" onClick="self.close()" class="b2">
</div></td>
</tr></form>
</table>
<%
end if
if typeedit="多选题" then
%>
<table border="1" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%" id="AutoNumber3">
<form name="adminsubjectmulti" method="post" action="EditTopicOK.asp" onSubmit="return submitit();" enctype="multipart/form-data">
<tr>
<td width="80" align="center" bgcolor="#D9ECFF"><font color="#666666"><strong>当前题库</strong></font></td>
<td> <input type="text" name="subjectview" size="40" value="<%=subjectview%>" readonly class="inputnormal">
</td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF"><font color="#666666"><strong>选择类型</strong></font></td>
<td> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber4">
<tr>
<td><input type="radio" disabled=1> </td>
<td width="80">单选题</td>
<td> <input type="radio" value="多选题" name="typeadd" checked>
</td>
<td width="80">多选题</td>
<td><input type="radio" name="type" disabled=1> </td>
<td width="80">判断题</td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF"><font color="#666666"><strong>标
题</strong></font></td>
<td> <textarea rows="3" name="question" cols="60" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal"><%=question%></textarea>
</td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF"><font color="#666666"><strong>内
容</strong></font></td>
<td>A. <input type="text" name="text1" size="60" value="<%=text1%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
B. <input type="text" name="text2" size="60" value="<%=text2%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
C. <input type="text" name="text3" size="60" value="<%=text3%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
D. <input type="text" name="text4" size="60" value="<%=text4%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
E. <input type="text" name="text5" size="60" value="<%=text5%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
<br>
F. <input type="text" name="text6" size="60" value="<%=text6%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
</td>
</tr>
<tr>
<td align="center" height="20" bgcolor="#D9ECFF"><font color="#666666"><strong>答
案</strong></font></td>
<td height="20"> <input type="text" name="answer" size="20" value="<%=answer%>" onKeyUp="this.value.toUpperCase();" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
提示:答案之间请用“<font color=red>,</font>”隔开!</td>
</tr>
<tr>
<td align="center" height="20" bgcolor="#D9ECFF"><font color="#666666"><strong>文件上传:</strong></font></td>
<td>
<li>
现在有图片:<%
If Count=0 Then
Response.Write "<font color=red>无</font><BR>"
Else
Response.Write "<BR>"
For K=0 To Count-1
Response.Write"图片"&K+1&":<a href='"&SoftPath&Trim(P(k))&"' target=_blank>"&SoftPath&Trim(P(k))&"</a> [<a href='EditTopic.asp?id="&id&"&Pic="&Trim(P(k))&"' onclick=return(confirm('yes?'))>删除</a>]<BR>"
Next
End If
%>
文件个数
<input type="text" name="upcount" size=2 value="0" class='inputnormal' onblur='this.className="inputnormal"' onfocus='this.className="inputedit";'>
<input type="button" name="Button" onclick="SetIt();" value="· 添加 ·" class="b2">
<div id=TextID></div></li>
</td>
</tr>
<tr>
<td align="center" height="20" colspan="2"> <div align="right">
<input type="hidden" value="<%=id%>" name="id">
<input type="submit" value="保存" name="B1" class="b2">
<input type="button" value="关闭窗口" name="B2" onClick="self.close()" class="b2">
</div></td>
</tr></form>
</table>
<%
end if
if typeedit="判断题" then
%>
<table border="1" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%" id="AutoNumber3">
<form name="adminsubjectjudge" method="post" action="EditTopicOK.asp" enctype="multipart/form-data">
<tr>
<td width="80" align="center" bgcolor="#D9ECFF"><strong><font color="#666666">当前题库</font></strong></td>
<td> <input type="text" name="subjectview" size="40" value="<%=subjectview%>" readonly class="inputnormal">
</td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF"><strong><font color="#666666">选择类型</font></strong></td>
<td> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber4">
<tr>
<td><input type="radio" name="type" disabled=1> </td>
<td width="80">单选题</td>
<td><input type="radio" name="type" disabled=1> </td>
<td width="80">多选题</td>
<td> <input type="radio" value="判断题" name="typeadd" checked>
</td>
<td width="80">判断题</td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF"><strong><font color="#666666">标
题</font></strong></td>
<td> <textarea rows="3" name="question" cols="60" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal"><%=question%></textarea>
</td>
</tr>
<tr>
<td align="center" bgcolor="#D9ECFF" height="20"><strong><font color="#666666">答
案</font></strong></td>
<td height="20"> <input type="text" name="answer" size="20" value="<%=answer%>" onKeyUp="this.value.toUpperCase();" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal"></td>
</tr>
<tr>
<td align="center" height="20" bgcolor="#D9ECFF"><font color="#666666"><strong>文件上传:</strong></font></td>
<td>
<li>
现在有图片:<%
If Count=0 Then
Response.Write "<font color=red>无</font><BR>"
Else
Response.Write "<BR>"
For K=0 To Count-1
Response.Write"图片"&K+1&":<a href='"&SoftPath&Trim(P(k))&"' target=_blank>"&SoftPath&Trim(P(k))&"</a> [<a href='EditTopic.asp?id="&id&"&Pic="&Trim(P(k))&"' onclick=return(confirm('yes?'))>删除</a>]<BR>"
Next
End If
%>
文件个数
<input type="text" name="upcount" size=2 value="0" class='inputnormal' onblur='this.className="inputnormal"' onfocus='this.className="inputedit";'>
<input type="button" name="Button" onclick="SetIt();" value="· 添加 ·" class="b2">
<div id=TextID></div></li>
</td>
</tr>
<tr>
<td align="center" height="20" colspan="2"> <div align="right">
<input type="hidden" value="<%=id%>" name="id">
<input type="submit" value="保存" name="B1" class="b2">
<input type="button" value="关闭窗口" name="B2" onClick="self.close()" class="b2">
</div></td>
</tr></form>
</table>
<%
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -