Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $idvendedor = $_POST['vendedor'];?>
- <table border='1'>
- <?php $em = mysqli_query($conn,"select * from empresas where idvendedor='$idvendedor'");
- while($ems = mysqli_fetch_assoc($em){
- $empresa = $ems['idempresa'];
- ?>
- <tr>
- <td colspan='3'><?php echo $ems['nombreempresa']?></td>
- </tr>
- <?php $sr = mysqli_query($conn,"select * from servicios order by nombreservicio");
- while($srs = mysqli_fetch_assoc($sr){
- $servicio = $srs['idservicio'];
- $precio = $srs['valor'];
- ?>
- <tr>
- <td colspan='3'><?php echo $srs['nombreservicio']?></td>
- </tr>
- <?php
- $cm = mysqli_query($conn,"select * from compras where idservicio='$servicio' and idempresa='$empresa'");
- $cantidad = mysqli_num_rows($cm);
- $subtotal = $cantidad*$precio;
- ?>
- <tr>
- <td><?php echo $cantidad?></td>
- <td><?php echo $precio?></td>
- <td><?php echo $subtotal?></td>
- </tr>
- <?php } ?>
- <?php }?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement