Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/11/2005, 05:32
Avatar de arielcasanova
arielcasanova
 
Fecha de Ingreso: octubre-2004
Ubicación: Bahía Blanca - Argentina
Mensajes: 332
Antigüedad: 20 años, 1 mes
Puntos: 1
ups! muy largo el mensaje

Código:
<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>
<form name="form">
  <table width="600" border="0" cellspacing="5" cellpadding="0">
      <tr>
        <td width="327">  <select name="prod1" onChange="MM_jumpMenu('parent',this,0)">
                        <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT DISTINCT producto,id FROM productos order by producto asc", $link); 
while ($row=mysql_fetch_array($result))
{
echo "<option value='prueba2.php?id1=".$row['id']."&prod1=".$row['producto']."&cant1=$cant1&id2=$id2&prod2=$prod2&pres2=$pres2&cant2=$cant2&id3=$id3&prod3=$prod3&pres3=$pres3&cant3=$cant3&id4=$id4&prod4=$prod4&pres4=$pres4&cant4=$cant4&id5=$id5&prod5=$prod5&pres5=$pres5&cant5=$cant5&id6=$id6&prod6=$prod6&pres6=$pres6&cant6=$cant6'>".$row['producto']."</option>";
}
echo "<option value='prueba2.php?producto=".$row['id']."' selected>$prod1</option>";
?>
 </select></td>
        <td width="180">  <select name="pres1">
  <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT presentacion FROM productos where id='$id1'", $link); 
while ($row=mysql_fetch_array($result))
{
$presen = $row['presentacion'];
$mi_array = explode("-",$presen); 
foreach($mi_array as $value) 
echo "<option value>".$value."</option>";

}
?>
  </select></td>
        <td width="73">  <?
		if(!$cant1){
		echo"
		<input name='cant1' type='text' id='cant1' size='5'>";
		}
		else{echo"
		<input name='cant1' type='text' id='cant1' size='5' value='$cant1'>";
				}
		?>
</td>
      </tr>
  </table>
  

  <table width="600" border="0" cellspacing="5" cellpadding="0">
      <tr>
        <td width="327">  <select name="prod2" onChange="MM_jumpMenu('parent',this,0)">
                        <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT DISTINCT producto,id FROM productos order by producto asc", $link); 
while ($row=mysql_fetch_array($result))
{
echo "<option value='prueba2.php?id2=".$row['id']."&prod2=".$row['producto']."&id1=$id1&prod1=$prod1&pres1=$pres1&cant1=$cant1&cant2=$cant2&id3=$id3&prod3=$prod3&pres3=$pres3&cant3=$cant3&id4=$id4&prod4=$prod4&pres4=$pres4&cant4=$cant4&id5=$id5&prod5=$prod5&pres5=$pres5&cant5=$cant5''>".$row['producto']."</option>";
}
echo "<option value='prueba2.php?producto=".$row['id']."' selected>$prod2</option>";

?>
 </select></td>
        <td width="180">  <select name="pres2">
  <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT presentacion FROM productos where id='$id2'", $link); 
while ($row=mysql_fetch_array($result))
{
$presen = $row['presentacion'];
$mi_array = explode("-",$presen); 
foreach($mi_array as $value) 
echo "<option value>".$value."</option>";

}
?>
  </select></td>
        <td width="73">  <?
		if(!$cant2){
		echo"
		<input name='cant2' type='text' id='cant2' size='5'>";
		}
		else{echo"
		<input name='cant2' type='text' id='cant2' size='5' value='$cant2'>";
				}
		?>
</td>
      </tr>
  </table>

<table width="600" border="0" cellspacing="5" cellpadding="0">
      <tr>
        <td width="327">  <select name="prod3" onChange="MM_jumpMenu('parent',this,0)">
                        <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT DISTINCT producto,id FROM productos order by producto asc", $link); 
while ($row=mysql_fetch_array($result))
{
echo "<option value='prueba2.php?id3=".$row['id']."&prod3=".$row['producto']."&id1=$id1&prod1=$prod1&pres1=$pres1&cant1=$cant1&id2=$id2&prod2=$prod2&pres2=$pres2&cant2=$cant2&cant3=$cant3&id4=$id4&prod4=$prod4&pres4=$pres4&cant4=$cant4&id5=$id5&prod5=$prod5&pres5=$pres5&cant5=$cant5''>".$row['producto']."</option>";
}
echo "<option value='prueba2.php?producto=".$row['id']."' selected>$prod3</option>";

