本文整理汇总了PHP中Calendar::style方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::style方法的具体用法?PHP Calendar::style怎么用?PHP Calendar::style使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::style方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
$day = date('j', $timestamp);
$month = '';
if ($i <= 0 || $day == 1) {
$month = date('n/', $timestamp);
}
echo '<th' . $style[$i] . '><a href="groupday.php' . $calendar->parameter(date('Y', $timestamp), date('n', $timestamp), $day) . '">' . $month . $day . ' ' . $week[$i] . '</a></th>';
$timestamp = strtotime('+1 day', $timestamp);
}
echo '</tr>';
foreach ($hash['user'] as $key => $value) {
$data[$key] = $calendar->prepare($data[$key], date('Y', $begin), date('n', $begin), date('j', $begin), date('Y', $end), date('n', $end), date('j', $end));
echo '<tr><td><a href="index.php' . $calendar->parameter($_GET['year'], $_GET['month'], $_GET['day'], array('member' => $key)) . '">' . $value . '</a> </td>';
$timestamp = $begin;
for ($i = 0; $i <= 6; $i++) {
$day = date('j', $timestamp);
echo '<td' . $calendar->style(date('Y', $timestamp), date('n', $timestamp), $day, $i) . '>';
if (is_array($data[$key][$day]) && count($data[$key][$day]) > 0) {
foreach ($data[$key][$day] as $row) {
$parameter = $calendar->parameter(date('Y', $timestamp), date('n', $timestamp), $day, array('member' => $key));
echo sprintf('<a href="groupday.php%s"%s>%s%s</a><br />', $parameter, $calendar->share($row), $row['schedule_time'], $row['schedule_title']);
}
}
echo ' </td>';
$timestamp = strtotime('+1 day', $timestamp);
}
echo '</tr>';
}
echo '</table>';
} else {
echo '<div>スケジュールはありません。</div>';
}
示例2: sprintf
$schedule = sprintf('<a href="facilityday.php%s">%s</a>', $calendar->parameter($_GET['year'], $_GET['month'], $day), $day);
if (is_array($data[$day]) && count($data[$day]) > 0) {
foreach ($data[$day] as $row) {
if ($row['schedule_allday'] == 1) {
$row['schedule_time'] = '終日 ';
}
if ($view->permitted($row, 'public')) {
$parameter = $calendar->parameter($_GET['year'], $_GET['month'], $day);
$schedule .= sprintf('<br /><a href="facilityday.php%s"%s>%s%s</a>', $parameter, $calendar->share($row), $row['schedule_time'], $row['schedule_title']);
} else {
$schedule .= '<br />' . $row['schedule_time'] . $row['schedule_name'];
}
}
}
}
echo '<td' . $calendar->style($_GET['year'], $_GET['month'], $day, $j, $lastday) . '>' . $schedule . '</td>';
}
echo '</tr>';
if ($day >= $lastday) {
break;
}
}
?>
</table>
<div class="schedulenavigation"><a href="facilitymonth.php<?php
echo $calendar->parameter(date('Y', $previous), date('n', $previous));
?>
">前の月</a><span class="separator">|</span>
<a href="facilitymonth.php<?php
echo $calendar->parameter();
?>
示例3: mktime
</td></tr>
<tr><th>日付</th><th>出社</th><th>外出</th><th>退社</th><th>勤務時間</th><th>外出時間</th><th>備考</th><th> </th></tr>
<?php
$timestamp = mktime(0, 0, 0, $_GET['month'], 1, $_GET['year']);
$lastday = date('t', $timestamp);
$weekday = date('w', $timestamp);
$week = array('日', '月', '火', '水', '木', '金', '土');
$today = array('year' => date('Y'), 'month' => date('n'), 'day' => date('j'));
if (is_array($hash['list']) && count($hash['list']) > 0) {
foreach ($hash['list'] as $row) {
$data[$row['timecard_day']] = $row;
}
}
$sum = 0;
for ($i = 1; $i <= $lastday; $i++) {
$class = $calendar->style($_GET['year'], $_GET['month'], $i, $weekday, $lastday);
$type = array('open', 'close', 'interval');
foreach ($type as $value) {
$key = 'timecard_' . $value;
$original = 'timecard_original' . $value;
if ($data[$i][$key] != $data[$i][$original]) {
if (strlen($data[$i][$key]) > 0) {
$data[$i][$key] = '<span class="timecardupdated">' . $data[$i][$key] . '</span>';
}
if ($_GET['original'] == 1) {
if ($data[$i][$original]) {
$data[$i][$key] = $data[$i][$original] . '<br />' . $data[$i][$key];
} else {
$data[$i][$key] = '-<br />' . $data[$i][$key];
}
}