Foros del Web » Programando para Internet » PHP »

Ayuda con pintar celdas

Estas en el tema de Ayuda con pintar celdas en el foro de PHP en Foros del Web. Hola a todos.. necesito realizar un especie de caledario en donde se pinte de un color determinado una celdas sin ninguna accion dependiendo de dos ...
  #1 (permalink)  
Antiguo 28/10/2008, 09:11
Avatar de jakuam  
Fecha de Ingreso: abril-2007
Mensajes: 354
Antigüedad: 17 años
Puntos: 0
Ayuda con pintar celdas

Hola a todos.. necesito realizar un especie de caledario en donde se pinte de un color determinado una celdas sin ninguna accion dependiendo de dos fecha de una base de datos..
le pongo un ejmplo a continuacion
datos base de datos
id=1
fecha1 = 01/01/2008
fecha2 = 18/01/2008

id = 2
fecha1 = 13/03/2008
fecha2= 27/02/2008

y quiero que se vea asi

Código HTML:
<table width="700" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td width="114" bgcolor="#ECFFEC">Mes</td>
    <td width="26" bgcolor="#ECFFEC">&nbsp;</td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">1</span></div></td>
    <td width="10" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">2</span></div></td>
    <td width="10" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">3</span></div></td>
    <td width="10" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">4</span></div></td>
    <td width="10" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">5</span></div></td>
    <td width="10" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">6</span></div></td>
    <td width="10" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">7</span></div></td>
    <td width="10" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">8</span></div></td>
    <td width="10" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">9</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">10</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">11</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">12</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">13</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">14</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">15</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">16</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">17</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">18</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">19</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">20</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">21</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">22</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">23</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">24</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">25</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">26</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">27</span></div></td>
    <td width="17" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">28</span></div></td>
    <td width="30" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">29</span></div></td>
    <td width="20" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">30</span></div></td>
    <td width="22" align="center" bgcolor="#ECFFEC"><div align="center"><span class="style1">31</span></div></td>
  </tr>
  <tr>
    <td width="114" bgcolor="#FFFFCC">enero</td>
    <td width="26">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="10" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="10" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="10" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="10" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="10" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="10" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="10" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="10" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="30">&nbsp;</td>
    <td width="20">&nbsp;</td>
    <td width="22">&nbsp;</td>
  </tr>
  <tr>
    <td width="114" bgcolor="#FFFFCC">febrero</td>
    <td width="26">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="30">&nbsp;</td>
    <td width="20">&nbsp;</td>
    <td width="22">&nbsp;</td>
  </tr>
  <tr>
    <td width="114" bgcolor="#FFFFCC">marzo</td>
    <td width="26">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="10">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17" bgcolor="#CCEBFF">&nbsp;</td>
    <td width="17">&nbsp;</td>
    <td width="30">&nbsp;</td>
    <td width="20">&nbsp;</td>
    <td width="22">&nbsp;</td>
  </tr>
</table> 
Necesito saber de que forma puedo hacer esto por favor!!!

gracias
__________________
Jakuam
Reserva Hoteles Online
Turismo San Rafael Mendoza
  #2 (permalink)  
Antiguo 28/10/2008, 09:38
Avatar de the_web_saint  
Fecha de Ingreso: mayo-2008
Ubicación: localhost/tierra/america/panama
Mensajes: 1.229
Antigüedad: 16 años
Puntos: 43
Respuesta: Ayuda con pintar celdas

ok, lo que deseas hacer es colorear los días del rango de fechas extraidos de la DB.
Bueno podrías hacer una función la cual le envies la fecha correspondiente a la celda y la fechas de la DB, esta retornará un color que será el valor del BGCOLOR.

Saludos
__________________
..::The Saint::..
El pesimista se queja del viento; el optimista espera que cambie; el realista ajusta las velas.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:07.