📄 sch_banner.asp
字号:
<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="../Public/School_Cookies.asp" -->
<%
Dim Schid,Username,Tmp
Dim Cmd,Rs,Action
Dim SchoolName,BannerFile
Action = Request.QueryString("action")
If Action <> "" Then
Select Case Action
Case "dellogo"
Call Del_Submit() '//跳转到删除的函数
End Select
End if
'//获取会员登陆的标记
Username = Session("School")(0)
Schid = Session("School")(2)
'//调用存储过程
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandText = "Sch_Banner"
Cmd.CommandType = 4
Cmd.Parameters.Append Cmd.CreateParameter("@Schid",200,1,30)
Cmd.Parameters("@Schid") = Schid
Set Rs = Cmd.Execute
If Rs.Eof Then
CloseRs
Set Cmd = Nothing
CloseDB
Response.write "没有找到会员资料!"
Response.End()
End if
Tmp = Rs.GetRows() '//将数据填充到数组
'//0院校名,1图片,2院校性质
'//如 Tmp(0,0) 表示院校名称
CloseRs
Set Cmd = Nothing
'//功能代码
SchoolName = Tmp(0,0)
BannerFile = Tmp(1,0)
SchoolType = Cls_SchoolType(Tmp(2,0))
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Css/Style.css" type=text/css rel=stylesheet>
<title><%= Cls_WebName %> -- 院校会员管理中心 -- 院校图片</title>
</head>
<body>
<table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#FFFFFF">
<!--#include file="../Include/Header.asp" -->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="4"></td>
</tr>
<tr>
<td height="1" bgcolor="#eeeeee"></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="175" valign="top">
<!--#include file="../Public/School_Left.asp" -->
</td>
<td width="5"> </td>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25"><img src="../Images/icon.gif" width="11" height="11" align="absmiddle">
<%= SchoolName %> [<%= SchoolType %>]</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
<tr>
<td bgcolor="#FFFFFF"> <table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="2"></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
<tr>
<td height="25" bgcolor="f5f5f5"><b><font color="#000000"> 院校图片标识</font></b></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="98%" border="0" align="center" cellspacing="0" class="text01">
<form name="form" method="post" action="Sch_Banner_Up.asp" enctype="multipart/form-data" >
<tr>
<td>请上传图片标识:</td>
</tr>
<tr>
<td> <input type="hidden" name="filepath" value="../Uploadfiles/SchoolFile">
<input type="hidden" name="act" value="upload">
<input name="filename" style="font-family: 宋体; font-size: 12px" type="file" size="38">
</td>
</tr>
<tr>
<td> <input type="button" name="Submit22" value="删除图片" onClick="location.href='?action=dellogo';">
<input name="Send2" style="font-family: 宋体; font-size: 12px" type="submit" value="上传图片">
</td>
</tr>
</form>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td>上传说明<font color="#666666">:</font></td>
</tr>
<tr>
<td>所传图片一律为<font face="Verdana">JPG</font>、<font face="Verdana">JPEG</font>、或<font face="Verdana">GIF</font>格式
;</td>
</tr>
<tr>
<td><span style="font-family: 宋体; font-size: 12px">图片大小不能超过100K
; </span></td>
</tr>
<tr>
<td><span style="font-family: 宋体; font-size: 12px">图片应该处理成大小为135
x 160 像素 .</span></td>
</tr>
</table></td>
<td width="35%" height="170" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4"></td>
</tr>
<tr>
<td align="center">
<%
If BannerFile <> Null or BannerFile <> "" Then
Response.write "<img src=""../UpLoadFiles/SchoolFile/"&BannerFile&""" width=""135"" height=""160"">"
Else
Response.write "<img src=""../UpLoadFiles/DefaultFile/School.gif"" width=""135"" height=""160"">"
End if
%>
</td>
</tr>
<tr>
<td height="4"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="1" bgcolor="#eeeeee"></td>
</tr>
</table></td>
</tr>
</table>
<table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#FFFFFF">
<!--#include file="../Include/Footer.asp" -->
</td>
</tr>
</table>
</body>
</html>
<%
Sub Del_Submit() '//删除图片函数
'//提交数据
Schid = Session("School")(2)
Set Rs = Conn.Execute("Select BannerFile From [pH_School_Base] Where Schid='"&Schid&"'")
If Rs(0) = Null or Rs(0) = "" Then
CloseRs
CloseDB
Response.redirect "Sch_Banner.asp"
Else
'//删除图片文件
Set Fso = Server.createobject("Scripting.FileSystemObject")
If Fso.FileExists(Server.Mappath("../UpLoadFiles/SchoolFile/"&Rs(0))) Then
Fso.DeleteFile(Server.Mappath("../UpLoadFiles/SchoolFile/"&Rs(0)))
End if
SQL = "Update [pH_School_Base] Set BannerFile=Null,LastUpdate_Time='"&Now()&"' Where Schid='"&Schid&"'"
Conn.Execute(SQL)
CloseRs
CloseDB
Response.redirect "Sch_Banner.asp"
End if
End Sub
'//关闭数据库连接
CloseDB
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -