<%@ LCID = 3082 %> <% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.addHeader "cache-control", "no-cache" Response.addHeader "cache-control", "no-store" Response.CacheControl = "no-cache" %> <% ewCurSec = 0 ' Initialise ' User levels Const ewAllowAdd = 1 Const ewAllowDelete = 2 Const ewAllowEdit = 4 Const ewAllowView = 8 Const ewAllowList = 8 Const ewAllowReport = 8 Const ewAllowSearch = 8 Const ewAllowAdmin = 16 %> <% ' Initialize common variables x_idreferencia = Null: ox_idreferencia = Null x_FECHA = Null: ox_FECHA = Null x_NOMBRE = Null: ox_NOMBRE = Null x_DIRECCION = Null: ox_DIRECCION = Null x_POBLACION = Null: ox_POBLACION = Null x_TELEFONO = Null: ox_TELEFONO = Null x_EMAIL = Null: ox_EMAIL = Null x_TITULOS = Null: ox_TITULOS = Null x_IDIOMAS = Null: ox_IDIOMAS = Null x_NIVELES = Null: ox_NIVELES = Null x_CARNET = Null: ox_CARNET = Null x_EDAD = Null: ox_EDAD = Null x_SEXO = Null: ox_SEXO = Null x_ESTADO = Null: ox_ESTADO = Null x_VEHICULO = Null: ox_VEHICULO = Null x_TRABAJOS = Null: ox_TRABAJOS = Null x_COMENTARIO = Null: ox_COMENTARIO = Null %> <% Response.Buffer = True ' Load key from QueryString bCopy = True x_idreferencia = Request.QueryString("idreferencia") If x_idreferencia = "" Or IsNull(x_idreferencia) Then bCopy = False End If ' Get action sAction = Request.Form("a_add") If (sAction = "" Or IsNull(sAction)) Then If bCopy Then sAction = "C" ' Copy record Else sAction = "I" ' Display blank record End If Else ' Get fields from form x_idreferencia = Request.Form("x_idreferencia") x_FECHA = Request.Form("x_FECHA") x_NOMBRE = Request.Form("x_NOMBRE") x_DIRECCION = Request.Form("x_DIRECCION") x_POBLACION = Request.Form("x_POBLACION") x_TELEFONO = Request.Form("x_TELEFONO") x_EMAIL = Request.Form("x_EMAIL") x_TITULOS = Request.Form("x_TITULOS") x_IDIOMAS = Request.Form("x_IDIOMAS") x_NIVELES = Request.Form("x_NIVELES") x_CARNET = Request.Form("x_CARNET") x_EDAD = Request.Form("x_EDAD") x_SEXO = Request.Form("x_SEXO") x_ESTADO = Request.Form("x_ESTADO") x_VEHICULO = Request.Form("x_VEHICULO") x_TRABAJOS = Request.Form("x_TRABAJOS") x_COMENTARIO = Request.Form("x_COMENTARIO") End If ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str Select Case sAction Case "C": ' Get a record to display If Not LoadData() Then ' Load Record based on key Session("ewmsg") = "No se han encontrado registros" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "deem.asp" End If Case "A": ' Add If AddData() Then ' Add New Record Session("ewmsg") = "Nuevo Registro Aņadido Satisfactoriamente" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "deem.asp" Else End If End Select %>

Demandas de Empleo

Volver al Listado

Fecha  Elige una Fecha
Nombre ">
Direccón ">
Población ">
Teléfono ">
E-Mail ">
Formación academica ">
Idiomas ">
Nivel / Experiencia ">
Carnet de conducir ">
Edad ">
Sexo <% x_SEXOList = "" Response.Write x_SEXOList %>
Estado civil ">
Vehiculo propio ">
Trabajos realizados ">
Comentario

