<?php
//Recuperacion de las variables convertidas en sesiones
$edo=$_SESSION['edo2']=@$_REQUEST['edo'];
$str = $edo;
$muni=$_SESSION['muni2']=@$_REQUEST['muni'];
$str = $muni;
$col=$_SESSION['col2']=@$_REQUEST['col'];
$str = $col;
$dane=$_SESSION['dane2']=@$_REQUEST['dane'];
$str = $dane;
$cantidad=$_SESSION['cantidad2']=@$_REQUEST['cantidad'];
$str = $cantidad;
?>
<!-- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<!-- orden de produccion --------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
<script type="text/javascript">
function copiar()
{
document.getElementById("text2").value=document.getElementById("text1").value;
}
</script>
<tr><td>Orden produccion</td>
<td>Orden
<br><input type="text" name="producion" maxlength="9" size="7" id="text1" onkeyup="copiar()" ></td>
</tr>
<!-- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<form name="formulario" method="get" action="">
<!-- combo uno hace consulta en la base de datos productos ------------------------------------------------------------------------------------------------------------------------------------------->
<tr>
<td rowspan="2">Datos cliente</td>
<td>Producto <br>
<?php
//QUERY COMBO 1
$query="select * from productos";
?>
<select name="edo" onchange="this.form.submit()" >
<?php if($edo[0]!=''){ ?>
<option value="<?php echo $edo[0]."|".$edo[1]; ?>"><?php echo $edo[1]; ?></option>
<?php } else { ?>
<option > - </option><?php }?>
{?>
<option value="
<?php echo $row['codigo']."|".$row['producto']?>">
<?php echo htmlentities($row['producto']);?></option>
<?php
}
?>
</select>
</td>
<!-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -->
<!-- combo dos trae los estados en select dependiente del combo uno en tabla clientes----------------------------------------------------------------------------------------------------------------->
<tr>
<td>Cliente <br>
<?php
//QUERY COMBO 2
$query2="select * from clientes WHERE id_estado=$edo[0]";
?>
<select name="muni" onchange="this.form.submit()">
<?php if($muni[0]!=''){ ?>
<option value="<?php echo $muni[0]."|".$muni[1]?>"><?php echo $muni[1]; ?></option><?php } else { ?>
<option > - </option><?php }?>
{
?>
<option value="
<?php echo $row2['id_cliente']."|".$row2['cliente']?>">
<?php echo htmlentities($row2['cliente']);?></option>
<?php
}
$x=$edo[1];
$x1=$muni[1];
?>
</select>
</td>
</tr>
<!------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------>
<!-- consulta muestra los clientes elegidos de la base de datos dependiendo del combo 2 ----------------------------------------------------------------------------------------------------->
<tr>
<td rowspan="2">Datos envio</td>
<td colspan=''> Destinatario <?php
$sql="SELECT id_cliente, id_estado, cliente, direcion FROM clientes WHERE cliente = '$muni[1]' ";
("ERROR $sql");
if (!$resultado) {
echo 'No se pudo ejecutar la consulta: ' . mysql_error(); }
echo "<br> ";
//echo $fila[0]." "; // 42
//echo $fila[1]." "; // el valor de email
echo $fila[2]." ";
echo $fila[3]." ";
echo " ";
?>
</td>
</tr><tr>
<td>n <?php //echo " ".$x;?> <?php //echo " ".$x1;?> </td>
</tr>
<!-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -->
</form>
<form name="resformulario" method="get" action="res_formulario.php">
<!-- cajas habilitadas y desabilitadas --------------------------------------------------------------------------------------------------------------------------------------------------------->
<tr>
<td rowspan="2">Distribuye</td>
<td>
Facturacion
<input type="checkbox" value="Facturacion" name="equipos1" onclick="document.resformulario.idSelect.disabled = false; document.resformulario.idInputTexto.disabled = true; idSelect.disabled = this.checked; idInputTexto.disabled = this.checked;" checked />
<br>
Thomas Greg Expres S.A
<input type="checkbox" value="Thomas_Greg_Expres_S.A" name="equipos2" onclick="document.resformulario.idSelect.disabled = true; document.resformulario.idInputTexto.disabled = false; idSelect.disabled = !this.checked; idInputTexto.disabled = !this.checked;" />
<br>
<select name="ele" id="idSelect">
<option value="Caja" >Caja</option>
<option value="Paquete"> Paquete</option>
<option value="Sobre"> Sobre</option>
<option value="Tula"> Tula</option>
<option value="No Aplica" selected> No aplica</option>
</select>
Cantidad:
<input name="can" id="idInputTexto" type="text" maxlength="3" size="1"/>
</td>
</tr>
<tr>
<td>t
</td>
</tr>
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
<!-- detalle reistros ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
<tr><td colspan='2'><center>Detalles registros</td><td colspan='2'><center>Numeracion</td></tr>
<tr><td vAlign="top">Cantidad
<br><input type="text" name="cantidad" maxlength="3" size="1"></td>
<td>Descripcion
<br><textarea name="descripcion" rows="10" cols="40"></textarea></td>
<td vAlign="top"> Desde
<br><input type="text" name="inicial" maxlength="11" size="7"></td>
<td vAlign="top">Hasta
<br><input type="text" name="final" maxlength="11" size="7"></td>
</tr>
<!-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
</tbody>
</table>
<?php
echo " ".$x;
echo " ".$x1;
?>
<!-- traigo todo lo de los select dependientes en el value de text invisible -->
<input type="hidden" name="producto" value="
<?php echo htmlspecialchars($x); ?>" >
<input type="hidden" name="dircliente" value="
<?php echo htmlspecialchars($x1); ?>" >
<input type="hidden" name="copproducion" id="text2" >
<br>
He revisado correctamente
<input type="checkbox" value="Aceptar" name="equipos2" required />
<!-- enviar borrar salir -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<input type='submit' value='Envia'> <input type='reset' value='Restablecer'><br>
<a HREF="salir.php" TARGET=""><FONT size =" " color = '' face = ''> Salir
<!-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
</form>
</body>
</html>