示例#1
0
function display_month()
{
    global $phpc_month, $phpc_year, $phpc_home_url, $phpcid;
    $months = array();
    for ($i = 1; $i <= 12; $i++) {
        $m = month_name($i);
        $months["{$phpc_home_url}?action=display_month&amp;phpcid={$phpcid}&amp;month={$i}&amp;year={$phpc_year}"] = $m;
    }
    $years = array();
    for ($i = $phpc_year - 5; $i <= $phpc_year + 5; $i++) {
        $years["{$phpc_home_url}?action=display_month&amp;phpcid={$phpcid}&amp;month={$phpc_month}&amp;year={$i}"] = $i;
    }
    $next_month = $phpc_month + 1;
    $next_year = $phpc_year;
    if ($next_month > 12) {
        $next_month -= 12;
        $next_year++;
    }
    $prev_month = $phpc_month - 1;
    $prev_year = $phpc_year;
    if ($prev_month < 1) {
        $prev_month += 12;
        $prev_year--;
    }
    $heading = tag('', tag('a', attrs('class="phpc-icon-link"', "href=\"{$phpc_home_url}?action=display_month&amp;phpcid={$phpcid}&amp;month={$prev_month}&amp;year={$prev_year}\""), tag('span', attrs('class="fa fa-chevron-left"'), '')), create_dropdown_list(month_name($phpc_month), $months), create_dropdown_list($phpc_year, $years), tag('a', attrs('class="phpc-icon-link"', "href=\"{$phpc_home_url}?action=display_month&amp;phpcid={$phpcid}&amp;month={$next_month}&amp;year={$next_year}\""), tag('span', attrs('class="fa fa-chevron-right"'), '')));
    return create_display_table($heading, create_month($phpc_month, $phpc_year));
}
示例#2
0
function display_month($month, $year)
{
    global $config;
    $days = tag('tr');
    for ($i = 0; $i < 7; $i++) {
        if ($config['start_monday']) {
            $d = $i + 1 % 7;
        } else {
            $d = $i;
        }
        $days->add(tag('th', day_name($d)));
    }
    return tag('div', month_navbar($month, $year), tag('table', attributes('class="phpc-main"', 'id="calendar"'), tag('caption', month_name($month) . " {$year}"), tag('colgroup', attributes('span="7"', 'width="1*"')), tag('thead', $days), create_month($month, $year)));
}
示例#3
0
function display_month()
{
    global $month, $year, $phpc_home_url, $phpcid;
    $heading_html = tag('tr');
    $heading_html->add(tag('th', __p('Week', 'W')));
    for ($i = 0; $i < 7; $i++) {
        $d = ($i + day_of_week_start()) % 7;
        $heading_html->add(tag('th', day_name($d)));
    }
    $months = array();
    for ($i = 1; $i <= 12; $i++) {
        $m = month_name($i);
        $months["{$phpc_home_url}?action=display_month&amp;phpcid={$phpcid}&amp;month={$i}&amp;year={$year}"] = $m;
    }
    $years = array();
    for ($i = $year - 5; $i <= $year + 5; $i++) {
        $years["{$phpc_home_url}?action=display_month&amp;phpcid={$phpcid}&amp;month={$month}&amp;year={$i}"] = $i;
    }
    return tag('', tag("div", attributes('id="phpc-summary-view"'), tag("div", attributes('id="phpc-summary-head"'), tag("div", attributes('id="phpc-summary-title"'), ''), tag("div", attributes('id="phpc-summary-author"'), ''), tag("div", attributes('id="phpc-summary-category"'), ''), tag("div", attributes('id="phpc-summary-time"'), '')), tag("div", attributes('id="phpc-summary-body"'), '')), tag('table', attributes('class="phpc-main phpc-calendar"'), tag('caption', create_dropdown_list(month_name($month), $months), create_dropdown_list($year, $years)), tag('colgroup', tag('col', attributes('class="phpc-week"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"'))), tag('thead', $heading_html), create_month($month, $year)));
}