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

📄 edit.asp

📁 java书店管理系统 java书店管理系统 java书店管理系统
💻 ASP
字号:
<!--#include file="Conn.asp"-->
<!--#include file="md5.asp"-->
<!--#include file=inc.asp-->
<%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1  
Response.cachecontrol = "no-cache" 
Dim Rs,Sql
If Session("UserName")="" OR Session("UserId")="" Then
Response.Write("<script language=JavaScript>alert('您还没有登陆!');document.location.href='index.asp';</script>")
Response.End
End if

If Request.QueryString("Action")="Edit" Then
If ChkPost=false Then
Response.Write("<script language=JavaScript>alert('请不要重外部提交信息!');document.location.href='index.asp';</script>")
Response.End
End If
Dim UserId,UserName,UserPwd,IP,UserMaxUp
UserId=Trim(Request.Form("UserId"))
UserName=Trim(Request.Form("UserName"))
UserPwd=Trim(Request.Form("UserPwd"))
UserMaxUp=Trim(Request.Form("UserMaxUp"))
If Userid="" Then
Response.Write("<script language=JavaScript>alert('用户ID丢失!');document.location.href='javascript:window.history.go(-1);';</script>")
Response.End
End If
If UserName="" Then
Response.Write("<script language=JavaScript>alert('请输入用户名!');document.location.href='javascript:window.history.go(-1);';</script>")
Response.End
End If
if UserMaxUp<>"" then
If isInteger(UserMaxUp)=False Then
Response.Write("<script language=JavaScript>alert('上传文件大小必须是数字!');document.location.href='javascript:window.history.go(-1);';</script>")
Response.End
End If
end if
Userid=Replace(Userid,"'","")
UserName=Replace(UserName,"'","")
UserPwd=Replace(UserPwd,"'","")

