|
<%
Flag = request.form("Flag")
If IsEmpty(Flag) or Flag = "" then
%>
Rellena el Formulario de Inscripción
Atención: * Indica un campo necesario.
Tus datos seran enviados a la Oficina de la asociación y en breve tendras una respuesta.
<%
End If
If Flag = 1 then
If IsEmpty(request.form("Nombre")) or request.form("Nombre")="" then
response.write ""
response.write " Debes escribir un Nombre. "
response.write ""
response.end
Else
Nombre = request.form("Nombre")
End If
If IsEmpty(request.form("Direccion")) or request.form("Direccion")="" then
response.write ""
response.write " Debes escribir una Direccion. "
response.write ""
response.end
Else
Direccion = request.form("Direccion")
End If
If IsEmpty(request.form("CP")) or request.form("CP")="" then
response.write ""
response.write " Debes escribir un Codigo Postal. "
response.write ""
response.end
Else
CP = request.form("CP")
End If
If IsEmpty(request.form("Ciudad")) or request.form("Ciudad")="" then
response.write ""
response.write " Debes escribir una Ciudad. "
response.write ""
response.end
Else
Ciudad = request.form("Ciudad")
End If
If IsEmpty(request.form("Gremio")) or request.form("Gremio")="" then
response.write ""
response.write " Debes escribir un Gremio. "
response.write ""
response.end
Else
Gremio = request.form("Gremio")
End If
If IsEmpty(request.form("Taller")) or request.form("Taller")="" then
response.write ""
response.write " Debes escribir un Taller."
response.write " "
response.end
Else
Taller = request.form("Taller")
End If
If IsEmpty(request.form("Telefono")) or request.form("Telefono")="" then
response.write ""
response.write " Debes escribir un Telefono."
response.write " "
response.end
Else
Telefono = request.form("Telefono")
End If
email = request.form("email")
If request.form("URL")="http://" then
URL = ""
Else
URL = request.form("URL")
End If
If IsEmpty(request.form("Comentarios")) or request.form("Comentarios")="" or request.form("Comments")=" " then
response.write ""
response.write " No olvides tus comentarios!"
response.write " "
response.end
Else
Comentarios = request.form("Comentarios")
Comentarios = Replace(Comentarios, Chr(34), "''")
Comentarios = Replace(Comentarios, vbCrLf, " ")
End If
Flag = request.form("Flag")
%>
Aquí esta la información que estas enviando. Si quieres hacer cambios
usa el botón apropiado abajo, o usa el otro botón para enviar esta
entrada como está.
Nombre: <%= Nombre %>
Dirección: <%= Direccion %>
CP: <%= CP %>
Ciudad: <%= Ciudad %>
Gremio: <%= Gremio %>
Taller: <%= Taller %>
Teléfono: <%= Telefono %>
e-mail: <%= email %>
URL: <%= URL %>
Comentarios: <%= Comentarios %>
|
<%
End If
If Flag = 2 then
Today = Now()
Nombre = request.form("Nombre")
Nombre = Replace(Nombre, "'", "''")
Nombre = Replace(Nombre, Chr(34), "''")
Direccion = request.form("Direccion")
Direccion = Replace(Direccion, "'", "''")
CP = request.form("CP")
CP = Replace(CP, "'", "''")
Ciudad = request.form("Ciudad")
Ciudad = Replace(Ciudad, "'", "''")
Gremio = request.form("Gremio")
Gremio = Replace(Gremio, "'", "''")
Taller = request.form("Taller")
Taller = Replace(Taller, "'", "''")
Telefono = request.form("Telefono")
Telefono = Replace(Telefono, "'", "''")
email = request.form("email")
URL = request.form("URL")
Comentarios = request.form("Comentarios")
Comentarios = Replace(Comentarios, "'", "''")
' ok now we've got our data so let's ship it off to the database
set conn = server.createobject("adodb.connection")
' **** change DSN name if you're using a DSN and you've named it differently
'conn.open "guestbook"
' **** DSN-less connection: comment out above line and uncomment the
' **** Code between "Begin" and "End"
' **** BEGIN DSN-LESS CONNECTION CODE
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("/Oficina/Unete/Unete.mdb")
conn.Open DSNtemp
' **** END OF DSN-LESS CONNECTION CODE
' **** Note: If using a DSN-less connection, make sure to change server.mappath above to
' **** reflect the actual location of the guestbook database file.
' **** The above will work if the database file is at the webserver root.
' **** See readme.txt for further information
' **** the following line would be used ONLY if you use a system DSN!
' conn.Open "guestbook"
SQLstmt = "INSERT INTO Unete (Nombre,Direccion,CP,Ciudad,Gremio,Taller,Telefono,email,URL,Comentarios)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & Nombre & "',"
SQLstmt = SQLstmt & "'" & Direccion & "',"
SQLstmt = SQLstmt & "'" & CP & "',"
SQLstmt = SQLstmt & "'" & Ciudad & "',"
SQLstmt = SQLstmt & "'" & Gremio & "',"
SQLstmt = SQLstmt & "'" & Taller & "',"
SQLstmt = SQLstmt & "'" & Telefono & "',"
SQLstmt = SQLstmt & "'" & email & "',"
SQLstmt = SQLstmt & "'" & URL & "',"
SQLstmt = SQLstmt & "'" & Comentarios & "'"
SQLstmt = SQLstmt & ")"
Set RS = conn.execute(SQLstmt)
If err.number>0 then
response.write "VBScript Errors Occured:" & ""
response.write "Error Number=" & err.number & " "
response.write "Error Descr.=" & err.description & " "
response.write "Help Context=" & err.helpcontext & " "
response.write "Help Path=" & err.helppath & " "
response.write "Native Error=" & err.nativeerror & " "
response.write "Source=" & err.source & " "
response.write "SQLState=" & err.sqlstate & " "
end if
IF conn.errors.count> 0 then
response.write "Database Errors Occured" & " "
response.write SQLstmt & " "
for counter= 0 to conn.errors.count
response.write "Error #" & conn.errors(counter).number & " "
response.write "Error desc. -> " & conn.errors(counter).description & " "
next
else
response.write "
"
response.write "¡Gracias! Tu mensage ha sido enviado. Nos pondremos en contacto contigo lo antes posible. "
response.write ""
response.write "Volver a Oficina"
end if
Conn.Close
Set conn = nothing
' *****************************************************************
' The following section of code sends email to the guestbook owner
' when somebody signs the guestbook. If you don't want this feature,
' just remove this block. Please note that this will ONLY work on
' NT SERVER with built-in SMTP!! On other systems, please see
' http://www.attitude.com/users/kathi/asp/tools.html for a list of
' components, including email components
' ******************************************************************
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtp.saasturias.com"
'next line is optional, default value is 25. Uncomment to enable
'Mail.Port = 25
' get the sender's address, and if empty, put your own
If request("Email")="" then
Sender = "asociacion@saasturias.com" ' put your email address here
Else
Sender = request("Email")
End If
Mail.From = Sender
Mail.AddAddress "asociacion@saasturias.com" ' put YOUR email address here
Mail.Subject = "Alguien esta interesado en unirse al Sindicato" ' you can change this to whatever you'd like
Msg = "Nombre: " & request("nombre") & Chr(10)
Msg = Msg & "Direccion: " & request("direccion") & Chr(10)
Msg = Msg & "CP: " & request("CP") & Chr(10)
Msg = Msg & "Ciudad: " & request("ciudad") & Chr(10)
Msg = Msg & "Gremio: " & request("gremio") & Chr(10)
Msg = Msg & "Taller: " & request("taller") & Chr(10)
Msg = Msg & "Telefono: " & request("telefono") & Chr(10)
Msg = Msg & "email: " & email & Chr(10)
Msg = Msg & "URL: " & URL & Chr(10)
Msg = Msg & "Comentarios:" & Chr(10)
Msg = Msg & request("Comentarios")
Mail.Body = Msg
On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description
End If
Set Mail = Nothing
End If
%>
|
 |
|