<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title><?$lang->display("View logs");?></title>
<link rel="stylesheet" type="text/css" rev="stylesheet" href="css/includer.php?files=viewlogcalendar.css">
<script type="text/javascript" language="JavaScript1.2" src="js/compiled/for_popups.js"></script>
<script language="JavaScript1.2" type="text/javascript">
	function popLog(ye,mo,da) {
		var address = '?file=viewlog&uid=<?echo $str->fromHTML($_GET['uid']);?>&year='+ye+'&month='+mo+'&day='+da;
		popup(address, 'viewlog', '300', '680', 'yes');
	}
</script>
</head>

<body bottommargin="0" rightmargin="0" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
<div id="selargeste">
<?
if ($_GET['m']) {
	$m = $_GET['m'];
} else {
	$m = date("m");
}

if ($_GET['y']) {
	$y = $_GET['y'];
} else {
	$y = date("Y");
}


$cal = new calendar;


$cal->customFunc = true;
function customFunction($fd) {
	//echo date("\r\nd-M-Y G:i",$fd);
	global $sys, $db, $settings;
	$date = getdate($fd);
	if ($_GET['uid']) {
		$rs = $db->query("SELECT * FROM ".$settings->config['activity_logs_tablename']." WHERE date > ".$fd." AND date < ".($fd+86400)." AND uid='".$_GET['uid']."'");
	} else {
		$rs = $db->query("SELECT * FROM ".$settings->config['activity_logs_tablename']." WHERE date > ".$fd." AND date < ".($fd+86400)."");
	}
	if ($rs->RecordCount() > 0) {
	return "javascript:popLog('".$date['year']."','".$date['mon']."','".$date['mday']."')";
	} else {
		return false;
	}
}

echo $cal->getCal($m, $y);
?>
</div>
</body>
</html>