Sql="Select * From Users Where Userid='"&Userid&"'"
Set Rs=server.CreateObject("adodb.recordset")
If Not IsObject(Conn) Then ConnectionDatabase()
Rs.open Sql,Conn,1,3
If Rs.Eof Then
Rs.close
Set Rs=Nothing
CloseDatabase()
Response.Write("<script language=JavaScript>alert('用户ID不存在!');document.location.href='javascript:window.history.go(-1);';</script>")
Else
Rs("UserName")=UserName
If Request.Form("isme")="1" Then
Session("UserName")=UserName
'Session("UserAdmin")=CBool(Request.Form("UserType"))
End if
if UserPwd<>"" Then
Rs("UserPwd")=md5(UserPwd,32)
End if
if UserMaxUp<>"" then
Rs("UserMaxUp")=clng(UserMaxUp)
End if
Rs("UserSex")=Request.Form("UserSex")
Rs("UserType")=CBool(Request.Form("UserType"))
Rs.UpDate
Rs.close
Set Rs=nothing
CloseDatabase()
Response.Write("<script language=JavaScript>alert('资料修改成功!');document.location.href='Edit.asp?ID="&Request("UserId")&"';</script>")
End if
Response.End
End If
%>
<%Call Top("修改资料","Edit.asp?ID="&Session("UserId")&"")%>
<TABLE style="BORDER-RIGHT: #c0c0c0 1px solid; BORDER-LEFT: #c0c0c0 1px solid" 
cellSpacing=0 cellPadding=0 width=778 align=center bgColor=#f7f7f7 border=0>
  <TBODY>
  <TR>
    <TD vAlign=top width=220>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
        <TBODY>
        <TR>
          <TD 
          background=images/side_bg_r1_c1.gif 
          height=34>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD width=10></TD>
                <TD width=20><IMG height=14 
                  src="images/ico_015.gif" 
                  width=13 border=0></TD>
                <TD width=100>用户登陆</TD>
                <TD width=85></TD>
                <TD width=5></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD 
          background=images/side_bg_r2_c1.gif>
            <TABLE cellSpacing=0 cellPadding=0 width=200 align=center 
              border=0><TBODY>
              <TR>
                <TD align="center">
					<table width="90%" border="0" cellspacing="0" cellpadding="0">
					  <tr>
                        <td width="34%" align="right">欢 迎 您:</td>
                        <td width="66%"><%=Session("UserName")%></td>
                      </tr>
                      <tr>
                        <td align="right">登陆次数:</td>
                        <td><b><%=Session("UserLogins")%></b></td>
                      </tr>
					   <tr>
                        <td align="right">上传课件:</td>
                        <td><font color=red>
						<%If Not IsObject(Conn) Then ConnectionDatabase()%>
						<%=Conn.execute("Select UpFiles from Users Where UserId='"&Session("UserId")&"'")(0)
						%>
						</font>个</td>
                      </tr>
					   <tr>
                        <td align="right">相关操作:</td>
                        <td><a href="UpLoad.asp"><font color=red>上传课件</font></a>
						<a href="Edit.asp?ID=<%=Session("UserId")%>">修改资料</a>
						<%If Session("UserAdmin") Then Response.Write"<a href=Admin.asp>添加用户</a>"%>
						</td>
                      </tr>
					  <tr>
                        <td height="3" colspan="2"></td>
                        </tr>
                      <tr>
                        <td></td>
                        <td align="right"><input name="Logout" type="button" id="Logout" value="退出" onClick="location.href='Login.asp?action=logout'">                        </td>
                      </tr>
                    </table>
					</TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD 
          background=images/side_bg_r3_c1.gif 
          height=4></TD></TR></TBODY></TABLE>
	  </TD>
    <TD width=1 bgColor=#b4b4b4></TD>
    <TD width=1 bgColor=#ffffff></TD>
    <TD width=1></TD>
    <TD vAlign=top width=553>
      <TABLE cellSpacing=0 cellPadding=0 width=553 align=center border=0>
        <TBODY>
        <TR>
          <TD width=2 rowSpan=2></TD>
          <TD width=548>
            <TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
              <TBODY>
              <TR>
                <TD width=120 
                background=images/ad_title.gif 
                height=30>
                  <TABLE cellSpacing=0 cellPadding=0 width=120 border=0>
                    <TBODY>
                    <TR>
                      <TD colSpan=2 height=6></TD></TR>
                    <TR>
                      <TD width=10></TD>
                      <TD noWrap>▍资料修改</TD>
                    </TR>
                    <TR>
                      <TD colSpan=2 height=0></TD></TR></TBODY></TABLE></TD>
                <TD align=middle width=428 
                background=images/ad_title_bg.gif 
                height=30></TD>
              </TR></TBODY></TABLE></TD>
          <TD width=3 rowSpan=2></TD></TR>
        <TR>
          <TD width=548>
            <TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
              <TBODY>
              <TR>
                <TD>
                  <TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
                    <TBODY>
                    <TR>
                      <TD width=1 bgColor=#d4d4d4></TD>
                      <TD width=1 bgColor=#ffffff></TD>
                      <TD valign=top width=544 height=100>
					  <form id="form2" name="form2" method="post" action="?Action=Edit">
					  <table width="98%" border="0" cellspacing="2" cellpadding="5">
					   <tr>
                          <td width="14%" align="right">用户名:</td>
                          <td width="86%"><label>
						  <%
						  If Trim(Request("ID"))="" Then
						  Response.Write("<script language=JavaScript>alert('用户ID丢失!');document.location.href='javascript:window.history.go(-1);';</script>")
						  Response.End
						  End if
						  Set Rs=Conn.execute("Select UserType,UserName,UserSex,UserType,UserId,UserMaxUp,UserLogins,UserLastTime from Users Where UserId='"&Trim(Request("ID"))&"'")
						  if rs.eof then
						  set Rs=nothing
						  CloseDatabase()
						  Response.Write("<script language=JavaScript>alert('用户ID不存在!');document.location.href='javascript:window.history.go(-1);';</script>")
						  Response.End
						  End if
						  if cstr(Rs(4))<>cstr(Session("UserId")) and not Session("UserAdmin") Then
						  set Rs=nothing
						  CloseDatabase()
						  Response.Write("<script language=JavaScript>alert('您无权修改该用户资料!');document.location.href='javascript:window.history.go(-1);';</script>")
						  Response.End
						  End if
						  If Not Session("UserAdmin") Then
						  Response.write Rs(4)
						  Response.write"<input name=UserId type=""hidden"" id=UserId value="&Rs(4)&" />"
						  Else
						  %>
                            <input name="UserId" type="text" id="UserId" style="height:20px;width:160px" value="<%=Rs(4)%>" size="20" maxlength="20"/> 
                            <input type="button" name="myid" value="转到该用户" onclick="location.href='Edit.asp?ID='+UserId.value" />
                            修改其他用户请输入该用户ID
                            <%End if%>
                          </label></td>
                        </tr>
					   <%If cstr(Rs(1))=cstr(Session("UserName")) Then%>
					   <input name="isme" type="hidden" id="isme" value="1" />
					   <%End if%>
                        <tr>
                          <td align="right">用户名:</td>
                          <td><label>
                            <input name="UserName" type="text" id="UserName" style="height:20px;width:160px" value="<%=Rs(1)%>" size="20" maxlength="20"/>
                            
                          </label></td>
                        </tr>
                        <tr>
                          <td align="right">密 码:</td>
                          <td><label>
                            <input name="UserPwd" type="password" id="UserPwd" size="20" maxlength="20" style="height:20px;width:160px" />
                          不修改请留空</label></td>
                        </tr>
                        <tr>
                          <td align="right">性 别:</td>
                          <td><label>
                            <input name="UserSex" type="radio" value="True" <%if rs(2) Then%>checked="checked"<%End if%> />
                            <input type="radio" name="UserSex" value="False" <%if not rs(2) Then%>checked="checked"<%End if%> />
                          女</label></td>
                        </tr>
						<%If Session("UserAdmin") Then%>
						<tr>
                          <td align="right">文 件:</td>
                          <td><input name="UserMaxUp" type="text" id="UserMaxUp" value="<%=Rs(5)%>" size="5" maxlength="10" /> 
                            KB  允许上传文件大小,为0不允许上传</td>
                        </tr>
						<tr>
                          <td align="right">类 型:</td>
                          <td><label>
                            <input name="UserType" type="checkbox" id="UserType" value="True" <%if rs(3) Then%>checked="checked"<%End if%> />
                          是否管理员</label></td>
                        </tr>
						<%end if
						%>
						<tr>
                          <td align="right">登 陆:</td>
                          <td><b><%=Rs(6)%></b> 次 最后登陆时间:<%=Rs(7)%></td>
                        </tr>
						<%Set Rs=Nothing%>
                        <tr>
                          <td>&nbsp;</td>
                          <td><label>
                            <input type="submit" name="Submit" value="修改" />
                          </label></td>
                        </tr>
                      </table>
                        </form>
                        </TD>
                      <TD width=1 bgColor=#ffffff></TD>
                      <TD width=1 bgColor=#d4d4d4></TD></TR></TBODY></TABLE></TD></TR>
              <TR>
                <TD>
                  <TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
                    <TBODY>
                    <TR>
                      <TD width=1 bgColor=#d4d4d4></TD>
                      <TD bgColor=#ffffff height=1></TD>
                      <TD width=1 bgColor=#d4d4d4></TD></TR>
                    <TR>
                      <TD bgColor=#d4d4d4 colSpan=3 
                  height=1></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE 
style="BORDER-TOP-WIDTH: 1px; BORDER-RIGHT: #c0c0c0 1px solid; BORDER-BOTTOM-WIDTH: 1px; BORDER-LEFT: #c0c0c0 1px solid" 
cellSpacing=0 cellPadding=0 width=778 align=center bgColor=#ffffff border=0>
  <TBODY>
  <TR>
    <TD bgColor=#dbe2e8 height=1></TD></TR>
  <TR>
    <TD bgColor=#ffffff height=1></TD></TR>
  <TR>
    <TD bgColor=#c5cfd9 height=1></TD></TR>
  <TR>
    <TD bgColor=#dbe2e8 height=1></TD></TR></TBODY></TABLE>
	<%Call Bottom()%>

⌨️ 快捷键说明

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