当前位置: 首页>>代码示例>>PHP>>正文


PHP TTDate::getDayOfWeekArrayByStartWeekDay方法代码示例

本文整理汇总了PHP中TTDate::getDayOfWeekArrayByStartWeekDay方法的典型用法代码示例。如果您正苦于以下问题:PHP TTDate::getDayOfWeekArrayByStartWeekDay方法的具体用法?PHP TTDate::getDayOfWeekArrayByStartWeekDay怎么用?PHP TTDate::getDayOfWeekArrayByStartWeekDay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TTDate的用法示例。


在下文中一共展示了TTDate::getDayOfWeekArrayByStartWeekDay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSchedule


//.........这里部分代码省略.........
                     continue;
                     //Skip to next user.
                 }
                 $ulf = TTnew('UserListFactory');
                 $ulf->getByIdAndCompanyId($user_id, $current_user->getCompany());
                 if ($ulf->getRecordCount() != 1) {
                     continue;
                 } else {
                     $user_obj = $ulf->getCurrent();
                     $pdf->AddPage();
                     $pdf->setXY(670, $top_margin);
                     $pdf->SetFont('freesans', '', 10);
                     $pdf->Cell(100, 15, TTDate::getDate('DATE+TIME', $current_epoch), $border, 0, 'R');
                     $pdf->setXY($left_margin, $top_margin);
                     $pdf->SetFont('freesans', 'B', 25);
                     $pdf->Cell(0, 25, $user_obj->getFullName() . ' - ' . TTi18n::getText('Schedule'), $border, 0, 'C');
                     $pdf->Ln();
                 }
                 $pdf->SetFont('freesans', 'B', 16);
                 $pdf->Cell(0, 15, TTDate::getDate('DATE', $filter_data['start_date']) . ' - ' . TTDate::getDate('DATE', $filter_data['end_date']), $border, 0, 'C');
                 //$pdf->Ln();
                 $pdf->Ln();
                 $pdf->Ln();
                 $pdf->SetFont('freesans', '', 8);
                 $cell_width = floor(($pdf->GetPageWidth() - $left_margin * 2) / 7);
                 $cell_height = 100;
                 $i = 0;
                 $total_days = count($calendar_array) - 1;
                 $boader = 1;
                 foreach ($calendar_array as $calendar) {
                     if ($i == 0) {
                         //Calendar Header
                         $pdf->SetFont('freesans', 'B', 8);
                         $calendar_header = TTDate::getDayOfWeekArrayByStartWeekDay($start_week_day);
                         foreach ($calendar_header as $header_name) {
                             $pdf->Cell($cell_width, 15, $header_name, 1, 0, 'C');
                         }
                         $pdf->Ln();
                         unset($calendar_header, $header_name);
                     }
                     $month_name = NULL;
                     if ($i == 0 or $calendar['isNewMonth'] == TRUE) {
                         $month_name = $calendar['month_name'];
                     }
                     if ($i > 0 and $i % 7 == 0) {
                         $this->writeWeekSchedule($pdf, $cell_width, $week_date_stamps, $max_week_data, $left_margin, $group_schedule, $start_week_day);
                         unset($week_date_stamps);
                     }
                     $pdf->SetFont('freesans', 'B', 8);
                     $pdf->Cell($cell_width / 2, 15, $month_name, 'LT', 0, 'L');
                     $pdf->Cell($cell_width / 2, 15, $calendar['day_of_month'], 'RT', 0, 'R');
                     $week_date_stamps[] = $calendar['date_stamp'];
                     $i++;
                 }
                 $this->writeWeekSchedule($pdf, $cell_width, $week_date_stamps, $max_week_data, $left_margin, $group_schedule, $start_week_day, TRUE);
                 $valid_schedules++;
                 unset($this->schedule_shifts, $calendar_array, $week_date_stamps, $max_week_data, $day_epoch, $day_schedule_shifts, $day_schedule_shift, $schedule_shift_totals);
             }
         }
         unset($raw_schedule_shifts);
     } else {
         $valid_schedules = 1;
         $sf = TTnew('ScheduleFactory');
         $raw_schedule_shifts = $sf->getScheduleArray($filter_data);
         if (is_array($raw_schedule_shifts)) {
             foreach ($raw_schedule_shifts as $day_epoch => $day_schedule_shifts) {
开发者ID:alachaum,项目名称:timetrex,代码行数:67,代码来源:ScheduleFactory.class.php

示例2: scheduleDayOfWeekNameHeader

 function scheduleDayOfWeekNameHeader($start_week_day, $column_widths, $format)
 {
     if (isset($column_widths['day'])) {
         $this->pdf->SetFont($this->config['other']['default_font'], 'B', $this->_pdf_fontSize(8));
         if ($format != 'pdf_schedule' and $format != 'pdf_schedule_print') {
             $this->pdf->Cell($column_widths['label'], 4, TTi18n::getText('Employee'), 1, 0, 'C', 0, NULL, 1);
         }
         $calendar_header = TTDate::getDayOfWeekArrayByStartWeekDay($start_week_day);
         foreach ($calendar_header as $header_name) {
             $this->pdf->Cell($column_widths['day'], $this->_pdf_scaleSize(4), $header_name, 1, 0, 'C', 0, NULL, 1);
         }
         $this->pdf->SetFont($this->config['other']['default_font'], '', $this->_pdf_fontSize(8));
         $this->pdf->Ln();
         return TRUE;
     }
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:17,代码来源:ScheduleSummaryReport.class.php


注:本文中的TTDate::getDayOfWeekArrayByStartWeekDay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。