
16/03/2006, 03:52
|
| | Fecha de Ingreso: octubre-2004
Mensajes: 230
Antigüedad: 20 años, 6 meses Puntos: 0 | |
Bueno hay va el código del Form
Código:
<FORM METHOD="POST" ACTION="update.asp" name="envio">
<input type="hidden" name="id" value="<%=adrecord.fields("numcur").value%>">
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr style="padding-left:10">
<td height="4" colspan="5" valign="top"></td>
</tr>
<tr style="padding-left:10">
<td height="15" valign="top" bgcolor="#d8eec5" class="e_azul">Nombre</td>
<td height="15" valign="top" colspan="4">
<input type="text" name="nombre" size="60" value="<%=rtrim(adrecord.fields("nomcur").value)%>">
</td>
</tr>
<tr style="padding-left:10">
<td width="90" height="15" valign="top" bgcolor="#d8eec5"class="e_azul">Tipo de Curso</td>
<td width="166" height="15" valign="top">
<select name="tipo" class="menutitle2">
<option value="1" <%if trim(adrecord.fields("tipcur").value)="1" then response.write("selected")%>>Desempleados</option>
<option value="2" <%if trim(adrecord.fields("tipcur").value)="2" then response.write("selected")%>>Trabajadores/Continua</option>
<option value="3" <%if trim(adrecord.fields("tipcur").value)="3" then response.write("selected")%>>Privados Empresas</option>
<option value="4" <%if trim(adrecord.fields("tipcur").value)="4" then response.write("selected")%>>Privado Particulares</option>
<option value="5" <%if trim(adrecord.fields("tipcur").value)="5" then response.write("selected")%>>Oracle University</option>
<option value="6" <%if trim(adrecord.fields("tipcur").value)="6" then response.write("selected")%>>E-Learning</option>
<!--<option value="7" <%'if trim(adrecord.fields("tipcur").value)="7" then response.write("selected")%>>A Distancia/Multimedia</option>-->
<option value="8" <%if trim(adrecord.fields("tipcur").value)="8" then response.write("selected")%>>Cámaras de Comercio</option>
<!--<option value="0" <%'if trim(adrecord.fields("tipcur").value)="0" then response.write("selected")%>>Certificacion Microsoft</option>-->
<option value="9" <%if trim(adrecord.fields("tipcur").value)="9" then response.write("selected")%>>Otros Cursos</option>
</select>
</td>
<td width="90" height="15" valign="top" bgcolor="#d8eec5" class="e_azul">Precio</td>
<td width="254" height="15" colspan="2" valign="top">
<input type="text" name="precio" value="<%=rtrim(adrecord.fields("precur").value)%>">
</td>
</tr>
<tr style="padding-left:10">
<td width="90" height="15" bgcolor="#d8eec5" class="e_azul" valign="top">Horas</td>
<td width="166" height="15" valign="top">
<input type="text" name="horas" size="9" value="<%=rtrim(adrecord.fields("horacur").value)%>">
</td>
<td width="90" height="15" valign="top" bgcolor="#d8eec5" class="e_azul">Horario</td>
<td width="254" height="15" colspan="2" valign="top">
<input type="text" name="horario" size="40" value="<%=rtrim(adrecord.fields("nhorcur").value)%>">
</td>
</tr>
<tr style="padding-left:10">
<td width="90" height="15" bgcolor="#d8eec5" class="e_azul" valign="top">Inicio</td>
<td width="166" height="15" valign="top">
<p><input type="text" name="inicio" size="10" value="<%=rtrim(adrecord.fields("finicur").value)%>">
(dd/mm/aaaa)</p>
</td>
<td width="90" height="15" valign="top" bgcolor="#d8eec5" class="e_azul">Finalizacion</td>
<td width="254" height="15" colspan="2" valign="top">
<p><input type="text" name="fin" size="10" value="<%=rtrim(adrecord.fields("ffincur").value)%>">
(dd/mm/aaaa)</p>
</td>
</tr>
<tr style="padding-left:10">
<td width="90" height="15" bgcolor="#d8eec5" class="e_azul" valign="top">Estado</td>
<td width="166" height="15" valign="top">
<select name="estado" class="menutitle2">
<option value="si" <%if trim(adrecord.fields("baja").value)="si" then response.write("selected")%>>De Baja</option>
<option value="" <%if trim(adrecord.fields("baja").value)="" then response.write("selected")%>>Activo</option>
</select>
</td>
<td width="90" height="15" valign="top" bgcolor="#d8eec5" class="e_azul">Direccion</td>
<td width="254" height="15" colspan="2" valign="top">
<select name="lugar" class="menutitle2">
<%
if session("callecita")="FORMA" then
cvalor1 = "miacademia1"
cvalor2 = "miacademia2"
cvalor3 = "miacademia3"
else
cvalor1 = "aca1"
cvalor2 = "aca2"
cvalor3 = "aca3"
end if
%>
<option value="<%=cvalor1%>"><%=cvalor1%></option>
<option value="<%=cvalor2%>"><%=cvalor2%></option>
<option value="<%=cvalor3%>"><%=cvalor3%></option>
</select>
</td>
</tr>
<tr style="padding-left:10">
<td width="90" valign="top" bgcolor="#d8eec5" class="e_azul">Temario</td>
<td colspan="4" valign="top">
<textarea name="temario" cols="40" rows="4"><%=rtrim(adrecord.fields("reqcur").value)%></textarea>
</td>
</tr>
<tr style="padding-left:10">
<td valign="top" bgcolor="#d8eec5" class="e_azul">Observaciones</td>
<td colspan="4" valign="top">
<textarea name="notas" cols="40" rows="4"><%=rtrim(adrecord.fields("notas").value)%></textarea>
</td>
</tr>
<tr style="padding-left:10">
<td valign="top" bgcolor="#d8eec5" class="e_azul">Situación</td>
<td valign="top" class="e_azul">
<select name="activo" class="menutitle2">
<option value="1" <%if trim(adrecord.fields("activ").value)="1" then response.write("selected")%>>Plazas libres</option>
<option value="2" <%if trim(adrecord.fields("activ").value)="2" then response.write("selected")%>>Completo</option>
<!--<option value="3" <%'if trim(adrecord.fields("activ").value)="3" then response.write("selected")%>>DESTACADO</option>
<option value="" <%'if trim(adrecord.fields("activ").value)="" then response.write("selected")%>>No determinado</option>-->
</select>
</td>
</tr>
<tr></tr>
<td colspan="3" valign="top" class="e_azul">
<div align="right">
<input name="Submit" type="submit" class="input_verde" value="Enviar" onClick="CloseRefreshWindow()">
<input name="Reset" type="reset" class="input_verde" value="ReestablecerDatos">
</div></td>
</tr>
<%
end if
%>
</table>
</FORM>
y este es el código del UPDATE
Código:
<%
Response.Buffer = True
Dim oConn,strSQL
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("Driver={Microsoft Visual FoxPro Driver};UID=;PWD=;SourceDB="+server.mappath("miruta")+";SourceType=DBC;Exclusive=No;BackgroundFetch=Sí;Collate=Machine;Null=Sí;Deleted=Sí;")
strSQL = "UPDATE base3000!cursos SET nomcur = '" & Request.form("nombre") & "',nhorcur = '" & Request.form("horario") & "',finicur = '" & Request.form("inicio") & "',ffincur = '" & Request.form("fin") & "',horacur = '" & Request.form("horas") & "',reqcur = '" & Replace(Request.form("temario"), "'", "''") & "',tipcur = '" & Request.form("tipo") & "',precur = '" & Request.form("precio") & "',numero = '" & Request.form("numero") & "',notas = '" & Replace(Request.form("notas"), "'", "''") & "',baja = '" & Request.form("estado") & "',activ = '" & Request.form("activo") & "' WHERE numcur = '" & Request.form("id") & "'"
oConn.Execute(strSQL)
oConn.Close
set oConn = nothing
Response.Redirect("relacioncursos.asp")
%>
|