Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/02/2009, 13:04
afrika91
 
Fecha de Ingreso: diciembre-2008
Mensajes: 14
Antigüedad: 15 años, 4 meses
Puntos: 1
Respuesta: Enviar datos de pedido por e-mail

He intentado haciendo la modificación de la numeración de los campos del formulario y funciona, pero me sigue mostrando en todos los casos un solo producto y no todos los que debería, es más repite el producto como tantas cantidad de veces cantidad de productos en la consulta hay.

Alguien tendría la amabilidad de ayudarme en esto?

Muchas Gracias.

Aquí va una parte del código:

<td bgcolor="#1C4176" class="style24"><div align="center">Codigo Producto</div></td>
<td bgcolor="#1C4176" class="style24"><div align="center">NombreProducto</div></td>
<td bgcolor="#1C4176" class="style24"><div align="center">Precio</div></td>
<td bgcolor="#1C4176" class="style24"><div align="center">Cantidad</div></td>
<td bgcolor="#1C4176" class="style24"><div align="center">Subtotal</div></td>
<td bgcolor="#1C4176" class="style24"><div align="center">Descuento Gral</div></td>
</tr>
<?php do { ?>
<tr>
<input name="IdProducto[]" type="hidden" id="IdProducto" value="<?php echo $row_rspedidosd['IdProducto']; ?>" /></td>
<td><input name="CodProd[]" type="text" id="CodProd" value="<?php echo $row_rspedidosd['CodProd']; ?>" /></td>
<td><input name="NombreProducto[]" type="text" id="NombreProducto" value="<?php echo $row_rspedidosd['NombreProducto']; ?>" size="80" maxlength="80" /></td>
<td><input name="PrecioUnidad[]" type="text" id="PrecioUnidad" value="<?php echo $row_rspedidosd['PrecioUnidad']; ?>" size="10" /></td>
<td><input name="Cantidad[]" type="text" id="cantidad" value="<?php echo $row_rspedidosd['Cantidad']; ?>" size="10" /></td>
<td><input name="Subtotal[]" type="text" id="subtotal" value="<?php echo $row_rspedidosd['Subtotal']; ?>" size="10" /></td>
<td><input name="Descuento[]" type="text" id="Descuento" value="<?php echo $row_rspedidosd['Descuento']; ?>" size="10" /></td>
</tr>
<?php } while ($row_rspedidosd = mysql_fetch_assoc($rspedidosd)); ?>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Comentarios
<input name="comentarios" type="text" id="comentarios" value="<?php echo $row_rspedidos['Comentarios']; ?>" size="100" maxlength="255" />
</p>
<p align="center">
<input type="submit" name="Submit" value="Enviar" />
</p>
</form>
<?php
// Check if button name "Submit" is active, do this
if($Submit){
for($i=0;$i<$totalRows_rspedidosd;$i++){
$sql1="UPDATE pedidose SET CodProd='$CodProd[$i]', NombreProducto='$NombreProducto[$i]', PrecioUnidad='$PrecioUnidad[$i]', Cantidad= '$Cantidad[$i]', Subtotal='$Subtotal[$i]', Descuento='$Descuento[$i]' WHERE IdProducto='$IdProducto[$i]'";
$rsproductos1=mysql_query($sql1, $cn);
}
}
if($rsproductos1){
//header("location:modificarpreciosxcategoria.php");
echo "<script language='javascript'>";
echo "document.location.href = 'pedidoconfirmadomail.php'";
echo "</script>";
}
?>