[LinksOS CVS Commit]website/content time.php,1.2,1.3
Status: Inactive
Brought to you by:
terencevs
|
From: <ke...@to...> - 2003-01-02 01:41:02
|
Update of /cvsroot/linksos/website/content In directory router-internal.tossell.net:/tmp/cvs-serv28780/content Modified Files: time.php Log Message: Title: Time Plotter Changes: Added plottime() and devsbyhour() - plottime shows the local times for all timezones, and the people in those timezones. Effects: People can now enter a time of day and timezone, and have the current time in many timezones displayed to them. This could assist in planning meetings, etc. Future work: It'd be nice to have the sunlight shown for each timezone. a=kennyt Index: time.php =================================================================== RCS file: /cvsroot/linksos/website/content/time.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** time.php 30 Dec 2002 09:18:08 -0000 1.2 --- time.php 2 Jan 2003 01:40:56 -0000 1.3 *************** *** 1,15 **** - <table style="font-size: 12px"><tr> <? ! /* go through by the hour and list devs */ ! for ( $h = -12; $h < 13; $h++ ) { ! echo '<td valign="top"' . ( is_integer($h/2) ? 'bgcolor="#CCCCCC"' : '' ). '><b>' . ( $h>0 ? '+' . $h : $h ) . '</b><br>'; ! $tzd_people = mysql_query('SELECT unixname,fullname FROM linksos_people WHERE gmt = ' . $h); ! if (mysql_num_rows($tzd_people)) { ! while ( $person = mysql_fetch_row($tzd_people ) ) { ! echo $person[1] . '<div align="right">(' . $person[0] . ')</div>'; } } echo '</td>'; } ! ?> ! </tr></table> \ No newline at end of file --- 1,46 ---- <? ! function devsbyhour() { ! echo '<table style="font-size: 12px"><tr>'; ! ! /* go through by the hour and list devs */ ! for ( $h = -12; $h < 13; $h++ ) { ! echo '<td valign="top"' . ( is_integer($h/2) ? 'bgcolor="#CCCCCC"' : '' ). '><b>' . ( $h>0 ? '+' . $h : $h ) . '</b><br>'; ! $tzd_people = mysql_query('SELECT unixname,fullname FROM linksos_people WHERE gmt = ' . $h); ! if (mysql_num_rows($tzd_people)) { ! while ( $person = mysql_fetch_row($tzd_people ) ) { ! echo $person[1] . '<div align="right">(' . $person[0] . ')</div>'; ! } } + echo '</td>'; } + echo '</tr></table>'; + } + + function plottime($time, $tz){ + /* Show the local times of developers for a given time $time at $tz */ + echo '<b>At ' . $time . ':00 GMT ' . $tz . '</b><br>'; + echo '<table style="font-size: 12px"><tr>'; + $gmt = $time - $tz; + for ( $t = -12; $t < 13; $t++ ) { + $tzd_people = mysql_query('SELECT unixname,fullname FROM linksos_people WHERE gmt = ' . $t); + echo '<td valign="top"' . (is_integer($t/2) ? 'bgcolor="#cccccc"' : '' ) . '><b>' . ( ($gmt + $t) < 24 ? ($gmt+$t) : ( ($gmt+$t)-24 ) ) . '</b><p />'; + while ( $tz_person = mysql_fetch_row($tzd_people) ) { + echo $tz_person[0] . '<br>'; + } echo '</td>'; + } + echo '</tr></table>'; } ! ! if (isSet($_REQUEST["time"])) { ! if ( isSet($_REQUEST["tz"]) ) ! plottime($_REQUEST["time"], $_REQUEST["tz"]); ! else { ! if ($_SESSION["user"][0] && $_SESSION["user"][6] != 25) ! plottime($_REQUEST["time"], $_SESSION["user"][6]); ! else ! echo 'You must specify a timezone (tz), or be logged in and have your timezone set.'; ! } ! } else ! devsbyhour(); ! ?> \ No newline at end of file |