Actually what I'm trying to do it's kinda complicated, at least I see it that way, I have a code that receives 2 dates a startdate and an enddate, after that I create a calendar from the months of the startdate to the month of the enddate, but now I want to receive like 40 dates and let me create 20 calendars, one first, then jump in a row and create another one, but let's say that the months will just appear once in the upper and then each calendar only creates text boxes for each month, maybeI can not explain myself very well, I leave the code for you to try it and give you an idea:
function nombres($month){ //para asignar los nombres de los meses
switch($month){
case 1: $nombre="ENE";
break;
case 2: $nombre="FEB";
break;
case 3: $nombre="MAR";
break;
case 4: $nombre="ABR";
break;
case 5: $nombre="MAY";
break;
case 6: $nombre="JUN";
break;
case 7: $nombre="JUL";
break;
case 8: $nombre="AGO";
break;
case 9: $nombre="SEP";
break;
case 10: $nombre="OCT";
break;
case 11: $nombre="NOV";
break;
case 12: $nombre="DIC";
break;
}//case
return $nombre;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
<tr>
<td> </td>
<?php
//para no modificar originales
$mes_mas=$mes;
$anio_mas=$anio;
$inicio=1;
else {
for($k=1;$k<=2;$k++){ // 2 por que en la primera crea las columnas y en la segunda los meses..
$tot_mes=0; // se reinicia para que dé el tot neto de los meses.. por que da 2 vueltas y saldria doble el resultado.
if($k==1){ //para crear las columnas
$columna_anio=($anio2-$anio)+1;
?>
}//for o
$inicio=1;
}//else
}//for l ?>
</tr> <?php
}//else para crear meses dentro del for k
} //for k
} //else
$tot_columnas=$tot_mes+2; //para el ultimo renglon de la tabla y poner las variables hidden, el +2 por la columna de descrip y la de ledger
$celdas=$tot_mes; //total de celdas (no se ocupa)
////////////////////////////////////////////para establecer el nombre de las cajas de texto//////////////////////////////
if($columna_anio>1){
$mes_ini=12-$mes;
$mes_ini2=$mes+$mes_ini; //para el for donde empiezan los meses del primer año
}
else {
$mes_ini=$mes2;
$mes_ini2=$mes_ini; //para el for donde empiezan los meses del primer año
}