Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/01/2014, 09:34
Avatar de JeMaGa
JeMaGa
 
Fecha de Ingreso: julio-2011
Ubicación: Bogota
Mensajes: 430
Antigüedad: 12 años, 9 meses
Puntos: 4
Respuesta: Dias Festivos en calendario

QUe pena contigo pero no te entendí.

ASi lo tengo

Código PHP:
Ver original
  1. <?php
  2. $meses = array(
  3.     "1" => "Enero",
  4.     "2" => "Febrero",
  5.     "3" => "Marzo",
  6.     "4" => "Abril",
  7.     "5" => "Mayo",
  8.     "6" => "Junio",
  9.     "7" => "Julio",
  10.     "8" => "Agosto",
  11.     "9" => "Septiembre",
  12.     "10" => "Octubre",
  13.     "11" => "Noviembre",
  14.     "12" => "Diciembre",
  15. );
  16. ?>
Código HTML:
Ver original
  1. <table class="calendario">
  2.     <thead>
  3.         <tr>
  4.             <th colspan="7">
  5.     <div align="center">
  6.         <?php echo $meses[$month] . "/" . $year ?>
  7.     </div>
  8. </th>
  9. </tr>
  10. <tr>
  11.     <th>Domingo</th>
  12.     <th>Lunes</th>
  13.     <th>Martes</th>
  14.     <th>Miercoles</th>
  15.     <th>Jueves</th>
  16.     <th>Viernes</th>
  17.     <th>Sabado</th>
  18. </tr>
  19.     <?php
  20.    $diaini = (date("w", strtotime($month . "/01/" . $year))) + 1;
  21.    $diafin = (date("t", strtotime($month . "/01/" . $year)));
  22.    $contdias = 1;
  23.    for ($i = 1; $i <= 5; $i++) {
  24.        ?>
  25.         <tr>
  26.             <?php
  27.            for ($j = 1; $j <= 7; $j++) {
  28.                if ($j == 1 || $j == 7) {
  29.                    ?>
  30.                     <td class="weekend">    
  31.                     <?php } else { ?>
  32.                     <td>
  33.                         <?php
  34.                    }
  35.                    $diacalc = (($i - 1) * 7) + $j;
  36.                    if ($diacalc >= $diaini) {
  37.                         if ($contdias <= $diafin) {
  38.                            $datetmp = date("m/d/Y", strtotime($month . "/" . $contdias . "/" . $year));
  39.                            $dateformat = date("Y-m-d", strtotime($datetmp));
  40.                            $asesor = Asesor::model()->findByAttributes(array(
  41.                                 "Email" => Yii::app()->user->id,
  42.                             ));
  43.                             if ($asesor != null) {
  44.                                 $disp = Disponibilidad::model()->findAllByAttributes(array(
  45.                                     "Fecha_disponible" => $dateformat,
  46.                                     "Asesor" => $asesor->ID,
  47.                                 ));
  48.                                 $citas = Calendario::model()->findAllByAttributes(array(
  49.                                     "Fecha_cita" => $dateformat,
  50.                                     "Asesor" => $asesor->ID
  51.                                 ));
  52.                             } else {
  53.                                 $disp = array();
  54.                                 $citas = array();
  55.                             }
  56.                             if ($datetmp == $date) {
  57.                                 ?>
  58.                                 <div class="today calinfo" id="<?php echo date("d-m-Y", strtotime($datetmp)) ?>">
  59.                                     <?php echo CHtml::link($contdias, "#"); ?>
  60.                                     <div style="display: inline; text-align: right;">
  61.                                         <?php
  62.                                        if (count($disp) > 0) {
  63.                                             echo TbHtml::icon(TbHtml::ICON_CALENDAR, array("title" => "Disponibilidad asignada"));
  64.                                         }
  65.                                         if (count($citas) > 0) {
  66.                                             echo TbHtml::icon(TbHtml::ICON_BRIEFCASE, array("title" => "Citas asignadas"));
  67.                                         }
  68.                                         ?>
  69.                                     </div>
  70.                                 </div>
  71.                                 <?php
  72.                            } else {
  73.                                ?>
  74.                                 <div class="calinfo" id="<?php echo date("d-m-Y", strtotime($datetmp)) ?>">
  75.                                     <?php echo CHtml::link($contdias, "#") ?>
  76.                                     <div style="display: inline; text-align: right;">
  77.                                         <?php
  78.                                        if (count($disp) > 0) {
  79.                                             echo TbHtml::icon(TbHtml::ICON_CALENDAR, array("title" => "Disponibilidad asignada"));
  80.                                         }
  81.                                         if (count($citas) > 0) {
  82.                                             echo TbHtml::icon(TbHtml::ICON_BRIEFCASE, array("title" => "Citas asignadas"));
  83.                                         }
  84.                                         ?>
  85.                                     </div>
  86.                                 </div>
  87.                                 <?php
  88.                            }
  89.                        }
  90.                        $contdias++;
  91.                    }
  92.                    ?>
  93.                 </td>
  94.             <?php } ?>
  95.         </tr>
  96.     <?php } ?>
  97. </div>