CONSULTA MYSQL REPORTE EGRESOS REPOSICION
Publicado por SARA (21 intervenciones) el 08/02/2016 19:23:08
Buenas tardes, quiero realizar un reporte de caja chica tipo como el de la imagen adjunta, solo que no se como hacer seleccion del tipo de registro, por ejemplo si es EGRESO QUE ME IMPRIMA EL IMPORTE EN LA COLUMNA CORRESPONDIENTE, ADEMAS QUIERO AGREGAR LOS TOTALES DE LOS MONTOS.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$sql = "SELECT idmovimiento, fecha, referencia, tipo, tipo, concepto from cajachica where fecha BETWEEN '".$_SESSION['inicial']. "' AND '" .$_SESSION['final']."' GROUP BY idmovimiento ORDER BY idmovimiento DESC";
}
$result = mysql_query ($sql);
// verificamos que no haya error
if (! $result){
echo "La consulta SQL contiene errores.".mysql_error();
exit();
}else {
echo "<table class='table table-hover ajustar3' id='EXPORTA_EXCEL' >
<tr id='color_encabezado'>
<td>ID</td>
<td>Fecha</td>
<td>Referencia</td>
<td>Egreso</td>
<td>Reposicion</td>
<td>Concepto</td>
</tr>";
//obtenemos los datos resultado de la consulta
while ($row = mysql_fetch_row($result)){
echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."</td><td>".$row[4]."</td><td>".$row[5]."</td><td>";
}
echo "</tr></table>";
}
Valora esta pregunta


0