<?php
include ('cal_header.inc.php');
include ("cal_utils.php") ;
calHeaderFunc();
//list all events that have not been voted on with href to event for voting
//options : list all, list for group, list for date range,
//view trends
$query = "select user_id from calendar_users where username = '".$_SESSION["login"]."'";
$result = mysql_query($query);
$rows = mysql_num_rows($result);
$row = mysql_fetch_object($result);
$userid=$row->user_id;
$currdate = date("Ymd");
echo "<h2>Events coming up that have not been voted for:</h2>";
$query = "SELECT id, title, calendar_events.description, day, month, year
FROM calendar_events
INNER JOIN groups ON cat = groupid
WHERE id NOT
IN (
SELECT eventid
FROM vote
WHERE userid =".$userid."
)
AND cat
IN (
SELECT groupid
FROM groupusers
WHERE userid =".$userid.") AND (concat( year, MONTH , DAY ) >= '".$currdate."') order by year, month, day";
$result = mysql_query($query);
$month = 0;
if($result)
{
while ($row = mysql_fetch_object($result))
{
if($month <> $row->month)
echo "<br>";
$month = $row->month;
echo "<br><li>".$row->day."/".$row->month."/".$row->year." - <a href=cal_popup.php?op=view&id=".$row->id."&uname=".$_SESSION["login"].">".$row->title."</a>";
}
}
echo "</p>";
include ('cal_functions.inc.php');
include ('cal_footer.inc.php');
?>