?? editbook.asp
字號:
<!--#include file="conn.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('網絡超時或您還沒有登陸!');history.go(-1);</script>"
response.End
end if
dim bookid
bookid=request.QueryString("id")
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535}
body{font-size:9pt;line-height:120%}
a:link { color: #000000; text-decoration: none }
a:visited { color: #000000; text-decoration: none }
a:active { color: #000000; text-decoration: none }
a:hover { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_Nclass order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{ //這句不是很理解
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<body bgcolor="#799AE1">
<table width="80%" border="1" cellspacing="0" cellpadding="1" bordercolor="#6699FF" align="center">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="../images/back_3.gif" rowspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
<tr>
<td class="12v" >
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6B8FC8">
<tr>
<td bgcolor="#FFFFFF" height="20">
<div align="center"><font color="#000000">修改圖片</font></div>
</td>
</tr>
<tr>
<form name="myform" method="post" action="saveaddbook.asp?action=edit&id=<%=bookid%>">
<td height="126" bgcolor="#E8F1FF">
<table width="88%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="16%">
<div align="center">選擇分類:</div>
</td>
<td colspan="2"> <%
rs.open "select * from shop_anclass order by anclassidorder",conn,1,1
if rs.eof and rs.bof then
response.write "請先添加欄目。"
response.end
else
%>
<select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
<option selected value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
<% dim selclass
selclass=rs("anclassid")
rs.movenext
do while not rs.eof
%>
<option value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
小類:
<select name="Nclassid">
<%rs.open "select * from shop_Nclass where anclassid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%>
<option selected value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
<% rs.movenext
do while not rs.eof%>
<option value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
<% rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</select>
<%dim rs1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from shop_books where bookid="&bookid,conn,1,1
%> <font color="#FF0000"> </font></td>
</tr>
<tr>
<td>
<div align="center">圖片名稱:</div>
</td>
<td colspan="2">
<input name="bookname" type="text" id="bookname" size="30" value="<%=trim(rs1("bookname"))%>">
</td>
</tr>
<tr>
<td height="18">
<div align="center">圖片來源:</div>
</td>
<td height="18" colspan="2">
<input name="bookpic1" type="text" id="bookpic" size="30" value="<%=trim(rs1("bookpic"))%>">
<input type="button" name="Submit2" value="上傳小圖片" onClick="window.open('../upload_flash.asp?formname=myform&editname=bookpic1&uppath=bookpic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
</td>
</tr>
<tr>
<td height="18">
<div align="center"> </div>
</td>
<td height="18" colspan="2">
<input name="zhuang" type="text" id="bookpic" size="30" value="<%=trim(rs1("zhuang"))%>">
<input type="button" name="Submit2" value="上傳大圖片" onClick="window.open('../upload_flash.asp?formname=myform&editname=zhuang&uppath=bookpic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
</td>
</tr>
<tr>
<td valign="top">
<div align="center">圖片說明:</div>
</td>
<td colspan="2">
<textarea name="bookcontent" cols="46" rows="8" id="bookcontent"><%=HTMLEncode(trim(rs1("bookcontent")))%></textarea>
</td>
</tr>
<tr>
<td valign="top">
<div align="center">相關知識:</div>
</td>
<td colspan="2">
<textarea name="bookmulu" cols="46" rows="8" id="bookmulu"><%=HTMLEncode(trim(rs1("bookmulu")))%></textarea>
</td>
</tr>
<tr>
<td height="32">
<div align="center"> </div>
</td>
<td width="32%" height="32">
<div align="center">
<input type="submit" name="Submit" value="修 改" onClick="return check();">
</div>
</td>
<td width="52%">
<input name="bestbook" type="checkbox" id="bestbook" value="1" <%if rs1("bestbook")=1 then%>checked<%end if%>>
推薦此圖片</td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%rs1.close
set rs1=nothing
conn.close
set conn=nothing%>
<br>
<!--#include file="copyright.asp"-->
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function check()
{
if(checkspace(document.myform.bookname.value)) {
document.myform.bookname.focus();
alert("請輸入圖片名稱!");
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
//-->
</script>
<script>
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
</script>
<%
function HTMLEncode(fString)
fString = Replace(fString, "</P><P>", CHR(10) & CHR(10))
fString = Replace(fString, "<BR>", CHR(10))
HTMLEncode = fString
end function
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -