Formulario

Hola, gracias por tu tiempo
Mi problema es que tengo una página web (.htm) hecha con un formulario en dreamweaver, pero no sé cómo hacer para que cuando le des click al botón de "enviar" me llegue la información a una base de datos o en el peor de los casos a un correo (no quisiera con el outlook), sino que llegue a algún lugar yver todo ordenado, me puedes ayudar por favor, no se mucho de esto y si me explicas bien lo lograré.
Gracias

1 Respuesta

Respuesta
1
Comensemos por ver que es lo que tiene el código de la página HTML creada con el dreamweaver para ver que tipo de botón le colocas para en submit o la característica de la misma, ya que el insertar los datos a una base de datos o enviar el correo no es muy difícil, todo depende lo que tengas instalado en el servidor donde funcionará tu página.
te envio mi código:
igual puedes verlo en:
http://www.kingspanama.com/Cont%C3%A1ctenos.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><!-- InstanceBegin template="/Templates/Kings.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Contáctenos</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<script type="text/javascript" language="JavaScript1.2" src="stm31.js"></script>
<script language="javascript">
function click() {
if (event.button==2) {
alert('DERECHOS RESERVADOS - THE KING´S SCHOOL')
}
}
document.onmousedown=click
<!-- For this and 100s of other Free Javascripts, check out: -->
<!-- Free-Javascripts.com @ http://www.free-javascripts.com/ -->
<!-- hide from old browsers
var init_msg = "The King´s School ."
var str = ""
var msg = ""
var leftmsg = ""
function setMessage()
{
if (msg == "")
{
str = " "
msg = init_msg
leftmsg = ""
}
if (str.length == 1)
{
while (msg.substring(0, 1) == " ")
{
leftmsg = leftmsg + str
str = msg.substring(0, 1)
msg = msg.substring(1, msg.length)
}
leftmsg = leftmsg + str
str = msg.substring(0, 1)
msg = msg.substring(1, msg.length)
for (var ii = 0; ii < 120; ii++)
{str = " " + str}
}
else
{
str = str.substring(10, str.length) // decrease str little by little
}
window.status = leftmsg + str
JSCTimeOutID = window.setTimeout('setMessage()',30)
}
<!-- done hiding -->
</script>
</head>
<body link="#0033CC" alink="#9999CC" onmousedown=click onload="JSCTimeOutID = window.setTimeout('setMessage()',500);">
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="470" valign="top"><table width="740" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><div align="left">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="738" height="125">
<param name="movie" value="Flash-Kings.swf">
<param name="quality" value="high">
<embed src="Flash-Kings.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="738" height="125"></embed></object>
</div></td>
</tr>
<tr>
<td width="17" align="center" valign="top" bgcolor="#9999CC"> <div align="justify">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="155" height="75">
<param name="movie" value="Matr%EDculas.swf">
<param name="quality" value="high">
<embed src="Matr%EDculas.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="155" height="75"></embed></object>
<script id="Sothink Widgets:Plantilla-Kings.pgt" type="text/javascript" language="JavaScript1.2">
<!--
stm_bm(["menu3608",400,"","blank.gif",0,"","",0,0,250,0,50,0,0,0,""],this);
stm_bp("p0",[1,4,0,0,0,5,0,7,100,"progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,enabled=0,Duration=0.35)",-2,"",-2,75,0,0,"#ffffff","transparent","",3,0,0,"#660000 #660000 #660000 #999999"]);
stm_ai("p0i0",[6,3,"#000000","",0,0,0]);
stm_ai("p0i1",[0,"Bienvenidos","","",-1,-1,0,"Bienvenidos.htm","_self","","Bienvenida","","",0,0,0,"","",0,0,0,0,1,"#9999cc",0,"#9966cc",0,"","",3,3,0,0,"#0099cc","#000000","#ffffff","#ffffff","bold 9pt Arial","10pt Arial",0,0]);
stm_aix("p0i2","p0i0",[]);
stm_aix("p0i3","p0i1",[0,"Nuestro Colegio","","",-1,-1,0,"Nuestro%20Colegio.htm","_self","","Generalidades","","",0,0,0,"","",0,0,0,0,1,"#9999cc",0,"#9966cc",0,"","",2]);
stm_aix("p0i4","p0i0",[]);
stm_aix("p0i5","p0i1",[0,"Principios y Propósitos","","",-1,-1,0,"Principios%20y%20Propósitos.htm","_self","","Nuestra ética","","",0,0,0,"","",0,0,0,0,1,"#9999cc",0,"#9966cc",0,"","",3,3,0,0,"#999900","#999900","#ffffff","#ffffff","bold 9pt Arial","9pt Arial"]);
stm_aix("p0i6","p0i0",[]);
stm_aix("p0i7","p0i5",[0,"Instalaciones","","",-1,-1,0,"Instalaciones.htm","_self","","Conozca las instalaciones"]);
stm_aix("p0i8","p0i0",[]);
stm_aix("p0i9","p0i5",[0,"Maternal","","",-1,-1,0,"Maternal.htm","_self","","Nuestro Maternal"]);
stm_aix("p0i10","p0i0",[]);
stm_aix("p0i11","p0i1",[0,"Pre-Kinder y Kinder","","",-1,-1,0,"Pre-Kinder%20y%20Kinder.htm","_self","","Nuestro Kinder y Prekinder","","",0,0,0,"","",0,0,0,0,1,"#9999cc",0,"#9966cc",0,"","",2,3,0,0,"#999900","#999900"]);
stm_aix("p0i12","p0i0",[]);
stm_aix("p0i13","p0i5",[0,"Primaria","","",-1,-1,0,"Primaria.htm","_self","","Nuestra Primaria","","",0,0,0,"","",0,0,0,0,1,"#9999cc",0,"#9966cc",0,"","",3,3,0,0,"#489ec9","#000000"]);
stm_aix("p0i14","p0i0",[]);
stm_aix("p0i15","p0i13",[0,"Secundaria","","",-1,-1,0,"Secundaria.htm","_self","","Nuestra Secundaria"]);
stm_aix("p0i16","p0i0",[]);
stm_aix("p0i17","p0i13",[0,"Act. Extracurriculares","","",-1,-1,0,"Actividades%20Extracurriculares.htm","_self","","Actividades Extracurriculares"]);
stm_aix("p0i18","p0i0",[]);
stm_aix("p0i19","p0i13",[0,"Condiciones de Ingreso","","",-1,-1,0,"Condiciones%20de%20Ingreso.htm","_self","","Requisitos de Ingreso","","",0,0,0,"","",0,0,0,0,1,"#9999cc",0,"#9966cc",0,"","",3,3,0,0,"#0099cc"]);
stm_aix("p0i20","p0i0",[]);
stm_aix("p0i21","p0i13",[0,"Costos","","",-1,-1,0,"","_self","","","","",0,0,0,"arrow_w.gif","arrow_r.gif",7,7]);
stm_bp("p1",[1,2,0,0,0,4,0,0,100,"progid:DXImageTransform.Microsoft.Iris(irisStyle=star,motion=in,enabled=0,Duration=0.54)",-2,"progid:DXImageTransform.Microsoft.Iris(irisStyle=star,motion=out,enabled=0,Duration=0.54)",-2,56,0,0,"#7f7f7f","#ffffff","",3,0,0,"#000000"]);
stm_aix("p1i0","p0i5",[0,"Maternal","","",-1,-1,0,"Costos%20de%20Maternal.htm","_blank","","","","",0,0,0,"","",0,0,0,0,1,"#9966cc",0,"#333333",0,"","",3,3,0,0,"#d6d6ce","#d6d6ce","#ffffff","#ffffff","9pt Arial"]);
stm_aix("p1i1","p1i0",[0,"Pre-Kinder y Kinder","","",-1,-1,0,"Costos%20de%20Pre-Kinder%20y%20Kinder.htm"]);
stm_aix("p1i2","p1i0",[0,"Primaria","","",-1,-1,0,"Costos%20de%20Primaria.htm"]);
stm_aix("p1i3","p1i0",[0,"Secundaria","","",-1,-1,0,"Costos%20de%20Secundaria.htm"]);
stm_ep();
stm_aix("p0i22","p0i0",[]);
stm_aix("p0i23","p0i13",[0,"King´s On Line","","",-1,-1,0,"King´s%20on%20line.htm","_self","","Consulte en línea"]);
stm_aix("p0i24","p0i0",[]);
stm_aix("p0i25","p0i13",[0,"Rincón del Estudiante","","",-1,-1,0,"Rincón%20del%20Estudiante.htm","_self","","Experiencias Estudiantiles"]);
stm_aix("p0i26","p0i0",[]);
stm_aix("p0i27","p0i13",[0,"Contáctenos","","",-1,-1,0,"Contáctenos.htm","_self","","Enviénos sus comentarios o inquietudes"]);
stm_aix("p0i28","p0i0",[]);
stm_ep();
stm_em();
//-->
</script>
<br>
</div></td>
<td width="6"> </td>
<td width="1459" valign="top"><!-- InstanceBeginEditable name="Flash-Secundario" -->
<div align="justify">
<p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="575" height="40">
<param name="movie" value="Cont%E1ctenos.swf">
<param name="quality" value="high">
<embed src="Cont%E1ctenos.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="575" height="40"></embed></object>
<br>
<font color="#000000" size="3" face="Arial, Helvetica, sans-serif"></font></p>
<p><font color="#000000" size="3" face="Arial, Helvetica, sans-serif"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Por
favor envíenos sus comentarios o sugerencias</font></strong></font></p>
<p align="center"><strong><font color="#9999CC" size="6" face="Garamond"></font></strong></p>
<form action="procesando.asp" method="get" enctype="text/plain" name="Datos" target="_self" id="Datos">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="31%"><div align="left"><font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Nombre:</font></strong></font></div></td>
<td width="69%"><div align="left">
<input name="Nombre" type="text" id="Nombre" size="20" maxlength="10">
</div></td>
</tr>
<tr>
<td><div align="left"><font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
Apellidos:</font></strong></font></div></td>
<td><div align="left">
<input name="Apellidos" type="text" id="Apellidos" size="20" maxlength="25">
</div></td>
</tr>
<tr>
<td><div align="left"><font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
Correo Electrónico:</font></strong></font></div></td>
<td><div align="left">
<input name="Email" type="text" id="Email" size="20" maxlength="25">
</div></td>
</tr>
<tr>
<td><div align="left"><font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
Ciudad:</font></strong></font></div></td>
<td><div align="left">
<input name="Ciudad" type="text" id="Ciudad" size="20" maxlength="10">
</div></td>
</tr>
<tr>
<td><div align="left"><font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
País:</font></strong></font></div></td>
<td><div align="left">
<input name="País" type="text" id="País" size="20" maxlength="10">
</div></td>
</tr>
<tr>
<td valign="top"><font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
Comentarios y Preguntas:</font></strong></font></td>
<td><br>
<textarea name="Preguntas" cols="40" rows="10" wrap="VIRTUAL" id="Preguntas"></textarea>
</td>
</tr>
<tr>
<td valign="top"><div align="left"><font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<br>
</font></strong></font></div></td>
<td><div align="left"> <font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></strong></font>
<input type="reset" name="Reset" value="Borrar">
<font color="#000000"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="Enviar" type="submit" id="Enviar2" value="Enviar">
</font></strong></font> <br>
</div></td>
</tr>
</table>
</form>
</div>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#9999CC"><!-- InstanceBeginEditable name="EditRegion3" -->
<div align="justify"></div>
<!-- InstanceEndEditable --></td>
<td> </td>
<td align="center" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<hr align="center">
<strong><font color="#0033CC" size="4" face="UnivrstyRoman BT">The
King´s School</font><font size="2" face="Georgia, Times New Roman, Times, serif"><br>
</font></strong><font size="2" face="Georgia, Times New Roman, Times, serif"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">P.O.
Box 6-894 - Estafeta El Dorado<br>
Panamá, República de Panamá<br>
<a href="mailto:[email protected]">[email protected]</a></font></font></td>
</tr>
</table></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
Checa el siguiente código que te puede ayudar a lo que requieres y mil disculpas por la tardanza pero he tenido exceso de trabajo.
<html>
<!-- Generated by AceHTML Freeware http://freeware.acehtml.com -->
<!-- Creation date: 01/06/2003 -->
<!-- Autor: David René Enciso Badillo -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Página en Construcción</title>
<meta name="description" content="Página en Construcción">
<meta name="keywords" content="Construcción">
<meta name="author" content="David René Enciso Badillo">
<meta name="generator" content="AceHTML 5 Freeware">
<link href="include/styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- <table>
<tr>
<td align="center" valign="top">
<p align="center"><b> Página en Construcción </b></p>
<br>
<br>
<br>
</td>
</tr>
<tr>
<td align="right" valign="top" width="20%">
<p align="center"> <img border="0" src="images/underconstruction.gif" width="150" height="135"></p>
</td>
</tr>
</table>-->
<%
Dim vstrPlanta
Dim vstrOpcion
Dim vstrFecha
Dim vstrNombre
Dim vstrContador
Dim vstrApoyo
Dim vstrProductoApoyo
Dim vstrLineadeApoyo
Dim vstrColumnasTotales
Dim vstrVectorHoras
Dim bNoExistenDatos
Dim vstrCuantasHoras
Dim vstrOrigen
Dim vstrDestino
Dim vstrCuantosProductos
vstrOrigen = request.form("ClaveProducto")
vstrDestino = request.form("cmbPlanta")
strConnect = "SERVER=" & Session("Servidor") & ";DRIVER={SQL Server};DATABASE=DBMerlin;"
strConnect = strConnect & "UID=" & Session("UsuarioBase") &";"
strConnect = strConnect & "pwd=" & Session("PasswordBase") & ";"
' strConnect = "SERVER=dadi;DRIVER={SQL Server};DATABASE=DBMerlin;UID=sa;pwd=;"
On Error Resume Next
Set objCn = Server.CreateObject("ADODB.Connection")
objCn.open strConnect
if not objCn.State = 1 then
' No se tiene una Conexiòn
Session("Aceptado")= "NO"
Response.Redirect "abordo1.asp"
end if
' response.write request.form("cmbPlanta")
%>
<!-- <br>-->
<%
' response.write request.form("input1")
%>
<!-- <br>-->
<%
' response.write request.form("ClaveProducto")
' con los datos anteriores se procede a realizar la búsqueda
vstrFecha = request.form("input1")
' para saber si es día festivo
sQuery ="SELECT * "
sQuery = sQuery & " FROM tbDias_Festivos "
sQuery = sQuery & " WHERE Date = CONVERT(DATETIME,'" & request.form("input1") & "',103) "
sQuery = sQuery & " AND Cve_Planta IN (SELECT Cve_Planta FROM tbSKU_Cdna WHERE Cve_skucdna = " & request.form("cmbPlanta") & ")" '101)
' response.write squery
set objRegistro = objCn.Execute(sQuery)
' response.write objregistro.eof
if NOT objRegistro.eof then
objRegistro.Close
objCn.Close
set objRegistro = nothing
set objCn = nothing
Session("Message")="No existen Plantas, verifiquelo por favor..."
Response.Redirect "login.asp"
end if
' ' verificada la fecha se continua
' sQuery = "SELECT DISTINCT(tbSKU_Prod.Cve_skuprod),"
' sQuery = sQuery & " tbSKU_Prod.Desc_skuprod, "
' sQuery = sQuery & " Cri_Ord"
' sQuery = sQuery & " From tbSKU_Prod, "
' sQuery = sQuery & " tbAbordos "
' sQuery = sQuery & " Where tbSKU_Prod.Cve_skuprod = tbAbordos.Cve_skuprod "
' sQuery = sQuery & " AND tbAbordos.Cve_skucdna_origen = " & request.form("ClaveProducto") '101
' sQuery = sQuery & " AND tbAbordos.Cve_skucdna_destino = " & request.form("cmbPlanta") ' 1
' sQuery = sQuery & " AND tbAbordos.Fecha = CONVERT(DATETIME,'" & request.foresar' onclick='window.close()'>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.end
end if
vstrCuantasHoras = objRegistro.Fields(0)
vstrCuantosProductos = 0
sQuery = "SELECT distinct Cve_skuprod "
sQuery = sQuery & " From tbAbordos"
sQuery = sQuery & " Where Cve_skucdna_origen = " & request.form("ClaveProducto") '101
sQuery = sQuery & " AND Cve_skucdna_destino = " & request.form("cmbPlanta") ' 1
sQuery = sQuery & " AND Fecha = CONVERT(DATETIME,'" & request.form("input1") & "',103) "
set objRegistro = Nothing
set objRegistro = objCn.Execute(sQuery)
If NOT objRegistro.EOF Then
Do While NOT objRegistro.EOF
vstrCuantosProductos = vstrCuantosProductos + 1
objRegistro.MoveNext
Loop
bNoExistenDatos = False
Else
' no se localizaron productos en la primera búsqueda,
' esto indica que no se tienen datos capturados para la fecha de trabajo
bNoExistenDatos = True
sQuery = "SELECT tbSKU_PROD.*"
sQuery = sQuery & " FROM tbSKU_PROD,"
sQuery = sQuery & " tbSKU, "
sQuery = sQuery & " tbExporta"
sQuery = sQuery & " WHERE tbSKU_PROD.Cve_skuprod = tbSKU.Cve_skuprod"
sQuery = sQuery & " AND tbSKU_PROD.Cve_skuprod = tbExporta.Cve_skuprod"
sQuery = sQuery & " AND tbSKU.Cve_skucdna = " & request.form("cmbPlanta")
sQuery = sQuery & " AND tbExporta.Cve_skucdna_origen = " & request.form("ClaveProducto")
sQuery = sQuery & " AND tbExporta.Cve_skucdna_destino = " & request.form("cmbPlanta")
sQuery = sQuery & "ORDER BY Cri_Ord,tbSKU_Prod.Desc_skuprod"
set objRegistro = Nothing
set objRegistro = objCn.Execute(sQuery)
If NOT objRegistro.EOF Then
Do While NOT objRegistro.EOF
vstrCuantosProductos = vstrCuantosProductos + 1
objRegistro.MoveNext
Loop
End If
End If
set objRegistro = Nothing
' ya tenemos todo, podemos dibujar la tabla en la pantalla
%>
<form action="confirma.asp?Horas=<%= vstrCuantasHoras %>&Productos=<%= vstrCuantosProductos %>&Fecha=<%= vstrFecha %>&Origen=<%= vstrOrigen %>&Destino=<%= vstrDestino %>" method="post" name="captura" target="ventana3">
<table width="65%" border="1" align="center">
<tr>
<td width="150" class="tablafondoamarilloclaro">
<strong>
Fecha: <%=request.form("input1")%>
</strong>
</td>
<td width="150" class="tablafondoamarilloclaro">
<%
sQuery = "SELECT Desc_corta_cdna FROM tbSKU_CDNA WHERE (Cve_Planta <> 0 AND Cve_Bodega = 0) AND Cve_skucdna = " & request.form("cmbPlanta")
set objRegistro = Nothing
set objRegistro = objCn.Execute(sQuery)
if objRegistro.eof then
objRegistro.Close
objCn.Close
set objRegistro = nothing
set objCn = nothing
Session("Message")="No existen Plantas, verifiquelo por favor..."
Response.Write "<table align='center'>"
response.write "<tr>"
response.write "<td width='350' class='tablafondoamarillorojo' align='center'>"
Response.Write "<h4>No Existen Datos, verifique por favor su selección. Gracias</h4>"
response.write "<input type='button' value='Regresar' onclick='window.close()'>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.end
end if
%>
<strong>
Localidad: <%=objRegistro.Fields("Desc_corta_cdna")%>
</strong>
</td>
<td width="150" class="tablafondoamarilloclaro">
<%
sQuery = "SELECT Desc_corta_cdna FROM tbSKU_CDNA WHERE (Cve_Planta <> 0 AND Cve_Bodega = 0) AND Cve_skucdna = " & request.form("ClaveProducto")
set objRegistro = Nothing
set objRegistro = objCn.Execute(sQuery)
if objRegistro.eof then
objRegistro.Close
objCn.Close
set objRegistro = nothing
set objCn = nothing
Session("Message")="No existen Plantas, verifiquelo por favor..."
Response.Write "<table align='center'>"
response.write "<tr>"
response.write "<td width='350' class='tablafondoamarillorojo' align='center'>"
Response.Write "<h4>No Existen Datos, verifique por favor su selección. Gracias</h4>"
response.write "<input type='button' value='Regresar' onclick='window.close()'>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.end
end if
%>
<strong>
Localidad que surte: <%=objRegistro.Fields("Desc_corta_cdna")%>
</strong>
</td>
</tr>
</table>
<%
' aquí se leen las columnas
sQuery = "SELECT count(*) FROM tbCD_HorEmb WHERE Cve_skucdna = " & request.form("cmbPlanta")
set objRegistro = Nothing
set objRegistro = objCn.Execute(sQuery)
if objRegistro.eof then
objRegistro.Close
objCn.Close
set objRegistro = nothing
set objCn = nothing
Session("Message")="No existen Plantas, verifiquelo por favor..."
Response.Write "<table align='center'>"
response.write "<tr>"
response.write "<td width='350' class='tablafondoamarillorojo' align='center'>"
Response.Write "<h4>No Existen Datos, verifique por favor su selección. Gracias</h4>"
response.write "<input type='button' value='Regresar' onclick='window.close()'>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.end
end if
vstrContadorFechas = objRegistro.Fields(0)
vstrCuantasHoras = objRegistro.Fields(0)
Redim vstrVectorHoras(vstrContadorFechas,3)
' luego se traen las fechas
sQuery = "SELECT * FROM tbCD_HorEmb WHERE Cve_skucdna = " & request.form("cmbPlanta") & " ORDER BY HorEmb"
set objRegistro = Nothing
set objRegistro = objCn.Execute(sQuery)
if objRegistro.eof then
objRegistro.Close
objCn.Close
set objRegistro = nothing
set objCn = nothing
Session("Message")="No existen Plantas, verifiquelo por favor..."
Response.Write "<table align='center'>"
response.write "<tr>"
response.write "<td width='350' class='tablafondoamarillorojo' align='center'>"
Response.Write "<h4>No Existen Datos, verifique por favor su selección. Gracias</h4>"
response.write "<input type='button' value='Regresar' onclick='window.close()'>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.end
end if
vstrContadorHoras = 1
%>
<br>
<table id=project_table border=1 cellpadding="0" cellspacing="0" width="100%" align="center">
<TBODY>
<tr id=tr1 class="tablafondoazul" >
<td width="14%">
Productos
</td>
<%
Do While NOT objRegistro.EOF
%>
<td>
<%=objRegistro.Fields("HorEmb")%>
<input type="hidden" name="HoraMostrada" value="<%=Trim(objRegistro.Fields("HorEmb"))%>">
<%
vstrVectorHoras(vstrContadorHoras,1) = objRegistro.Fields("HorEmb")
vstrVectorHoras(vstrContadorHoras,2) = 0
vstrVectorHoras(vstrContadorHoras,3) = ""
vstrContadorHoras = vstrContadorHoras + 1
%>
</td>
<%
objRegistro.MoveNext
Loop
%>
</tr>
</TBODY>
<%
If bNoExistenDatos Then
sQuery = "SELECT tbSKU_PROD.*"
sQuery = sQuery & " FROM tbSKU_PROD,"
sQuery = sQuery & " tbSKU, "
sQuery = sQuery & " tbExporta"
sQuery = sQuery & " WHERE tbSKU_PROD.Cve_skuprod = tbSKU.Cve_skuprod"
sQuery = sQuery & " AND tbSKU_PROD.Cve_skuprod = tbExporta.Cve_skuprod"
sQuery = sQuery & " AND tbSKU.Cve_skucdna = " & request.form("cmbPlanta")
sQuery = sQuery & " AND tbExporta.Cve_skucdna_origen = " & request.form("ClaveProducto")
sQuery = sQuery & " AND tbExporta.Cve_skucdna_destino = " & request.form("cmbPlanta")
sQuery = sQuery & "ORDER BY Cri_Ord,tbSKU_Prod.Desc_skuprod"
set objRegistro = Nothing
set objRegistro = objCn.Execute(sQuery)
if objRegistro.eof then
objRegistro.Close
objCn.Close
set objRegistro = nothing
set objCn = nothing
Session("Message")="No existen Plantas, verifiquelo por favor..."
Response.Write "<table align='center'>"
response.write "<tr>"
response.write "<td width='350' class='tablafondoamarillorojo' align='center'>"
Response.Write "<h4>No Existen Datos, verifique por favor su selección. Gracias</h4>"
response.write "<input type='button' value='Regresar' onclick='window.close()'>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.end
end if
vstrProducto = 0
vstrProductoTemporal = ""
Do While NOT objRegistro.EOF
%>
<tr>
<td>
<%=objRegistro.Fields("Cve_skuprod")%>   <%=objRegistro.Fields("Desc_skuprod")%>
<input type="hidden" name="producto" value="<%=objRegistro.Fields("Cve_skuprod")%>">
</td>
<%
' se realiza un ciclo que recorre todos los valores de las horas
For vstrContadorHoras = 1 to Ubound(vstrVectorHoras)
vstrVectorHoras(vstrContadorHoras,2) = 0
%>
<td>
<input type="Text" name="valor" value="<%=vstrVectorHoras(vstrContadorHoras,2)%>">
</td>
<%
Next
%>
</tr>
<%
objRegistro.MoveNext
Loop
' siguiente bloque de datos
Else
' ahora se procesan los datos de los productos
sQuery = "SELECT tbAbordos.Cve_skuprod, "
sQuery = sQuery & " tbSKU_Prod.Desc_skuprod,"
sQuery = sQuery & " tbAbordos.Cantidad, tbAbordos.HorEmb "
sQuery = sQuery & " From tbAbordos, tbSKU_PROD "
sQuery = sQuery & " Where tbSKU_Prod.Cve_skuprod = tbAbordos.Cve_skuprod "
sQuery = sQuery & " AND tbAbordos.Cve_skucdna_origen = " & request.form("ClaveProducto") '101
sQuery = sQuery & " AND tbAbordos.Cve_skucdna_destino = " & request.form("cmbPlanta") ' 1
sQuery = sQuery & " AND tbAbordos.Fecha = CONVERT(DATETIME,'" & request.form("input1") & "',103) "
sQuery = sQuery & " ORDER BY tbSKU_Prod.Cri_Ord,tbSKU_Prod.Desc_skuprod"
sQuery = sQuery & " compute sum(tbAbordos.cantidad) by tbSKU_Prod.Cri_Ord,tbSKU_Prod.Desc_skuprod "
set objRegistro = Nothing
set objRegistro = objCn.Execute(sQuery)
if objRegistro.eof then
objRegistro.Close
objCn.Close
set objRegistro = nothing
set objCn = nothing
Session("Message")="No existen Plantas, verifiquelo por favor..."
Response.Write "<table align='center'>"
response.write "<tr>"
response.write "<td width='350' class='tablafondoamarillorojo' align='center'>"
Response.Write "<h4>No Existen Datos, verifique por favor su selección. Gracias</h4>"
response.write "<input type='button' value='Regresar' onclick='window.close()'>"
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.end
end if
vstrProducto = 0
vstrProductoTemporal = ""
Do
If objRegistro.Fields.Count > 1 Then
%>
<tr>
<td>
<%=objRegistro.Fields("Cve_skuprod")%>   <%=objRegistro.Fields("Desc_skuprod")%>
<%=vstrProductoTemporal = objRegistro.Fields("Cve_skuprod")%>
<input type="hidden" name="producto" value="<%=objRegistro.Fields("Cve_skuprod")%>">
<%vstrProducto = vstrProducto + 1%>
</td>
<%
End If
' se coloca el dato del producto
vstrContadorHoras = 1
Do While NOT objRegistro.EOF
For vstrContadorHoras = 1 to Ubound(vstrVectorHoras)
If Trim(vstrVectorHoras(vstrContadorHoras,1)) = Trim(objRegistro.Fields("HorEmb")) Then
vstrVectorHoras(vstrContadorHoras,2) = objRegistro.Fields("Cantidad")
exit for
End If
Next
objRegistro.MoveNext
Loop
' siguiente bloque de datos
Set objRegistro = objRegistro.NextRecordset
If objRegistro.Fields.Count > 1 Then
For vstrContadorHoras = 1 to Ubound(vstrVectorHoras)
%>
<td>
<input type="Text" name="valor" value="<%=vstrVectorHoras(vstrContadorHoras,2)%>">
</td>
<%
Next
%>
</tr>
<%
End If
Loop Until objRegistro.State = 0
End If
%>
<tr>
<td colspan="<%=vstrContadorFechas%>" width="150" class="tablafondoamarilloclaro">
<br>
<input type="submit" value="Registrar Datos" method="post" name"confirmar" target="ventana3">
<br>
</td>
</tr>
</table>
</form>
</body>
<%
objRegistro.Close
objCn.Close
set objRegistro = Nothing
set objCn = Nothing
%>
</html>

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas