Ver Mensaje Individual
  #10 (permalink)  
Antiguo 03/05/2012, 15:00
dragonfire256
 
Fecha de Ingreso: septiembre-2011
Ubicación: Caracas
Mensajes: 240
Antigüedad: 12 años, 6 meses
Puntos: 9
Respuesta: Calendario con valores en PHP

Ya tengo casi listo el calendario pero quiero agregarle un par de cosas mas

Primero:Quiero que el registro del dia 1 empiece justo debajo del encabezado correspondiente, por ejemplo, en el mes de mayo empezaria a partir del martes, en junio a partir del viernes, y asi sucesivamente

Segundo: Que las las filas no excedan las 7 columnas

Muchas gracias

P.D. Aqui les dejo lo que llevo hecho:


Código PHP:
Ver original
  1. <?php
  2.     include("../admin/conexion.php");
  3.    
  4.     $con=conectar();
  5.    
  6.     $fecha_actual=date('d/m/Y');
  7.    
  8.     //$datos="SELECT * from reporte_horas where MONTH(fecha)=MONTH(CURDATE()) AND YEAR(fecha)=YEAR(CURDATE())";
  9.     //$resultado=mysql_query($datos,$con);
  10.    
  11.    
  12.     $fecha_div=explode("/",$fecha_actual);
  13.     $dia=date('d');
  14.    
  15.     for($i=0; $i<=$dia;$i++)
  16.     {
  17.         $fecha_acum="SELECT fecha,sum(horas) from (SELECT * FROM reporte_horas ORDER BY DAY(fecha)) reporte_horas where MONTH(fecha)=MONTH(curdate()) AND YEAR(fecha)=YEAR(CURDATE())group by fecha";
  18.         $resultado=mysql_query($fecha_acum,$con);
  19.     }
  20.     ?>
  21.     <table border="1" align="center">
  22.     <thead><tr><th>Domingo</th><th>Lunes</th><th>Martes</th><th>Miercoles</th><th>Jueves</th><th>Viernes</th><th>Sabado</th></tr></thead>
  23.     <?php
  24.     while($variable=mysql_fetch_array($resultado))
  25.     {
  26.         echo '<tr>';
  27.         echo '<td>',$variable[1],'</td>';
  28.         echo '</tr>';
  29.     }
  30. ?>
  31.     </table>