📄 admin_class_add.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="function.asp" -->
<!--#include file="admin_check.asp" -->
<!--#include file="conn_acc.asp" -->
<%
dim f_cid,f_sid
f_sid =Trim(Request.QueryString("sid"))
if f_sid ="" then f_sid=0
f_cid =Request.Form("f_cid")
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
If (CStr(Request("MM_insert")) = "form_menu") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_conn_comm_STRING
MM_editCmd.CommandText = "INSERT INTO firste_city (f_title, f_p, f_up) VALUES (?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 50, Request.Form("f_title")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 5, 1, -1, MM_IIF(Request.Form("f_p"), Request.Form("f_p"), null)) ' adDouble
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 5, 1, -1, MM_IIF(f_cid, f_cid, null)) ' adDouble
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
Set Command1 = Server.CreateObject ("ADODB.Command")
Command1.ActiveConnection = MM_conn_comm_STRING
Command1.CommandText = "UPDATE firste_city SET f_grade =f_grade+1 WHERE fid = "&f_cid
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "admin_class.asp"
' If (Request.QueryString <> "") Then
'If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
' MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
' Else
' MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
' End If
'End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>firste</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="t3">
<tr>
<td class="l"></td>
<td align="center" class="t">添加导航</td>
<td class="r"></td>
</tr>
</table>
<div class="b3">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form action="<%=MM_editAction%>" method="POST" name="form_menu" id="form_menu">
<table width="96%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#D6EFF7">
<tr>
<td width="39%" align="right" bgcolor="#FFFFFF"><strong>导航名称:</strong></td>
<td width="61%" bgcolor="#FFFFFF"><input name="f_title" type="text" id="f_title" maxlength="10"></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF"><strong>父类别:</strong></td>
<td bgcolor="#FFFFFF"><% call firste_classselect(MM_conn_comm_STRING,"firste_city",0,0,cint(f_sid)) %><br>
<span class="fred">顶级类别不选</span></td>
</tr>
<!-- <tr>
<td align="right" bgcolor="#FFFFFF"><strong>链接地址:</strong></td>
<td bgcolor="#FFFFFF"><input name="f_link" type="text" id="f_link" size="60" maxlength="250"><br>
<span class="fred">最底层导航才调用链接地址,外部链接记得加 http://</span></td>
</tr> -->
<tr>
<td align="right" bgcolor="#FFFFFF"><strong>排序:</strong></td>
<td bgcolor="#FFFFFF"><input name="f_p" type="text" id="f_p" value="0" size="4" maxlength="4" onKeyUp="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"><br>
<span class="fred">数字越大越靠后</span></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" name="button" id="button" value=" 添 加 ">
<input type="button" name="button" id="button" value=" 取 消 " onClick="javascript:history.go(-1);"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form_menu">
</form>
</td>
</tr>
</table>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="t3b">
<tr>
<td class="l"> </td>
<td class="c"> </td>
<td class="r"> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -