Exemplo n.º 1
0
function pilot_date_time($date, $time, $duration, $csv = false)
{
    $mday = $date % 100;
    $month = intval($date / 100 % 100);
    $year = intval($date / 10000);
    get_end_time($time, $duration, $hour, $min);
    // All times are now stored as GMT.
    // TODO Palm uses local time, so convert to users' time.
    $tz_offset = date('Z');
    // in seconds
    $tzh = intval($tz_offset / 3600);
    $tzm = intval($tz_offset / 60 % 60);
    $tzsign = '+';
    if ($tzh < 0) {
        $tzsign = '-';
        $tzh = abs($tzh);
    }
    return $csv ? sprintf("%04d-%02d-%02d%s%02d:%02d:00", $year, $month, $mday, $csv, $hour, $min) : sprintf("%04d/%02d/%02d %02d%02d  GMT%s%d%02d", $year, $month, $mday, $hour, $min, $tzsign, $tzh, $tzm);
}
function pilot_date_time($date, $time, $duration, $csv = false)
{
    $year = (int) ($date / 10000);
    $month = (int) ($date / 100) % 100;
    $mday = $date % 100;
    get_end_time($time, $duration, $hour, $min);
    // Assume that the user is in the same timezone as server
    $tz_offset = date("Z");
    // in seconds
    $tzh = (int) ($tz_offset / 3600);
    $tzm = (int) ($tz_offset / 60) % 60;
    if ($tzh < 0) {
        $tzsign = "-";
        $tzh = abs($tzh);
    } else {
        $tzsign = "+";
    }
    if ($csv) {
        return sprintf("%04d-%02d-%02d%s%02d:%02d:00", $year, $month, $mday, $csv, $hour, $min);
    } else {
        return sprintf("%04d/%02d/%02d %02d%02d  GMT%s%d%02d", $year, $month, $mday, $hour, $min, $tzsign, $tzh, $tzm);
    }
}
Exemplo n.º 3
0
        $crnNew = $classesArrayNum4[$k][6];
        //echo ("K: " .$k. " ");
        //echo ("CRN-NEW: " .$crnNew . ", CRN_OLD: " . $crnOld . "<br/>");
        if ($k == 0 || $crnNew != $crnOld) {
            ?>
                            <input class="class" type="checkbox" id="4_<?php 
            echo $classesArrayNum4[$k][4];
            ?>
" onchange="disableOtherSections(this.checked, 'class4', '<?php 
            echo get_section($classesArrayNum4[$k]);
            ?>
', '<?php 
            echo get_start_time($classesArrayNum4[$k]);
            ?>
', '<?php 
            echo get_end_time($classesArrayNum4[$k]);
            ?>
');">
                            <?php 
            print $class4[0] . " " . $class4[1] . ", section " . get_section($classesArrayNum4[$k]) . " goes from " . get_class_time($classesArrayNum4[$k]) . " on " . get_concat_meet_days($classesArrayNum4[$k]);
            ?>
</input><?php 
            ?>
                            </br>
                            <?php 
            $i++;
        }
        $crnOld = $crnNew;
    }
    $firstLine = true;
    ?>
Exemplo n.º 4
0
    if ($_POST['action'] == "START") {
        //start the game
        print "<h1>Start running bitches!</h1>";
        if (mysql_query("INSERT INTO " . OTHER_TBL . " (event, time) VALUES ('start',NOW())", $mysql)) {
            _logger(LOG_GAME, "START", "Journey has started!");
        }
        print "Start time recorded as:<br />" . get_start_time();
    } else {
        if ($_POST['action'] == "END") {
            print "<h1>The game has ended!</h1>";
            if (mysql_query("INSERT INTO " . OTHER_TBL . " (event, time) VALUES ('end',NOW())", $mysql)) {
                _logger(LOG_GAME, "END", "Journey has ended!");
            }
            print "End time recorded as:<br />" . get_end_time();
            print "<br />";
            print "<p>The game lasted: " . time_between(get_start_time(), get_end_time()) . "</p>";
            print "<p>Total Runners Tagged: " . total_runners_tagged() . "</p>";
            $checkpoints = get_all_checkpoint_ids();
            foreach ($checkpoints as $checkpoint_id) {
                print "<p>" . get_checkpoint_name($checkpoint_id) . ":<br />";
                print "&nbsp;&nbsp&nbsp;Checkins: " . total_checkpoint_checkins($checkpoint_id) . "</p>";
                print "<br />";
            }
        }
    }
} else {
    ?>
<h1>Are you ready?</h1>
<div align="center">
<form action="" method="post">
<input type="submit" name="action" value="START" style="width: 50%; height: 75px; font-size: 20pt;">