Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. <table class="table table-bordered table-hover table-striped display AllDataTables" cellspacing='0' width='100%'>
  2. <thead>
  3. <tr>
  4. <th class='th-sm'>Pedido</th>
  5. <th class='th-sm'>Nombre</th>
  6. <th class='th-sm'>Apellido</th>
  7. <th class='th-sm'>Telefono</th>
  8. <th class='th-sm'>codProducto</th>
  9. <th class='th-sm'>Descripcion</th>
  10. <th class='th-sm'>Color</th>
  11. <th class='th-sm'>Talle</th>
  12. <th class='th-sm'>Cantidad</th>
  13. </tr>
  14. </thead>
  15. <tbody id="txtHint">
  16. </tbody>
  17. </table>
  18.  
  19. function showUser(str) {
  20. if (str == "") {
  21. document.getElementById("txtHint").innerHTML = "";
  22. return;
  23. } else {
  24. if (window.XMLHttpRequest) {
  25. // code for IE7+, Firefox, Chrome, Opera, Safari
  26. xmlhttp = new XMLHttpRequest();
  27. } else {
  28. // code for IE6, IE5
  29. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  30. }
  31. xmlhttp.onreadystatechange = function() {
  32. if (this.readyState== 4 && this.status == 200) {
  33. document.getElementById("txtHint").innerHTML = this.responseText;
  34. }
  35. };
  36. xmlhttp.open("GET", "scripts/campania/getCampaniaDistribucion.php?camp="+str,true);
  37. xmlhttp.send();
  38. }
  39. }
  40.  
  41. <?php
  42. require('../../sql/conexion.php');
  43. require('../../encabezado.php');
  44.  
  45. $campania = $_GET['camp'];
  46.  
  47. $getCamp = $conexiones->query("SELECT p.idpedido,p.idCampania, r.nombre, r.apellido, r.telefono, pro.codProducto, pro.descripcion, sum(dp.cantidad), t.talle, c.color
  48. from pedidos as p
  49. inner join revendedoras as r on p.idRevendedora=r.idRevendedora
  50. inner join detallepedidos as dp on p.idPedido=dp.idPedido
  51. inner join productos as pro on pro.idProducto=dp.idProducto
  52. inner join relaciontallecolor as rtc on dp.idRelacionTalleColor=rtc.idRelacionTalleColor
  53. inner join colores as c on rtc.idcolor=c.idColor
  54. inner join talles as t on rtc.idtalle=t.idTalle
  55. WHERE p.idCampania = '".$campania."' and p.activo=1 group by c.idColor,t.idTalle,dp.idproducto,dp.idpedido order by p.idpedido,sum(dp.cantidad)");
  56.  
  57. while($rowCampania = $getCamp->fetch(PDO::FETCH_ASSOC)){
  58. echo "<tr>";
  59. echo "<th>" . $rowCampania['idpedido'] . "</th>";
  60. echo "<th>" . $rowCampania['nombre'] . "</th>";
  61. echo "<th>" . $rowCampania['apellido'] . "</th>";
  62. echo "<th>" . $rowCampania['telefono'] . "</th>";
  63. echo "<th>" . $rowCampania['codProducto'] . "</th>";
  64. echo "<th>" . $rowCampania['descripcion'] . "</th>";
  65. echo "<th>" . $rowCampania['color'] . "</th>";
  66. echo "<th>" . $rowCampania['talle'] . "</th>";
  67. echo "<th>" . $rowCampania['sum(dp.cantidad)'] . "</th>";
  68. echo "</tr>";
  69. }
  70.  
  71.  
  72. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement