<?php include "config.inc" ?>
<?php 
session_start();
$suma = 0;
$ta = 0;
$conexion = mysqli_connect($serv,$dbu,$dbp,$db);
mysqli_set_charset($conexion, "utf8");
for($i = 0;$i< $_SESSION['contador'];$i++){
	$ta += $_SESSION['numb'][$i];
	$peticion = "SELECT * FROM tabla_altaproducto WHERE CUENTA='".$_GET['IDS']."' AND SKU='".$_SESSION['producto'][$i]."'";
	$resultado = mysqli_query($conexion, $peticion);
	while($fila = mysqli_fetch_array($resultado)) {
	$total = $fila['COSTOECOM']*$_SESSION['numb'][$i];
	$suma += $total;
	}
}
echo "<td></td><td>".$ta."</td><td colspan='2'>Total: $ ".$suma."</td>";
mysqli_close($conexion);

?>