?? modifypr.asp
字號:
<html>
<head>
<title>大類管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<link href="../css/main.css" rel="stylesheet" type="text/css">
<link href="../images/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<!--#include file=conn.asp-->
<!--#include file=refuse.asp-->
<%
dim message,name2,dbclass,dsclass,dname,prs
dname=request.QueryString("dname")
dbclass=request.QueryString("dbclass")
message=request.QueryString("message")
if message="" then message="為了數據的安全,請你仔細填寫各項(加*為必填)"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from product",conn,1,1
rs.movefirst
if dbclass="" then dbclass=rs("bclass")
if dname="" then dname=rs("name")
%>
<body>
<table width="500" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6B8FC8">
<!--DWLayoutTable-->
<tr>
<td width="496" height="29" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="496" height="27" valign="middle">
<div align="center" ><font color="red" size="3"><%=message%></font></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="236" valign="top" bgcolor="#E8F1FF"><div align="center">
<form name="form1" id="form1" method="post" action="modifypr2.asp">
<table >
<!--DWLayoutTable-->
<tr>
<td width="118" height="21"> </td>
<td width="72"></td>
<td width="97"></td>
</tr>
<tr>
<TD height="23" colspan="2" valign="top" class="boxcontent"> <div align="right">請選擇一個產品</div></TD>
<td valign="top"> <div align="left">
<select name="name" id="name" onChange="MM_jumpMenu('self',this,0)">
<option value="modifypr.asp?dname=<%=dname%>" selected><%=dname%></option>
<%
do while not rs.eof
%>
<option value="modifypr.asp?dname=<%=rs("name")%>"><%=rs("name")%></option>
<%
rs.movenext
loop
rs.close
%>
</select>
</div></td>
</tr>
<%
set prs=server.CreateObject("adodb.recordset")
prs.open "select * from product where name='"&dname&"'",conn,1,1
if not prs.eof then dsclass=prs("sclass")
%>
<tr>
<td height="22" colspan="2" valign="top" class="boxcontent"><div align="right">本產品名稱更改為:</div></td>
<td valign="top"> <div align="left">
<input name="realname" type="text" class="INPUT" id="realname" value="<%=prs("name")%>" size="13">
*</div></td>
</tr>
<tr>
<td height="26" colspan="2" valign="top" class="boxcontent"><div align="right">本產品圖片名稱(包括后綴名)</div></td>
<td valign="top"><input name="pic" type="text" class="INPUT" id="pic" value="<%=prs("pic")%>" size="13">
*</td>
</tr>
<tr>
<td height="27" colspan="2" valign="top" class="boxcontent"><div align="right">所屬大類:</div></td>
<td valign="top"> <select name="select" id="select" onChange="MM_jumpMenu('self',this,0)">
<option value="modifypr.asp?dbclass=<%=dbclass%>&dname=<%=dname%>" selected><%=dbclass%></option>
<%
rs.open "select * from bclass",conn,1,1
do while not rs.eof
%>
<option value="modifypr.asp?dbclass=<%=rs("name")%>&dname=<%=dname%>"><%=rs("name")%></option>
<%
rs.movenext
loop
rs.close
%>
</select>
*</td>
</tr>
<tr>
<td height="27" colspan="2" valign="top" class="boxcontent"><div align="right">所屬于小類:</div></td>
<td valign="top"><select name="sclass" id="sclass">
<%
rs.open "select * from sclass where bclass='"&dbclass&"'",conn,1,1
if not rs.eof and not rs.bof then
dsclass=rs("name")
%>
<option value="<%=dsclass%>" selected><%=dsclass%></option>
<%
do while not rs.eof
%>
<option value="<%=rs("name")%>"><%=rs("name")%></option>
<%
rs.movenext
loop
else %>
<option vaule="<%=dsclass%>">此大類沒有小類</option>
<%
end if %>
<%
rs.close
%>
</select>
*</td>
</tr>
<tr>
<td height="28" colspan="2" valign="top" class="boxcontent"><div align="right">規格:</div></td>
<td valign="top"><input name="guige" type="text" class="INPUT" id="guige" value="<%=prs("guige")%>" size="13">
*</td>
</tr>
<tr>
<td height="68" valign="middle" class="boxcontent"><div align="right">產品簡介:</div></td>
<td colspan="2" valign="middle"> <textarea name="intro" cols="22" rows="3" id="intro"><%=prs("intro")%></textarea>
*</td>
</tr>
<tr>
<td height="68" valign="middle" class="boxcontent">價格</td>
<td colspan="2" valign="middle">
<input name="ap" type="text" id="ap" size="20" value="<%=prs("ap")%> ">*</td>
</tr>
<tr>
<td height="30" colspan="2" valign="top"><div align="center">
<input name="forename" type="hidden" id="forename" value="<%=dname%>">
<input name="bclass" type="hidden" id="bclass2" value="<%=dbclass%>">
<input type="submit" name="Submit" value="更改" onClick="return check();">
</div></td>
<td valign="top"><input type="reset" name="Submit2" value="重置">
</td>
</tr>
<tr>
<td height="28" colspan="3" valign="top"> <div align="center" class="content">輸入區域里是選中的產品的對應的所有信息</div></td>
</tr>
<tr>
<td height="14"></td>
<td></td>
<td></td>
</tr>
<%
prs.close
set rs=nothing
%>
</table>
</form>
</div>
</td>
</tr>
</table>
<br>
<SCRIPT LANGUAGE="JavaScript">
<!--
function check()
{
if(checkspace(document.form1.name.value)) {
document.form1.name.focus();
alert("大類名不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.intro.value)) {
document.form1.intro.focus();
alert("簡介不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.cintro.value)) {
document.form1.cintro.focus();
alert("詳細信息不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.pic1.value)) {
document.form1.pic1.focus();
alert("PIC1不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.pic2.value)) {
document.form1.pic2.focus();
alert("pic2不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.pic3.value)) {
document.form1.pic3.focus();
alert("pic3不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.pic4.value)) {
document.form1.pic4.focus();
alert("pic4不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.question1.value)) {
document.form1.question1.focus();
alert("question1不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.question2.value)) {
document.form1.question2.focus();
alert("question2不能為空,請重新輸入!");
return false;
}
if(checkspace(document.form1.question3.value)) {
document.form1.question3.focus();
alert("question3不能為空,請重新輸入!");
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
//-->
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -