Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php $idvendedor = $_POST['vendedor'];?>
  2.  
  3. <table border='1'>
  4. <?php $em = mysqli_query($conn,"select * from empresas where idvendedor='$idvendedor'");
  5. while($ems = mysqli_fetch_assoc($em){
  6. $empresa = $ems['idempresa'];
  7. ?>
  8. <tr>
  9. <td colspan='3'><?php echo $ems['nombreempresa']?></td>
  10. </tr>
  11.  
  12. <?php $sr = mysqli_query($conn,"select * from servicios order by nombreservicio");
  13. while($srs = mysqli_fetch_assoc($sr){
  14. $servicio = $srs['idservicio'];
  15. $precio = $srs['valor'];
  16.  
  17. ?>
  18. <tr>
  19. <td colspan='3'><?php echo $srs['nombreservicio']?></td>
  20. </tr>
  21.  
  22. <?php
  23. $cm = mysqli_query($conn,"select * from compras where idservicio='$servicio' and idempresa='$empresa'");
  24. $cantidad = mysqli_num_rows($cm);
  25. $subtotal = $cantidad*$precio;
  26. ?>
  27. <tr>
  28. <td><?php echo $cantidad?></td>
  29. <td><?php echo $precio?></td>
  30. <td><?php echo $subtotal?></td>
  31. </tr>
  32. <?php } ?>
  33.  
  34. <?php }?>
  35. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement