Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table class="table table-bordered table-hover table-striped display AllDataTables" cellspacing='0' width='100%'>
- <thead>
- <tr>
- <th class='th-sm'>Pedido</th>
- <th class='th-sm'>Nombre</th>
- <th class='th-sm'>Apellido</th>
- <th class='th-sm'>Telefono</th>
- <th class='th-sm'>codProducto</th>
- <th class='th-sm'>Descripcion</th>
- <th class='th-sm'>Color</th>
- <th class='th-sm'>Talle</th>
- <th class='th-sm'>Cantidad</th>
- </tr>
- </thead>
- <tbody id="txtHint">
- </tbody>
- </table>
- function showUser(str) {
- if (str == "") {
- document.getElementById("txtHint").innerHTML = "";
- return;
- } else {
- if (window.XMLHttpRequest) {
- // code for IE7+, Firefox, Chrome, Opera, Safari
- xmlhttp = new XMLHttpRequest();
- } else {
- // code for IE6, IE5
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.onreadystatechange = function() {
- if (this.readyState== 4 && this.status == 200) {
- document.getElementById("txtHint").innerHTML = this.responseText;
- }
- };
- xmlhttp.open("GET", "scripts/campania/getCampaniaDistribucion.php?camp="+str,true);
- xmlhttp.send();
- }
- }
- <?php
- require('../../sql/conexion.php');
- require('../../encabezado.php');
- $campania = $_GET['camp'];
- $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
- from pedidos as p
- inner join revendedoras as r on p.idRevendedora=r.idRevendedora
- inner join detallepedidos as dp on p.idPedido=dp.idPedido
- inner join productos as pro on pro.idProducto=dp.idProducto
- inner join relaciontallecolor as rtc on dp.idRelacionTalleColor=rtc.idRelacionTalleColor
- inner join colores as c on rtc.idcolor=c.idColor
- inner join talles as t on rtc.idtalle=t.idTalle
- 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)");
- while($rowCampania = $getCamp->fetch(PDO::FETCH_ASSOC)){
- echo "<tr>";
- echo "<th>" . $rowCampania['idpedido'] . "</th>";
- echo "<th>" . $rowCampania['nombre'] . "</th>";
- echo "<th>" . $rowCampania['apellido'] . "</th>";
- echo "<th>" . $rowCampania['telefono'] . "</th>";
- echo "<th>" . $rowCampania['codProducto'] . "</th>";
- echo "<th>" . $rowCampania['descripcion'] . "</th>";
- echo "<th>" . $rowCampania['color'] . "</th>";
- echo "<th>" . $rowCampania['talle'] . "</th>";
- echo "<th>" . $rowCampania['sum(dp.cantidad)'] . "</th>";
- echo "</tr>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement