关闭。这个问题需要细节或清晰。它目前不接受答案。
**想改进这个问题吗?**通过编辑这个帖子来添加细节并澄清问题。
两年前关门了。
改进这个问题
我有下面的代码,我做了一段时间,但我想在一个地区的每一个部分,把它的总行,然后继续与其余部分
这是我的密码:
$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
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>
这是我的table:
<table class="table table-bordered hover" id="Tabla_OpDespachadas_Areas" cellspacing="0">
<thead>
<tr>
<th>ID_AREAS</th>
<th>AREAS</th>
<th>CLIENT</th>
<th>CANT</th>
<th>VOL</th>
<th>PRICE</th>
</tr>
</thead>
<tbody>
<?php if (isset($_POST['Bto_Procesar'])): ?>
<?php include("Clases/ProcesoOP.php") ?>
<?php endif; ?>
</tbody>
我想要这样的东西。所以在一个区域的每一部分的末尾,我想放一行,加上该区域的价格,就是总价格,然后继续剩下的部分,我画了一张表,我想看到它
---------------------------------------------
|id|area |CLIENT |CANT |VOL |PRICE |
|--|-----------|--------|-----|------|--------|
|1 |area1 |xxx1 |10 |1 |1 |
|1 |area1 |xxx2 |10 |1 |2 |
|1 |area1 |xxx3 |20 |2 |3 |
| | | | | |6 |
|--|-----------|--------|-----|------|--------|
|2 |area2 |xxx1 |40 |1 |5 |
|2 |area2 |xxx2 |45 |1 |5 |
|2 |area2 |xxx3 |20 |2 |5 |
| | | | | |15 |
我希望我解释得很好
1条答案
按热度按时间ycggw6v21#
这段php代码应该添加您要查找的小计。