include "include/repeat.php"; include "include/view.php"; ?> <style type="text/css"> h2 {margin: 0; padding-left: 3px; clear: left; width: 100%;} dl {margin: 5px; } dt {margin-top: 5px; font-weight: bold; clear: left; } dd {margin-bottom: 10px; margin-left: 50px; } dt.canceled { text-decoration: line-through; } dd.canceled { text-decoration: line-through; } div.hr {font-size: 1; height:3px; margin: 0; width: 100%; background-color: #ff9a00;} </style> <?php # Connect to MySQL $conn = mysql_connect(DBHOST, DBUSER, DBPASSWORD) or die(mysql_error()); mysql_select_db(DBDATABASE, $conn); # This is used for choosing which side images should go on. The # preferred side is always the right side since it doesn't interfere # with the heading indentations that way. But to avoid a "staircase" # effect, if two consecutive events have images then the second one # is left-aligned, and smaller. This variable indicates how much # overlap there is; if >0 then the image must go on the left. $imageover = 0; $sql = "SELECT * FROM calevent, caldaily WHERE calevent.id = caldaily.id AND eventdate = '{$sqldate}' AND calevent.id = {$id}"; $result = mysql_query($sql, $conn) or die(mysql_error()); $record = mysql_fetch_array($result); print "<h2>" . date("l F j", strtotime($record["eventdate"])) . "</h2>\n"; print "<dl>\n"; fullentry($record); print "</dl>\n"; #ex:se sw=4:
function fullentries($day, $exclude = FALSE) { global $conn; global $imageover; # The day separator line is about 20 pixels high. We can # reduce $imageover by that much. $imageover -= 20; # for each event on this day... $result = mysql_query("SELECT * FROM calevent, caldaily WHERE calevent.id=caldaily.id AND eventdate=\"{$day}\" AND eventstatus<>\"E\" AND eventstatus<>\"S\" ORDER BY eventtime", $conn) or die(mysql_error()); if (mysql_num_rows($result) > 0) { print "<dl>\n"; } while ($record = mysql_fetch_array($result)) { if (!$exclude || $record["review"] != "E") { fullentry($record); } } if (mysql_num_rows($result) > 0) { print "</dl>\n"; } }