I have the following code where I walk with a while
but I want in each segment of a AREA
to put a row with its total and then continue with the rest
Here my code
$resultado = $conexion->query("SELECT Det.OP,Det.ID_Area,Det.Cliente,de.Desc_Area,
sum(Det.Cantidad) as CantidadOP,
sum(Det.Volumen) as VolumenOP,
sum(Det.PrecioTotal) as PrecioTotalOP
from Despacho_DetalleEntreAreas as Det
inner join Despacho_DescEntreAreas as de on de.ID_Area = Det.ID_Area where Det.Fecha Between '$FDesde' and '$FHasta'
Group by Det.OP, Det.ID_Area
order by Det.ID_Area, Det.OP asc");
while($row=$resultado->fetch_assoc())
{
$PrecioGrupo=$PrecioGrupo + $row['PrecioTotalOP']; ?>
<tr>
<td><?php echo $row['ID_Area'];?></td>
<td><?php echo $row['Desc_Area'];?></td>
<td><?php echo $row['OP'];?></td>
<td><?php echo $row['Cliente'];?></td>
<td><?php echo $row['CantidadOP'];?></td>
<td><?php echo number_format($row['VolumenOP'],4,"." , ",");?></td>
<td><?php echo "$". "". number_format($row['PrecioTotalOP'],0, " " , ",");?></td>
</tr>
}
my table:
<table class="table table-bordered hover" id="Tabla_OpDespachadas_Areas" cellspacing="0">
<thead>
<tr>
<th>ID_AREAS</th>
<th>AREAS</th>
<th>OP</th>
<th>CLIENTE</th>
<th>CANTIDAD</th>
<th>VOLUMEN</th>
<th>PRECIO</th>
</tr>
</thead>
<tbody>
<?php if (isset($_POST['Bto_Procesar'])): ?>
<?php include("Clases/ProcesoOP.php") ?>
<?php endif; ?>
</tbody>
I enclose a photo as the code shows
I hope you have explained me well