"); $prev_month_info = getdate(mktime(0, 0, 0, $month - 1, 1, $year)); printf("", $prev_month_info["year"], $prev_month_info["mon"]); $begin_date = mktime(0, 0, 0, $month, 1, $year); $date_info = getdate($begin_date); printf("", $date_info["month"]); $next_month_info = getdate(mktime(0, 0, 0, $month + 1, 1, $year)); printf("", $next_month_info["year"], $next_month_info["mon"]); printf("
<<", $year - 1, $month); ?> >>", $year + 1, $month); ?>
January February March April
May June July August
September October November December

<<%s>>
\n"); $row_count = 0; $first_row = 1; $query = sprintf("SELECT DATE_FORMAT(date,'%%m/%%d'), location, address1, address2, DATE_FORMAT(date, '%%h:%%i %%p'), notes FROM live_performance WHERE date >= '%s' AND date < DATE_ADD('%s', INTERVAL 1 MONTH) ORDER BY date", date("Y-m-d H:i:s", $begin_date), date("Y-m-d H:i:s", $begin_date)); $result = mysql_query($query) or die("Query failed : " . mysql_error()); while ($myrow = mysql_fetch_row($result)) { if ($first_row == 1) { printf("\n\n"); printf("\n"); printf("\n"); printf("\n"); printf("\n"); printf("\n"); printf("\n"); $first_row = 0; } $row_count = $row_count + 1; if (0 == ($row_count % 2)) { $background = 0x9E8C4F; } else { $background = 0x8E4622; } if (strlen($myrow[3]) == 0) { $address = sprintf("%s", $myrow[2]); } else { $address = sprintf("%s
%s", $myrow[2], $myrow[3]); } printf("\n", $background); printf("\n", $myrow[0]); printf("\n", $myrow[1]); printf("\n", $address); printf("\n", $myrow[4]); printf("\n", $myrow[5]); printf("\n"); } if ($first_row == 1) { printf("No performances found.\n"); } else { printf("
DATELOCATIONADDRESSTIMENOTES
%s%s%s%s%s
\n"); } mysql_close($db); ?>