%
if session("autorizado") = "" then
response.Redirect("index.asp")
end if
guardar=request.QueryString("guardar")
primer=request.Form("primer")
carpeta=request.QueryString("carpeta")
Set DB = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.RecordSet")
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath("../../db/_spmdb.mdb"))
SQL = "select * from atletas where carpeta = '" & carpeta & "'"
rs.open SQL, DB, 3, 3
atleta = rs.fields("atleta")
rs.close
DB.close
if carpeta = "" then
response.Redirect("_atletaLista.asp")
end if
if primer = "si" then
primer = true
end if
if primer = "no" then
primer = false
end if
titulo=request.Form("titulo")
fecha=request.Form("fecha")
introduccion=request.Form("introduccion")
foto=request.Form("foto")
pie=request.Form("pie")
nota=request.Form("nota")
primer_ni=request.Form("primer")
if guardar = "si" then
if titulo="" then
errText = "- Falta el titulo.
"
guardar = "no"
end if
if fecha="" or fecha = "dd/mm/aaaa" then
errText = errText & "- Falta la fecha.
"
guardar = "no"
end if
if introduccion="" then
errText = errText & "- Falta introduccion.
"
guardar = "no"
end if
if foto="" then
errText = errText & "- Falta foto.
"
guardar = "no"
end if
if pie="" then
errText = errText & "- Falta pie de foto.
"
guardar = "no"
end if
if nota="" then
errText = errText & "- Falta nota.
"
guardar = "no"
end if
end if
if guardar = "si" then
Set DB = Server.CreateObject("ADODB.Connection")
Set rs1 = Server.CreateObject("ADODB.RecordSet")
Set rs2 = Server.CreateObject("ADODB.RecordSet")
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath("../../db/_spmdb.mdb"))
if primer = true then
SQL ="Update noticiasAtletas Set principal=false where principal=true and carpeta = '" & carpeta & "'"
set rs1 = DB.Execute(SQL)
end if
SQL ="select * from noticiasAtletas"
rs1.Open SQL,db,1,2
rs1.AddNew
rs1("carpeta") = carpeta
rs1("titulo") = titulo
rs1("fecha") = fecha
rs1("introduccion") = introduccion
rs1("nota") = nota
rs1("foto") = foto
rs1("pie") = pie
rs1("principal") = primer
rs1("status") = "A"
rs1("fechahora") = now
rs1.Update
titulo=""
fecha=""
introduccion=""
foto=""
foto_thumb=""
pie=""
nota=""
rs1.close
end if
%>