Пример #1
0
 /**
  * Render month head
  */
 static function monthHead($first, $last, $month, $filter_room, $start_empty_days = 0, $end_empty_days = 0)
 {
     $html = [];
     if (!$filter_room) {
         $html[] = '<div class="ch-month-cell ch-month-cell-head ch-month-cell-title"></div>';
     }
     for ($i = 0; $i < $start_empty_days; $i++) {
         $html[] = '<div class="ch-month-cell ch-month-cell-head"></div>';
     }
     foreach ($month->dates as $date) {
         $day = $date->day;
         if ($day < $first || $day > $last) {
             continue;
         }
         $html[] = '<div class="ch-month-cell ch-month-cell-head ch-month-cell-day-' . $date->day_week . '">' . CHClient::day($date->day_week) . '&nbsp;' . $day . '</div>';
     }
     for ($i = 0; $i < $end_empty_days; $i++) {
         $html[] = '<div class="ch-month-cell ch-month-cell-head"></div>';
     }
     return implode("\n", $html);
 }