⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gqxx_infoedit.asp

📁 网站源码
💻 ASP
字号:
<%@ codepage = 936 LCID = 2052 %>
<% if Session("exemple_status") <> "login" then response.redirect "login.asp" %>
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<!--#include file="db.asp"-->

<%
response.buffer = true

'get key
key = request.querystring("key")
if key="" or isnull(key) then
	key=request.form("key")
end if
if key="" or isnull(key) then response.redirect "gqxx_infolist.asp"

'get action
a=request.form("a")
if a="" or isnull(a) then
	a="I"	'display with input box
end if

'get fields from form

x_id = Request.Form("x_id")
x_title = Request.Form("x_title")
x_content = Request.Form("x_content")
x_type = Request.Form("x_type")

' Open Connection to the database
set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str

Select Case a
	Case "I": ' Get a record to display

		tkey = key
		strsql = "SELECT * FROM [gqxx_info] WHERE [id]=" & tkey

		set rs = Server.CreateObject("ADODB.Recordset")
		rs.Open strsql, conn
		If rs.EOF Then
			Response.Clear
			Response.Redirect "gqxx_infolist.asp"
		Else
			rs.MoveFirst
		End If

		' Get the field contents
		x_id = rs("id")
		x_title = rs("title")
		x_content = rs("content")
		x_type = rs("type")

		rs.Close
		Set rs = Nothing

	Case "U": ' Update

		' Open record
		tkey = key
		strsql = "SELECT * FROM [gqxx_info] WHERE [id]=" & tkey

		set rs = Server.CreateObject("ADODB.Recordset")
		rs.Open strsql, conn, 1, 2

		If rs.EOF Then
			Response.Clear
			Response.Redirect "gqxx_infolist.asp"
		End If

		
tmpFld = Trim(x_title)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("title") = tmpFld
tmpFld = Trim(x_content)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("content") = tmpFld
tmpFld = x_type
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("type") = cInt(tmpFld)

		rs.Update
		rs.Close
		Set rs = Nothing
		conn.Close
		Set conn = Nothing
		Response.Clear
		Response.Redirect "gqxx_infolist.asp"
End Select
%>

<!--#include file="header.asp"-->

<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#336699"><tr><td>
<img src="images/bnredit.gif" alt="" width="400" height="30" border="0"></td></tr></table>

<table width="100%" border="0" cellspacing="0" cellpadding="10"><tr><td>
<p>TABLE : 供求信息管理<br><br><a href="gqxx_infolist.asp">[返回上一页]</a></p>

<script language="JavaScript" src="ew.js"></script>
<script language="JavaScript">
<!-- start Javascript
function  EW_checkMyForm(EW_this) {
if  (!EW_hasValue(EW_this.x_title, "TEXT" )) {
            if  (!EW_onError(EW_this, EW_this.x_title, "TEXT", "请填写供求信息标题!!!!"))
                return false; 
        }
return true;
}
// end JavaScript -->
</script>
<form onSubmit="return EW_checkMyForm(this);"  action="gqxx_infoedit.asp" method="post">
<p>
<input type="hidden" name="a" value="U">
<input type="hidden" name="key" value="<%= key %>">

<table width="500" border="0" cellspacing="1" cellpadding="5" bgcolor="cccccc">
<tr>
<td bgcolor="f5f5f5"><font color="">id&nbsp;</td>
<td bgcolor="#F5F5F5"><%= x_id %>&nbsp;</td>
</tr>
<tr>
<td bgcolor="f5f5f5"><font color="">信息标题&nbsp;</td>
<td bgcolor="#F5F5F5"><input type="text" name="x_title" value="<%= x_title %>" size=50 maxlength=50>
                          &nbsp;</td>
</tr>
<tr>
<td bgcolor="f5f5f5"><font color="">信息内容&nbsp;</td>
<td bgcolor="#F5F5F5"><textarea cols=50 rows=10 name="x_content"><%= x_content %></textarea>&nbsp;</td>
</tr>
<tr>
<td bgcolor="f5f5f5"><font color="">供求方式&nbsp;</td>
<td bgcolor="#F5F5F5"><%
x_typeList = "<SELECT name='x_type'>"
    x_typeList = x_typeList & "<OPTION value=" & "1"
    If x_type = "1" Then
        x_typeList = x_typeList & " selected"
    End If
    x_typeList = x_typeList & ">" & "供应" & "</option>"
    x_typeList = x_typeList & "<OPTION value=" & "2"
    If x_type = "2" Then
        x_typeList = x_typeList & " selected"
    End If
    x_typeList = x_typeList & ">" & "需求" & "</option>"
x_typeList = x_typeList & "</select>"
response.write x_typeList
%>
&nbsp;</td>
</tr>
</table>
<p>
<input type="submit" name="Action" value="EDIT">
</form>
</td></tr></table>
<!--#include file="footer.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -