<?php include_once '../scripts/DBAccess.php'; $month = date('m'); $year = date('Y'); $endmonth = $month + 1; $endyear = $year; $endmonth2 = $month + 2; $endyear2 = $year; if ($endmonth > 12) { $endmonth = 1; $endyear = $endyear + 1; } if ($endmonth2 > 12) { $endmonth2 = 2; $endyear2 = $endyear2 + 1; } $eventResult = DBAccess::getEventRange(1, $year . "-" . $month . "-01", $endyear . "-" . $endmonth . '-01'); $rows = count($eventResult, 0); echo "<table class=\"eventsTable\" style=\"text-align:left;\">"; for ($i = 0; $i < $rows; $i++) { echo "<tr style=\"color:#" . $eventResult[$i]['EventColour'] . ";\">\n\t<td>" . $eventResult[$i]['EventName'] . ", "; if (ord($eventResult[$i]['Active']) == 1) { echo date('D j', strtotime($eventResult[$i]['EventDate'])) . ",\n\t\t\t " . date('g:iA', strtotime($eventResult[$i]['EventTime'])) . ""; } else { echo ", TBC"; } echo "</tr>"; } echo "</table>";
<?php include_once '../scripts/DBAccess.php'; $year = $_GET['year']; $eventType = $_GET['type']; $content = ""; if (is_numeric($year) && is_numeric($eventType)) { $eventResult = DBAccess::getEventRange($eventType, $year . "-01-01", $year . "-12-31"); $rows = count($eventResult, 0); if ($rows == 0) { $content = "<h3>No events have been found</h3>"; } else { $content = "\n\t\t\n\t\t\n\t\t<div class='container2'>\n\t\t<table class=\"eventsTable\" cellspacing=\"0\">\n\t\t<tr>\n\t\t<th style=\"width:11%\">Date</th>\n\t\t<th style=\"width:12%\">Time</th>\n\t\t<th style=\"width:30%\">Event Name</th>\n\t\t<th style=\"width:47%\">Description</th>\n\t\t</tr>\n\t\t"; for ($i = 0; $i < $rows; $i++) { $thing = ""; if (date('n', strtotime($eventResult[$i]['EventDate'])) % 2 == 0) { //echo (date('M', strtotime($eventResult[$i]['EventDate']))); $thing = "background:rgba(120, 120, 120, 0.5);"; } $content = $content . "<tr style=\"" . $thing . "; color:#" . $eventResult[$i]['EventColour'] . ";\">"; echo $eventResult[$i]['Active']; if (ord($eventResult[$i]['Active']) == 1) { $content .= "<td style=\"text-align:left;padding:10px;\">" . date('M, D j', strtotime($eventResult[$i]['EventDate'])) . "</td>\n\t\t\t\t\t <td>" . date('g:iA', strtotime($eventResult[$i]['EventTime'])) . "</td>"; } else { $content .= "<td style=\"text-align:left;padding:10px;\">TBC</td><td>TBC</td>"; } $content .= "<td style=\"text-align:left;padding:10px;\">" . $eventResult[$i]['EventName'] . "</td>\n\t\t\t\t <td>" . $eventResult[$i]['EventDescription'] . "</td> </tr>"; } $content = $content . "</table></div>"; } } else {