Foros del Web » Programando para Internet » PHP »

Capturar las Variables de una Tabla

Estas en el tema de Capturar las Variables de una Tabla en el foro de PHP en Foros del Web. Buen Dia En estos momentos estoy desarrollando una paguina de control y tengo un inconveniente el cual es el de poder capturar los datos que ...
  #1 (permalink)  
Antiguo 23/09/2005, 08:16
 
Fecha de Ingreso: septiembre-2005
Mensajes: 5
Antigüedad: 18 años, 6 meses
Puntos: 0
Capturar las Variables de una Tabla

Buen Dia

En estos momentos estoy desarrollando una paguina de control y tengo un inconveniente el cual es el de poder capturar los datos que los usuarios van a ingresar.
De la base realizo una consulta en la que trae La descripccion y el proceso el usuario tiene que ingresar la fecha inicial, fecha final, la base que realizo(la base se obtiene en una consulta la de mayor cantidad es 21 y se controla meniante un checbox)y la observacion.
No se como capturar los datos que el usuario ingrese en esta plantilla,cualquier ayuda les agradeceria.
Este es el codigo que llevo:
<html>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>

<body bgcolor="#66CCFF">
<head>
<title>Control Consumo</title>
<?php
include("conectar.php");
$link=Conectarse();


?>
</head>
<div align="left">
<img src="icono_ct.jpg" alt="Foto" title="Título" width="50" height="50">
</div>
<center>
<b><H2>Ingreso Datos Consumo</H2></b>
</center>
<br>
<FORM ACTION="actuconsumo.php" METHOD="get">
<center>
<TABLE BORDER=0>
<TR>
<TD> <select name='departamento' onChange="MM_jumpMenu('parent',this,0)">
<?php
//agregar el where para la cookie
$sql ='select departamento from departamento';
echo "<option>Seleecione la Gerencia</option>";
$result=mysql_query("$sql", $link);
//$vecConsulta=mysql_fetch_row($result);
while ($vecConsulta=mysql_fetch_array($result))
{
echo '<option value="actuconsumo.php?Depto='.$vecConsulta[0].'">'.$vecConsulta[0].'</option>';
}
?>
</select> </TD>
<TD>Sistema</TD>
<td><?php
$link=Conectarse();
$result=mysql_query("select t.* from bases_departamento b,departamento d,tipo_bases t
where d.id_departamento = b.id_departamento
and t.id_tipobase=b.id_tipobase
and d.departamento = '".$Depto."' ",$link);
$row = mysql_fetch_array($result);
echo $row[1];
?></td>
<td>Periodo</td>
<td>
<?php $link=Conectarse();
$result=mysql_query("select max(id_periodo),periodoinicial,periodofinal
from periodo
group by periodoinicial,periodofinal ",$link);
$row = mysql_fetch_array($result);
echo $row[1]." - ".$row[2];
?>
</td>
</TABLE>
<br>
<table width="90%" height="24" border="0">
<tr>
<td height="20" bgcolor="#0066FF"><div align="center"><font size="+2"><strong><?php echo $Depto; ?> </strong></font></div>
</td>
</tr>
</table>
<br>


<TABLE width="90%" BORDER=1 CELLPADDING=1 CELLSPACING=1>
<tr>
<TD width="5%" align='center'> <font size="2" face="Times New Roman, Times, serif">Descripcion
</font></TD>
<TD width="5%" align="center"> <font size="2" face="Times New Roman, Times, serif">Nombre
del Proceso </font></TD>
<TD width="10%" align="center"><font size="2" face="Times New Roman, Times, serif">Fecha
Y Hora Inicial </font></TD>
<TD width="10%" align="center"><font size="2" face="Times New Roman, Times, serif">Fecha
Y Hora Final</font></TD>
<TD width="60%" align="center"> <font size="2" face="Times New Roman, Times, serif">BASE</font></TD>
<TD width="10%" align="center"> <font size="2" face="Times New Roman, Times, serif">OBSERVACIONES</font></TD>
</TR>
<?php
if ($Depto!= "")
{
$link=Conectarse();
$result=mysql_query("select descripcion,proceso from procesos ",$link);

while($row = mysql_fetch_array($result))
{
echo"<tr>";
printf("<td align='left'>%s</td> <td align='left'>&nbsp;%s&nbsp;</td>",$row["descripcion"],$row["proceso"]);
//echo"<td>'.$id_procesogeneral'";
echo"<td><input type='text' name='dato' size='10'></td>";
echo"<td><input type='text' name='dato' size='10'></td>";
echo "<td>";

$basexdepto=mysql_query("select b.* from bases_departamento b,departamento d
where d.id_departamento = b.id_departamento
and d.departamento = '".$Depto."' ",$link);

while($id_base = mysql_fetch_array($basexdepto))
{
echo '<input type="checkbox" name='.$i++.' value='.$row[0].'-'.$id_base[0].'>';
echo $id_base[3]." ";
}
echo "</td>";

echo "<td>";
echo '<TEXTAREA NAME="observa1"></TEXTAREA>';
echo "</td>";

echo"</tr>";
}

mysql_free_result($result);
mysql_close($link);
}
?>
</table>

</b></center><br>






Observaciones
<TD><TEXTAREA NAME="observa1" ROWS="" COLS="90"></TEXTAREA></TD>
<?php

$val = strlen($observa1);
if($boton=="Aceptar")
{
if ($val == 0)
{
echo "Digite la observacion";
}
else
{
$link=Conectarse();
mysql_query("insert into proceso_consumo(observacion_general)
values ('$observa1')",$link);

mysql_close($link);
}
}
?>
<br>
<br>
<br>
<P Align="CENTER"> ELABORO ______________________...............Vo.Bo._______ _____________</P>

<br>
<br>
<br>
FECHA DE VENCIMIENTO ___________________
<TD><center><TR><input type="submit" name="boton" VALUE="Aceptar"></TR>
<TR>
<input type="reset" VALUE="Cancelar">
</TR>
</center></TD>
</FORM>
<TD ><A HREF="reciclar/princfact.php">Home</font></A></TD>

<html>
<body>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:55.