hola,
como puede definir la siguiente sentencia en una tabla de php según lineas abajo.
Código MySQL:
Ver originalSELECT Fecha
,TipoDeProducto
,Region
,Pais
,Cliente
,SUM(C_Est_Neto
),SUM(Cant_Cajas
),Precio_FCA_Promedio
,SUM(Importe
),SUM(Flete
),SUM(Descuento
), SUM(Valor_Neto_Total
) FROM resumenbeta
WHERE tipodeproducto
LIKE 'uvas be'GROUP BY Pais
Código PHP:
Ver original$registro = mysql_query("SELECT Fecha,TipoDeProducto,Region,Pais,Cliente,SUM(C_Est_Neto),SUM(Cant_Cajas),Precio_FCA_Promedio,SUM(Importe),SUM(Flete),SUM(Descuento), SUM(Valor_Neto_Total) FROM resumenbeta WHERE tipodeproducto LIKE '%$dato%' GROUP BY Pais", $conexion);
Código PHP:
Ver original<?php
include('conexion.php');
//$dato = $_POST['dato'];
$dato="";
if (isset($_POST['dato'])) {$dato = $_POST['dato'];}
//EJECUTAMOS LA CONSULTA DE BUSQUEDA
$registro = mysql_query("SELECT Fecha,TipoDeProducto,Region,Pais,Cliente,SUM(C_Est_Neto),SUM(Cant_Cajas),Precio_FCA_Promedio,SUM(Importe),SUM(Flete),SUM(Descuento), SUM(Valor_Neto_Total) FROM resumenbeta WHERE tipodeproducto LIKE '%$dato%' GROUP BY Pais", $conexion);
//CREAMOS NUESTRA VISTA Y LA DEVOLVEMOS AL AJAX
echo '<table class="table table-striped table-condensed table-hover">
<tr>
<th width="80">Fecha</th>
<th width="150">Tipo De Producto</th>
<th width="150">Region</th>
<th width="150">Pais</th>
<th width="350">Cliente</th>
<th width="150">C. Est. Neto</th>
<th width="150">Cant. Cajas</th>
<th width="150">Precio FCA</th>
<th width="150">Importe</th>
<th width="150">Flete</th>
<th width="150">Descuento</th>
<th width="150">Valor Neto Total</th>
</tr>';
echo '<tr>
<td>'.fechaNormal($registro2['Fecha']).'</td>
<td>'.$registro2['TipoDeProducto'].'</td>
<td>'.$registro2['Region'].'</td>
<td>'.$registro2['Pais'].'</td>
<td>'.$registro2['Cliente'].'</td>
<td>'.$registro2['C_Est_Neto'].'</td>
<td>'.$registro2['Cant_Cajas'].'</td>
<td> $.'.$registro2['Precio_FCA_Promedio'].'</td>
<td> $.'.$registro2['Importe'].'</td>
<td> $.'.$registro2['Flete'].'</td>
<td> $.'.$registro2['Descuento'].'</td>
<td> $.'.$registro2['Valor_Neto_Total'].'</td>
<td><a href="javascript:editarProducto('.$registro2['Fecha'].');" class="glyphicon glyphicon-edit"></a> <a href="javascript:eliminarProducto('.$registro2['Fecha'].');" class="glyphicon glyphicon-remove-circle"></a></td>
</tr>';
}
}else{
echo '<tr>
<td colspan="6">No se encontraron resultados</td>
</tr>';
}
echo '</table>';
?>