<% conn.Close ' Close Connection Set conn = Nothing %> <% '------------------------------------------------------------------------------- ' Function LoadData ' - Load Data based on Key Value ' - Variables setup: field variables Function LoadData() Dim sSql, rs, sWhere, sGroupBy, sHaving, sOrderBy sSql = "SELECT * FROM `demandasempleo`" sWhere = "" sGroupBy = "" sHaving = "" sOrderBy = "" If sWhere <> "" Then sWhere = sWhere & " AND " sWhere = sWhere & "(`idreferencia` = " & AdjustSql(x_idreferencia) & ")" sSql = sSql & " WHERE " & sWhere If sGroupBy <> "" Then sSql = sSql & " GROUP BY " & sGroupBy End If If sHaving <> "" Then sSql = sSql & " HAVING " & sHaving End If If sOrderBy <> "" Then sSql = sSql & " ORDER BY " & sOrderBy End If Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSql, conn If rs.Eof Then LoadData = False Else LoadData = True rs.MoveFirst ' Get the field contents x_idreferencia = rs("idreferencia") x_FECHA = rs("FECHA") x_NOMBRE = rs("NOMBRE") x_DIRECCION = rs("DIRECCION") x_POBLACION = rs("POBLACION") x_TELEFONO = rs("TELEFONO") x_EMAIL = rs("EMAIL") x_TITULOS = rs("TITULOS") x_IDIOMAS = rs("IDIOMAS") x_NIVELES = rs("NIVELES") x_CARNET = rs("CARNET") x_EDAD = rs("EDAD") x_SEXO = rs("SEXO") x_ESTADO = rs("ESTADO") x_VEHICULO = rs("VEHICULO") x_TRABAJOS = rs("TRABAJOS") x_COMENTARIO = rs("COMENTARIO") End If rs.Close Set rs = Nothing End Function %> <% '------------------------------------------------------------------------------- ' Function AddData ' - Add Data ' - Variables used: field variables Function AddData() Dim sSql, rs, sWhere, sGroupBy, sHaving, sOrderBy Dim bCheckKey, sSqlChk, sWhereChk sSql = "SELECT * FROM `demandasempleo`" sWhere = "" sGroupBy = "" sHaving = "" sOrderBy = "" ' Check for duplicate key bCheckKey = True sWhereChk = sWhere If x_idreferencia = "" Or IsNull(x_idreferencia) Then bCheckKey = False Else If sWhereChk <> "" Then sWhereChk = sWhereChk & " AND " sWhereChk = sWhereChk & "(`idreferencia` = " & AdjustSql(x_idreferencia) & ")" End If If bCheckKey Then sSqlChk = sSql & " WHERE " & sWhereChk Set rsChk = conn.Execute(sSqlChk) If Not rsChk.Eof Then Session("ewmsg") = "" rsChk.Close Set rsChk = Nothing AddData = False Exit Function End If rsChk.Close Set rsChk = Nothing End If ' Add New Record If sWhere <> "" Then sWhere = sWhere & " AND " sWhere = sWhere & "(0 = 1)" sSql = sSql & " WHERE " & sWhere If sGroupBy <> "" Then sSql = sSql & " GROUP BY " & sGroupBy End If If sHaving <> "" Then sSql = sSql & " HAVING " & sHaving End If If sOrderBy <> "" Then sSql = sSql & " ORDER BY " & sOrderBy End If Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = 3 rs.Open sSql, conn, 1, 2 rs.AddNew ' Field FECHA sTmp = EW_UnFormatDateTime(x_FECHA,7) If IsDate(sTmp) Then rs("FECHA") = CDate(sTmp) Else rs("FECHA") = Null End If ' Field NOMBRE sTmp = Trim(x_NOMBRE) If Trim(sTmp) = "" Then sTmp = Null rs("NOMBRE") = sTmp ' Field DIRECCION sTmp = Trim(x_DIRECCION) If Trim(sTmp) = "" Then sTmp = Null rs("DIRECCION") = sTmp ' Field POBLACION sTmp = Trim(x_POBLACION) If Trim(sTmp) = "" Then sTmp = Null rs("POBLACION") = sTmp ' Field TELEFONO sTmp = Trim(x_TELEFONO) If Trim(sTmp) = "" Then sTmp = Null rs("TELEFONO") = sTmp ' Field EMAIL sTmp = Trim(x_EMAIL) If Trim(sTmp) = "" Then sTmp = Null rs("EMAIL") = sTmp ' Field TITULOS sTmp = Trim(x_TITULOS) If Trim(sTmp) = "" Then sTmp = Null rs("TITULOS") = sTmp ' Field IDIOMAS sTmp = Trim(x_IDIOMAS) If Trim(sTmp) = "" Then sTmp = Null rs("IDIOMAS") = sTmp ' Field NIVELES sTmp = Trim(x_NIVELES) If Trim(sTmp) = "" Then sTmp = Null rs("NIVELES") = sTmp ' Field CARNET sTmp = Trim(x_CARNET) If Trim(sTmp) = "" Then sTmp = Null rs("CARNET") = sTmp ' Field EDAD sTmp = Trim(x_EDAD) If Trim(sTmp) = "" Then sTmp = Null rs("EDAD") = sTmp ' Field SEXO sTmp = Trim(x_SEXO) If Trim(sTmp) = "" Then sTmp = Null rs("SEXO") = sTmp ' Field ESTADO sTmp = Trim(x_ESTADO) If Trim(sTmp) = "" Then sTmp = Null rs("ESTADO") = sTmp ' Field VEHICULO sTmp = Trim(x_VEHICULO) If Trim(sTmp) = "" Then sTmp = Null rs("VEHICULO") = sTmp ' Field TRABAJOS sTmp = Trim(x_TRABAJOS) If Trim(sTmp) = "" Then sTmp = Null rs("TRABAJOS") = sTmp ' Field COMENTARIO sTmp = Trim(x_COMENTARIO) If Trim(sTmp) = "" Then sTmp = Null rs("COMENTARIO") = sTmp rs.Update rs.Close Set rs = Nothing AddData = True End Function %>