Example #1
0
function showDay($sDate, $caption = "")
{
    global $set;
    //build day
    $tsHeight = $set['dwTsHeight'] - 1;
    echo "<div class='timeFrame'>\n";
    echo "<var style='height:{$tsHeight}px;' id='a00:00:{$sDate}'></var>\n";
    $i = $set['dwStartHour'];
    $j = 0;
    if ($set['dwStartHour']) {
        echo "<var style='height:{$tsHeight}px;' id='t00:30:{$sDate}'></var>\n";
    }
    while ($i < $set['dwEndHour']) {
        echo "<var style='height:{$tsHeight}px;' id='t" . str_pad($i, 2, "0", STR_PAD_LEFT) . ":" . str_pad($j, 2, "0", STR_PAD_LEFT) . ":{$sDate}'></var>\n";
        $j = ($j + $set['dwTimeSlot']) % 60;
        if ($j == 0) {
            $i++;
        }
    }
    if ($set['dwEndHour'] < 24) {
        echo "<var style='height:{$tsHeight}px;' id='t" . str_pad($i, 2, "0", STR_PAD_LEFT) . ":" . str_pad($j, 2, "0", STR_PAD_LEFT) . ":{$sDate}'></var>\n";
    }
    echo "<div class=dates>\n";
    showGrid($sDate);
    echo "</div>";
    echo "</div>\n";
}
function showDay($dy, $dm, $da, $caption = "")
{
    global $la, $w, $c, $day_week_start_hour, $day_week_end_hour;
    // build day
    echo "<div class=\"single_day_frame\">";
    echo "<div class=\"cell_top\">";
    if ($caption) {
        echo $caption;
    } else {
        echo '<a href="index.php?o=', $la, '&w=', $w, '&c=', $c, '&m=', $dm, '&a=', $da, '&y=', $dy, '">';
        echo date('l, F j', mktime(0, 0, 0, $dm, $da, $dy));
        echo '</a>';
    }
    echo "</div>";
    echo "<div class=\"cell\" id=\"0:00:" . $dm . "/" . $da . "/" . $dy . "\"></div>\n";
    $i = $day_week_start_hour ? $day_week_start_hour : 0;
    $j = $day_week_start_hour ? 0 : 30;
    $max = $day_week_end_hour ? $day_week_end_hour : 24;
    while ($i < $max) {
        if ($j < 10) {
            $j = "0" . $j;
            if ($i < 10) {
                $i = $i;
            }
        }
        if ($i == 0) {
            $h = 12;
            $ap = "am";
        } elseif ($i == 12) {
            $h = $i;
            $ap = "pm";
        } elseif ($i > 12) {
            $h = $i - 12;
            $ap = "pm";
        } else {
            $h = $i;
            $ap = "am";
        }
        if ($i < 10) {
            $i = $i;
        }
        //echo "<div class=\"cell\" id=\"".$i.":".$j."\">".$h.":".$j." ".$ap."</div>\n";
        echo "<div class=\"cell\" id=\"" . $i . ":" . $j . ":" . $dm . "/" . $da . "/" . $dy . "\"></div>\n";
        $j = $j + 30;
        if ($j >= 60) {
            $j = "0";
            $i++;
        }
    }
    $sdate = $dy . $dm . $da;
    echo "<div id=\"dates\">\n";
    showGrid($sdate);
    echo "</div>";
    echo "</div>";
}
Example #3
0
                //day in month
                $dow = date("N", $cTime) > 5 ? 'we0' : 'wd0';
                if ($cDate == date("Y-m-d")) {
                    $dow .= ' today';
                } elseif (isset($_SESSION['nD']) and $cDate == $_SESSION['nD']) {
                    $dow .= ' slday';
                }
                $day = ltrim(substr($cDate, 8, 2), "0");
                if (!$_SESSION['hdr']) {
                    $day = "<span class='dom floatR'>{$day}</span>";
                } else {
                    $day = "<span class='dom floatR hyper' onclick=\"goDay('{$cDate}');\" title=\"{$xx['vws_view_day']}\">{$day}</span>";
                }
                $dHead = $privs > 1 ? " class='hyper' onclick=\"newE('{$cDate}');\" title=\"{$xx['vws_add_event']}\"" : '';
                echo "<td class='{$dow}'>{$day}<div{$dHead}>&nbsp;</div>\n";
                showGrid($cDate);
            } else {
                echo "<td class='blank'>";
            }
            echo "</td>\n";
            if ($i % 7 == 6) {
                echo "</tr>\n";
            }
            //if last day of week,wrap to left
        }
        echo "</table>\n</td>\n";
        $cm++;
    }
    echo "</tr>\n";
}
echo "</table>\n</div>\n";
Example #4
0
function showYear($calyear)
{
    global $week_titles_ss, $o, $m, $a, $y, $w, $c, $next, $prev, $lm, $la, $le;
    echo '<table width="100%" class="grid""><tr>';
    echo '<th colspan="4" class="cal_top"><a href="', $PHP_SELF, '?o=', $o, '&w=', $w, '&c=', $c, '&m=', $m, '&a=1&y=', $prev['year']['y'], '">&lt;</a>&nbsp;', $calyear, '&nbsp;<a href="', $PHP_SELF, '?o=', $o, '&w=', $w, '&c=', $c, '&m=', $m, '&a=1&y=', $next['year']['y'], '">&gt;</a></th></tr>';
    $calmonth = 0;
    for ($p = 0; $p < 3; $p++) {
        echo '<tr>';
        for ($q = 0; $q < 4; $q++) {
            $calmonth++;
            echo '<td width="25%" class="holder">';
            /* determine total number of days in a month */
            $calday = 0;
            $totaldays = 0;
            while (checkdate($calmonth, $totaldays + 1, $calyear)) {
                $totaldays++;
            }
            /* build table */
            echo '<table width="100%" class="grid"><tr>';
            echo '<th colspan="7" class="cal_top_s"><a href="index.php?o=', $lm, '&w=', $w, '&c=', $c, '&m=', $calmonth, '&a=1&y=', $calyear, '">', date('F', mktime(0, 0, 0, $calmonth, 1, $calyear)), '</a></th></tr><tr>';
            for ($x = 0; $x < 7; $x++) {
                echo '<th>', $week_titles_ss[$x], '</th>';
            }
            /* ensure that a number of blanks are put in so that the first day of the month
               lines up with the proper day of the week */
            $off = date("w", mktime(0, 0, 0, $calmonth, $calday, $calyear));
            $offset = $off + 1;
            echo '</tr><tr>';
            if ($offset > 6) {
                $offset = 0;
            }
            for ($t = 0; $t < $offset; $t++) {
                if ($t == 0) {
                    $offyear = date("Y", mktime(0, 0, 0, $calmonth, $calday - $off, $calyear));
                    $offmonth = date("m", mktime(0, 0, 0, $calmonth, $calday - $off, $calyear));
                    $offday = date("d", mktime(0, 0, 0, $calmonth, $calday - $off, $calyear));
                    echo '<td class="day"><div class="week"><a href="index.php?o=', $le, '&w=', $w, '&c=', $c, '&m=', $offmonth, '&a=', $offday, '&y=', $offyear, '">week</a></div></td>';
                } else {
                    echo '<td class="day">&nbsp;</td>';
                }
            }
            /* start entering in the information */
            for ($d = 1; $d <= $totaldays; $d++) {
                if ($d == date(j) && $calmonth == date(m) && $calyear == date(Y)) {
                    echo '<td class="day" id="today"><div class="day_of_month_s"><a href="index.php?o=', $la, '&w=', $w, '&c=', $c, '&m=', $calmonth, '&a=', $d, '&y=', $calyear, '">', $d, '</a></div>';
                } else {
                    echo '<TD class="day"><div class="day_of_month_s"><a href="index.php?o=', $la, '&w=', $w, '&c=', $c, '&m=', $calmonth, '&a=', $d, '&y=', $calyear, '">', $d, '</a></div>';
                    if ($offset == 0) {
                        echo '<div class="week"><a href="index.php?o=', $le, '&w=', $w, '&c=', $c, '&m=', $calmonth, '&a=', $d, '&y=', $calyear, '">week</a></div>';
                    }
                }
                /* correct date format */
                $coredate = date("Ymd", mktime(0, 0, 0, $calmonth, $d, $calyear));
                showGrid($coredate);
                echo "</td>";
                $offset++;
                /* if we're on the last day of the week, wrap to the other side */
                if ($offset > 6) {
                    $offset = 0;
                    echo '</tr>';
                    if ($day < $totaldays) {
                        echo '<tr>';
                    }
                }
            }
            /* fill in the remaining spaces for the end of the month, just to make it look
               pretty */
            if ($offset > 0) {
                $offset = 7 - $offset;
            }
            for ($t = 0; $t < $offset; $t++) {
                echo "<td>&nbsp;</td>";
            }
            /* end the table */
            echo '</tr></table>';
            echo '</td>';
        }
        echo "</tr>";
    }
    echo "</table>";
}
Example #5
0
        }
        // display hover box
    }
}
$cD = $_SESSION['cD'];
$eTime = mktime(12, 0, 0, substr($cD, 5, 2), substr($cD, 8, 2), substr($cD, 0, 4)) + ($set['lookaheadDays'] - 1) * 86400;
//Unix time of end date
$eDate = date("Y-m-d", $eTime);
$fName = 'upco.txt';
$rName = str_replace('.', '-' . date("Ymd-Hi") . '.', $fName);
retrieve($cD, $eDate, 'uc');
//display header
$tSpan = makeD($cD, 2) . " - " . makeD($eDate, 2);
echo "<div class=\"subHead\">\n<b>{$tSpan}</b>\n";
echo "<button class='noPrint floatR' type='button' title='{$xx['vws_download_title']}' onclick=\"location.href='dloader.php?ftd={$fName}&amp;rName={$rName}'\">{$xx['vws_download']}</button>\n";
echo "</div>\n";
$upcoTxt = "\n" . $xx['title_upcoming'] . "  " . $tSpan . "\n" . str_repeat('=', strlen($xx['title_upcoming'] . "  " . $tSpan)) . "\n\n";
//header upco text file
//display upcoming events
echo '<div class="eventBg' . ($_SESSION['mobile'] ? '"' : ' scrollBoxUp"') . ">\n";
if ($evtList) {
    $evtDone = array();
    foreach ($evtList as $date => &$events) {
        showGrid($events, $date);
    }
} else {
    echo $xx['none'] . "\n";
}
echo "</div>\n";
file_put_contents("./files/{$fName}", $upcoTxt, LOCK_EX);
//save upco text file
Example #6
0
function showUpcoming()
{
    global $start_time;
    if ($start_time) {
        ksort($start_time);
        while (list($k) = each($start_time)) {
            showGrid($k);
        }
    }
}