12) { $nnMonth = 1; $nnYear = $nYear + 1; } $next_month = getDate(mktime(0, 0, 0, $nnMonth, 1, $nnYear)); $npMonth = $nMonth - 1; $npYear = $nYear; if ($npMonth < 1) { $npMonth = 12; $npYear = $nYear - 1; } $prev_month = getDate(mktime(0, 0, 0, $npMonth, 1, $npYear)); //Find out when this month starts and ends. $first_week_day = $this_month["wday"]; $days_in_this_month = round(($next_month[0] - $this_month[0]) / (60 * 60 * 24)); //Find last day of last month $days_in_last_month = round(($this_month[0] - $prev_month[0]) / (60 * 60 * 24)); $WhereEvent = ""; if ($nEvType > (-1)) { $WhereEvent = " and (evType=" . $nEvType . ")"; } $WhereEvent .= " and (evPubComm in(0,1))"; // initiate the table which holds the calendar $calendar_html = "\n"; // build row with Month/Year name in center, and +/- links on sides $calendar_html .= "\n"; $calendar_html .= "\n"; $calendar_html .= "\n"; $calendar_html .= "\n"; $calendar_html .= "\n"; // this row shows all the day names Sun Mon Tue Wed Thu Fri Sat // put spaces around Day names just to ensure nice minimum width $space = "   "; $calendar_html .= "\n"; for ($i=0; $i<7; $i++) { $calendar_html .= "\n"; } $calendar_html .= "\n"; // start calendar loop $calendar_html .= "\n"; //Fill the first week of the month with the appropriate number of blanks. for($week_day = 0; $week_day < $first_week_day; $week_day++) { $date_to_print = $days_in_last_month - $first_week_day + $week_day + 1; $calendar_html .= "\n"; } // now continue by printing all the rest of the matrix (all the days of THIS month) $week_day = $first_week_day; for($day_counter = 1; $day_counter <= $days_in_this_month; $day_counter++) { $week_day %= 7; if($week_day == 0) { $calendar_html .= ""; } $calendar_html .= "\n"; $week_day++; } // now if we didn't finish on a saturday, fill out the rest of the week if ($week_day < 7) { $day_counter = 1; for ($i=$week_day; $i<7; $i++) { $calendar_html .= "\n"; } } $calendar_html .= "
"; $calendar_html .= "«" . $this_month["month"] . " " . $nYear . ""; $calendar_html .= "»
"; $calendar_html .= $space . $daynames[$i] . $space . "
\n"; $calendar_html .= "
" . $date_to_print . "
\n"; $calendar_html .= "
\n"; $calendar_html .= "
" . $day_counter . "
\n"; $lAnyEvents = "n"; $thisday = $nYear . "-" . $nMonth . "-" . $day_counter; $query = "select * from tEvents where (evDateStart <= '" . $thisday . "') and (evDateEnd >= '" . $thisday . "')" . $WhereEvent; $result = @mysql_query($query); while ( $row = mysql_fetch_array($result) ) { $calendar_html .= "
\n"; $calendar_html .= "" . $row["evTime"] . "\n"; if ($row["evType"] == 1) { $dClubName = "(unknown)"; $xClubNum = 0; $q2 = "SELECT * from tEventHost where evhEvId=" . $row["evId"]; $res2 = @mysql_query($q2); if (mysql_num_rows($res2 = @mysql_query($q2)) > 0) { $row2 = mysql_fetch_array($res2); $xClubNum = $row2["evhClubNum"]; } if ($xClubNum > 0) { $q2 = "SELECT * from tClubs where cClubNum=" . $xClubNum; $res2 = @mysql_query($q2); if (mysql_num_rows($res2 = @mysql_query($q2)) > 0) { $row2 = mysql_fetch_array($res2); $dClubName = $row2["cClubName"]; } } $evTitle = "TEST:" . substr($dClubName,0,25); $evTitle = ereg_replace(" FSC", "", $evTitle); $evTitle = ereg_replace(" SC", "", $evTitle); } else { $evTitle = substr($row["evTitle"],0,30); $evTitle = ereg_replace("20[0-9]*", "", $evTitle); $evTitle = ereg_replace("Invitational", "Invit", $evTitle); $evTitle = ereg_replace("Championship", "Champ", $evTitle); $evTitle = ereg_replace("Figure Skating", "FS", $evTitle); $evTitle = ereg_replace("Competition", "Comp", $evTitle); } $calendar_html .= "" . $evTitle . "\n"; $calendar_html .= "
\n"; $lAnyEvents = "y"; } if ($lAnyEvents == "n") { // dummy events to make it at least minimum height $calendar_html .= " 
 
 
 
 
 
"; } $calendar_html .= "
\n"; $calendar_html .= "
" . $day_counter++ . "
\n"; $calendar_html .= "
\n"; return($calendar_html); } function calendar_little($date) { //If no parameter is passed use the current date. if($date == null) $date = getDate(); $day = $date["mday"]; $month = $date["mon"]; $month_name = $date["month"]; $year = $date["year"]; $this_month = getDate(mktime(0, 0, 0, $month, 1, $year)); $next_month = getDate(mktime(0, 0, 0, $month + 1, 1, $year)); //Find out when this month starts and ends. $first_week_day = $this_month["wday"]; $days_in_this_month = round(($next_month[0] - $this_month[0]) / (60 * 60 * 24)); $calendar_html = ""; $calendar_html .= ""; $calendar_html .= ""; //Fill the first week of the month with the appropriate number of blanks. for($week_day = 0; $week_day < $first_week_day; $week_day++) { $calendar_html .= ""; } $week_day = $first_week_day; for($day_counter = 1; $day_counter <= $days_in_this_month; $day_counter++) { $week_day %= 7; if($week_day == 0) $calendar_html .= ""; //Do something different for the current day. if($day == $day_counter) $calendar_html .= ""; else $calendar_html .= ""; $week_day++; } $calendar_html .= ""; $calendar_html .= "
" . $month_name . " " . $year . "
" . $day_counter . " " . $day_counter . "
"; return($calendar_html); } ?>
Figure Skater's Website
 |  Usfsa Caln   PSA Caln  | Lists » Competitions   Tests  

Fatal error: Call to undefined function calendar_big() in /var/www/mysites/sk8stuff/m_calendar.asp on line 124