Hola que tal,
tengo esta consulta que me va imprimiendo el mes con su importe... pero ahora quiero meterle un campo(input text) a cada registro para depues guardarlos de nuevo..
Código PHP:
Ver original<?php
$meses[1]='ENERO';
$meses[2]='FEBRERO';
$meses[3]='MARZO';
$meses[4]='ABRIL';
$meses[5]='MAYO';
$meses[6]='JUNIO';
$meses[7]='JULIO';
$meses[8]='AGOSTO';
$meses[9]='SEPTIEMBRE';
$meses[10]='OCTUBRE';
$meses[11]='NOVIEMBRE';
$meses[12]='DICIEMBRE';
$sql="SELECT YEAR(fecha) AS ANIO, MONTH(fecha) AS MES, MONTHNAME(fecha) AS NOMBRE, importe, SUM(iva) as tiva, SUM(importe) as timp FROM tabla WHERE YEAR(fecha)='$anio' AND importe!='0' AND iva!='0' GROUP BY ANIO DESC , MES ASC";$fechas=mysql_query($sql,$conexion);
echo "<form name='form' id='form' action='' method='post'>";
echo "<table>";
echo "<thead>";
echo "<tr>";
echo "<th>MES</th>";
echo "<th>OBSERVACIONES</th>";
echo "<th>IMPORTE</th>";
echo "</tr>";
echo "</thead>";
$totalimp = 0;
{
$timporte=$fech['tiva']+$fech['timp'];
echo "<tr>";
echo "<td>".$meses[$fech['MES']]."</td>";
echo '<td style="text-align:center"><input type="text" name="'.$meses[$fech['MES']].'observacion" id="'.$meses[$fech['MES']].'observacion" size="80"></td>';
echo "<td style='text-align:right'>$timporte<input name='mes' type='checkbox'></td></tr>";
$totalimp+=$timporte;
}
echo "<tr><td></td><td>TOTAL</td><td>$$totalimp</td></tr></table>";
}
?>
esto me genera algo asi:
donde en el codigo cada input text tendria algo asi como nombre:
y a la hora de recibir la variable nombre de cada input (name="'.$meses[$fech['MES']].'observacion") con POST ya no se como hacerle...