?>
 </select></td>
        <td width="180">  <select name="pres3">
  <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT presentacion FROM productos where id='$id3'", $link); 
while ($row=mysql_fetch_array($result))
{
$presen = $row['presentacion'];
$mi_array = explode("-",$presen); 
foreach($mi_array as $value) 
echo "<option value>".$value."</option>";

}
?>
  </select></td>
        <td width="73">  <?
		if(!$cant3){
		echo"
		<input name='cant3' type='text' id='cant3' size='5'>";
		}
		else{echo"
		<input name='cant3' type='text' id='cant3' size='5' value='$cant3'>";
				}
		?>
</td>
      </tr>
  </table> 
<table width="600" border="0" cellspacing="5" cellpadding="0">
      <tr>
        <td width="327">  <select name="prod4" onChange="MM_jumpMenu('parent',this,0)">
                        <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT DISTINCT producto,id FROM productos order by producto asc", $link); 
while ($row=mysql_fetch_array($result))
{
echo "<option value='prueba2.php?id4=".$row['id']."&prod4=".$row['producto']."&id1=$id1&prod1=$prod1&pres1=$pres1&cant1=$cant1&id2=$id2&prod2=$prod2&pres2=$pres2&cant2=$cant2&id3=$id3&prod3=$prod3&pres3=$pres3&cant3=$cant3&cant4=$cant4&id5=$id5&prod5=$prod5&pres5=$pres5&cant5=$cant5''>".$row['producto']."</option>";
}
echo "<option value='prueba2.php?producto=".$row['id']."' selected>$prod4</option>";

?>
 </select></td>
        <td width="180">  <select name="pres4">
  <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT presentacion FROM productos where id='$id4'", $link); 
while ($row=mysql_fetch_array($result))
{
$presen = $row['presentacion'];
$mi_array = explode("-",$presen); 
foreach($mi_array as $value) 
echo "<option value>".$value."</option>";

}
?>
  </select></td>
        <td width="73">  <?
		if(!$cant4){
		echo"
		<input name='cant4' type='text' id='cant4' size='5'>";
		}
		else{echo"
		<input name='cant4' type='text' id='cant4' size='5' value='$cant4'>";
				}
		?>
</td>
      </tr>
  </table> 
<table width="600" border="0" cellspacing="5" cellpadding="0">
      <tr>
        <td width="327">  <select name="prod5" onChange="MM_jumpMenu('parent',this,0)">
                        <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT DISTINCT producto,id FROM productos order by producto asc", $link); 
while ($row=mysql_fetch_array($result))
{
echo "<option value='prueba2.php?id5=".$row['id']."&prod5=".$row['producto']."&id1=$id1&prod1=$prod1&pres1=$pres1&cant1=$cant1&id2=$id2&prod2=$prod2&pres2=$pres2&cant2=$cant2&id3=$id3&prod3=$prod3&pres3=$pres3&cant3=$cant3&id4=$id4&prod4=$prod4&pres4=$pres4&cant4=$cant4&cant5=$cant5&id6=$id6&prod6=$prod6&pres6=$pres6&cant6=$cant6'>".$row['producto']."</option>";
}
echo "<option value='prueba2.php?producto=".$row['id']."' selected>$prod5</option>";

?>
 </select></td>
        <td width="180">  <select name="pres5">
  <?php
include ("conexion.php");
$link = mysql_connect($host, $user, $pass); 
mysql_select_db($base, $link); 
$result = mysql_query("SELECT presentacion FROM productos where id='$id5'", $link); 
while ($row=mysql_fetch_array($result))
{
$presen = $row['presentacion'];
$mi_array = explode("-",$presen); 
foreach($mi_array as $value) 
echo "<option value>".$value."</option>";

}
?>
  </select></td>
        <td width="73">  <?
		if(!$cant5){
		echo"
		<input name='cant5' type='text' id='cant5' size='5'>";
		}
		else{echo"
		<input name='cant5' type='text' id='cant5' size='5' value='$cant5'>";
				}
		?>
</td>
      </tr>
  </table> </form>
en donde he aclarado que primero elijan los valores del jump de productos, (todos) y después le asignen los valores de presentación y cantidad, puesto que no he logrado que los conserve al recargar la página.... alguna idea?
gracias!
__________________
Ariel Casanova
diseño y desarrollo web estratégico
www.emporia.com.ar