These are the scripts I use for the "current OS" manager/statistics. There's not a lot of error handling since I use it casually, you'd probably need to watch for a lot more and exit gracefully if you were using this for anything serious.
 
Server script that sets OS and reports last used:
<?php
$db_server = "SERVER NAME HERE";
$db_user = "DATABASE USERNAME HERE";
$db_pass = "DATABASE PASSWORD HERE";
$db_name = "DATABASE NAME HERE";

//Call this script with ?set=0 to indicate boot to Windows and ?set=1 for GNU/Linux and no argument to output the last OS used and boot time

$dbl = mysql_connect ($db_server, $db_user, $db_pass);
if (!$dbl) die ("Error: ".mysql_error());
mysql_select_db ($db_name) or die ("Failure to select database: ".mysql_error());

if (isset ($_GET['set']))
{
	$q = mysql_query ("insert into winlin (winlin, date) values (".$_GET['set'].", now())");
	if (!$q) die ("Error".mysql_error());
	print "OK";
}
else
{
	$qr = mysql_query ("select id, winlin, date from winlin order by id desc limit 1");
	if (mysql_num_rows($qr) == 0) 
	{
		echo "No entries\n\n";
		exit;
	}
	$row = mysql_fetch_assoc ($qr);
	echo ($row['winlin']=='1' ? "GNU/Linux" : "Microsoft Windows 7") . " since ";
	echo date ('h:i A, d F Y', strtotime ($row['date']));
}

mysql_close ($dbl);
?>	


Code to print the full statistics page.
<html><head><title>Windows/Linux statistics</title></head><body>
<b>My Windows/Linux usage statistics</b><br>
<?php 
$db_server = "SERVER NAME HERE";
$db_user = "DATABASE USERNAME HERE";
$db_pass = "DATABASE PASSWORD HERE";
$db_name = "DATABASE NAME HERE";

$db = mysql_connect ($db_server, $db_user, $db_pass);
if (!$db) die ("Error: ". mysql_error());
mysql_select_db ($db_name) or die ("Error:" . mysql_error());
$q = mysql_query ("SELECT ID, winlin, date FROM winlin ORDER BY ID");
if (!$q) die ("Error: ". mysql_error());
$row =0;
while ($r = mysql_fetch_assoc($q))
{
	$wl[$row]=$r['winlin'];
	$rdate[$row++] = $r['date'];
}
mysql_close ($db);

$min_windows = 0;
$min_linux = 0;
echo "<table width=\"50%\" border=\"2\"><tr bgcolor=\"red\"><td>OS</td><td>Date/Time of boot</td><td>Minutes used</td></tr>\n";
for ($i=1; $i < $row; $i++)
{
	//$tmp = intval (date ('i', strtotime ($rdate[$i]))) - intval (date ('i', strtotime ($rdate[$i-1])));
	$tmp = round((strtotime ($rdate[$i]) - strtotime ($rdate[$i-1]))/60);
	if ($wl[$i-1] == 0)
	{
		$min_windows += $tmp;
		echo "<tr bgcolor=\"yellow\"><td>Windows";
	}
	else 
	{
		$min_linux += $tmp;
		echo "<tr bgcolor=\"white\"><td>GNU/Linux";
	}
	echo "</td><td>".$rdate[$i-1]."</td><td>".$tmp."</td></tr>\n";
}
//$tmp = intval (date ('i')) - intval (date('i', strtotime ($rdate[$row-1])));
$tmp = round((strtotime ("now") - strtotime ($rdate[$row-1]))/60);
if ($wl[$row-1] == 0)
{
	$min_windows += $tmp;
	echo "<tr bgcolor=\"yellow\"><td>Windows";
}
else
{
	$min_linux += $tmp;
	echo "<tr bgcolor=\"white\"><td>Ubuntu";
}
echo "</td><td>".$rdate[$row-1]."</td><td>".$tmp."</td></tr></table>\n";
//echo "win: ".$min_windows." lin: ". $min_linux."<br>\n";
$win_pct = round (($min_windows / ($min_windows + $min_linux)) * 100);
$lin_pct = round (($min_linux / ($min_windows + $min_linux)) * 100);

$win_hours = floor ($min_windows/60);
$win_remainminutes = $min_windows - ($win_hours*60);
$lin_hours = floor ($min_linux / 60);
$lin_remainminutes = $min_linux - ($lin_hours*60);
echo "<br>Windows: ".$win_hours. " hours, ". $win_remainminutes ." minutes.<br>";
for ($i = 0; $i < $win_pct; $i++) echo "*";
echo " " . $win_pct . "%<br>";

echo "GNU/Linux: ".$lin_hours." hours, ".$lin_remainminutes." minutes.<br>";
for ($i = 0; $i < $lin_pct; $i++) echo "*";
echo " " . $lin_pct . "%<br>";
echo " <br>";
if ($min_windows > $min_linux) echo ":("; else echo ":)";
?>
<br/> <br>
</body></html>

And, of course, you'll need a table named "winlin" with columns ID [PK/auto], winlin [any sort of small integer], date [datetime].
Finally, on each boot, call the script as above using a program like wget, executed at some point during startup (being the only user on each OS, I run it automatically after I log in).