rendered paste body$dow = intval(strftime("%u"));
if ($dow == 1) // monday
{
$monday = strtotime("today");
}
else
{
$monday = strtotime("last monday");
}
$startdate = strftime("%Y-%m-%d %H:%M", $monday);
$sunday = strtotime("+6 days", $monday);
$enddate = strftime("%Y-%m-%d %H:%M", $sunday);
$sql = "select *, unix_timestamp(received) as receivedepoch from weekcalendar order by received";
$res = mysql_query($sql);
while ($row = mysql_fetch_assoc($res))
{
$date = strftime("%m/%d", $row["receivedepoch"]);
$d = intval(strftime("%u", $row["received"]));
$currentday = $row["received"];
print strftime("%A", $row["receivedepoch"]) . "<br />";
print "• {$date} <font color='#FF00FF'>Event: </font><a href='weekevents.php?mode=view&id={$row[id]}'>{$row[title]}</a> <font color='#FF00FF'>Type:</font> {$row[event_type]} <font color='#FF00FF'>price: </font>{$row[price]}<br />\n";
}
print <<<KEY