%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "umacus","",""
Set Session("umacus_conn") = conn
%>
<% IF Session("UserLoggedIn") <> "True" then response.Redirect "default.php" End If %>
Control Panel
Currently Logged In as:
<%=Session("UserFirstName") & " " & Session("UserLastName")%> Access Level:<%=Session("AccessLevel")%>
Today Is:
<%=FormatDateTime(Date, 1)%>
<%
On Error Resume Next
Set Upload = Server.CreateObject("Persits.Upload.1")
varUploadPath = "D:\webserv\dinger\umacus.com\webroot\webphotos"
Upload.OverwriteFiles = False
Upload.Save varUploadPath
For Each File in Upload.Files
File.Move LCase(Replace(File.Path, " ", "_"))
varGraphicName = Right(File.Path, Len(File.Path)-Len(varUploadPath))
For Each Item in Upload.Form
If Item.Name = "ID" then
varID = Item.Value
End If
Next
Set Image = Server.CreateObject("AspImage.Image")
Image.LoadImage File.Path
Image.FileName = File.Path
Image.SaveImage
Next
SQL = "UPDATE tblInstructors "
SQL = SQL & "SET Photo='" & varGraphicName & "' "
SQL = SQL & " WHERE ID=" & varID & ";"
Set RS = Conn.Execute(SQL)
If Err <> 0 Then
Response.Write "Error saving the file: " & Err.Description
Else
' File.Delete
Response.Redirect "admin_instructors.php"
End If
%>
<%
Sub ImageMaxSizeX (intXSize)
If Image.MaxX > intXSize then
intYSize = (intXSize / Image.MaxX) * Image.MaxY
Image.ResizeR intXSize, intYSize
End If
end sub
Sub ImageMaxSizeY (intYSize)
If Image.MaxY > intYSize then
intXSize = (intYSize / Image.MaxY) * Image.MaxX
Image.ResizeR intXSize, intYSize
End If
end sub
%>