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


PHP Calendar::style方法代码示例

本文整理汇总了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 . '&nbsp;' . $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>&nbsp;</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 '&nbsp;</td>';
            $timestamp = strtotime('+1 day', $timestamp);
        }
        echo '</tr>';
    }
    echo '</table>';
} else {
    echo '<div>スケジュールはありません。</div>';
}
开发者ID:miyamoto-shinji,项目名称:php_01,代码行数:31,代码来源:groupweek.php

示例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'] = '終日&nbsp;';
                    }
                    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();
?>
开发者ID:miyamoto-shinji,项目名称:php_01,代码行数:31,代码来源:facilitymonth.php

示例3: mktime

		</td></tr>
		<tr><th>日付</th><th>出社</th><th>外出</th><th>退社</th><th>勤務時間</th><th>外出時間</th><th>備考</th><th>&nbsp;</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];
                }
            }
开发者ID:miyamoto-shinji,项目名称:php_01,代码行数:31,代码来源:index.php


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