%
if session("editor") = "" then
response.Redirect("index.asp")
end if
id = Trim(Request.QueryString("id"))
carpeta = Trim(Request.QueryString("carpeta"))
eliminar = Trim(Request.QueryString("eliminar"))
if id = "" then
response.Write("id: " & id & "
")
response.Write("No hay una noticia seleccionada")
response.Write("
Regresar")
response.End()
end if
eliminado = false
if eliminar = "si" then
foto = Trim(Request.QueryString("foto"))
dim fs, ruta
ruta = "C:\Inetpub\vhosts\sportstime.com.mx\httpdocs\web\imagenes\" & carpeta & "\" & foto
'response.Write(ruta)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(ruta) then
'fs.DeleteFile(ruta)
end if
set fs=nothing
eliminado = true
end if
inserta = Trim(Request.QueryString("inserta"))
if inserta = "si" then
Dim Upload
Dim FileName
Dim Folder
Dim Ext
Dim FileOK
Set Upload = New clsUpload
Ext = Upload.Fields("imagen").FileExt
Select Case Ext
Case "GIF", "BMP", "PNG", "JPG"
FileOK = True
Case Else
FileOK = False
End Select
If Not FileOK Then
Msg = "Extension Inválida!!!."
else
FileName = Upload.Fields("imagen").FileName
Folder = "C:\Inetpub\vhosts\sportstime.com.mx\httpdocs\web\imagenes\" & carpeta
Upload("imagen").SaveAs Folder & "\" & FileName
Set Upload = Nothing
Set DB = Server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.recordset")
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=C:\Inetpub\vhosts\sportstime.com.mx\httpdocs\db\" & DB_)
SQL = "UPDATE noticiasAtletas SET "
SQL = SQL & "foto = '" & Trim(FileName) & "' "
SQL = SQL & "WHERE id = " & id
set rs = DB.execute(SQL)
response.Write("Regresar | Seguir Modificando Nota")
response.End()
End If
end if
%>
|
<%
Set DB = Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject("ADODB.Recordset")
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=C:\Inetpub\vhosts\sportstime.com.mx\httpdocs\db\" & DB_)
if eliminado then
%>
Agrega la foto para la nota:
<%
else
SQL = "Select * From noticiasAtletas Where id = " & id
rs.open SQL,DB,3,3
if rs.recordcount = 0 then
%>
No hay registros!!!
<%
else
%>
La imagen actual es: <%= rs.fields("foto") %>
&carpeta=<%= carpeta %>&id=<%= id %>">Cambiar | Cancelar <% end if end if %> |