query($sql); ?> '; /* table headings */ $headings = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); $calendar.= ''.implode('',$headings).''; /* days and weeks vars now ... */ $running_day = date('w',mktime(0,0,0,$month,1,$year)); $days_in_month = date('t',mktime(0,0,0,$month,1,$year)); $days_in_this_week = 1; $day_counter = 0; $dates_array = array(); /* row for week one */ $calendar.= ''; /* print "blank" days until the first of the current week */ for($x = 0; $x < $running_day; $x++): $calendar.= ' '; $days_in_this_week++; endfor; /* keep going with days.... */ for($list_day = 1; $list_day <= $days_in_month; $list_day++): $calendar.= '
'; /* add in the day number */ $calendar.= '
'.$list_day.'
'; $event_day = $year.'-'.$month.'-'.$list_day; if(isset($events[$event_day])) { foreach($events[$event_day] as $event) { $calendar.= '
'.$event['title'].'
'.$event['time'].'

'; } } else { $calendar.= str_repeat('

 

',2); } $calendar.= '
'; if($running_day == 6): $calendar.= ''; if(($day_counter+1) != $days_in_month): $calendar.= ''; endif; $running_day = -1; $days_in_this_week = 0; endif; $days_in_this_week++; $running_day++; $day_counter++; endfor; /* finish the rest of the days in the week */ if($days_in_this_week < 8): for($x = 1; $x <= (8 - $days_in_this_week); $x++): $calendar.= ' '; endfor; endif; /* final row */ $calendar.= ''; /* end the table */ $calendar.= ''; /** DEBUG **/ $calendar = str_replace('',''."\n",$calendar); $calendar = str_replace('',''."\n",$calendar); /* all done, return result */ return $calendar; } function random_number() { srand(time()); return (rand() % 7); } /* date settings */ $month = (int) ($_GET['month'] ? $_GET['month'] : date('m')); $year = (int) ($_GET['year'] ? $_GET['year'] : date('Y')); /* select month control */ $select_month_control = ''; /* select year control */ $year_range = 7; $select_year_control = ''; /* "next month" control */ $next_month_link = 'Next Month >>'; /* "previous month" control */ $previous_month_link = '<< Previous Month'; /* bringing the controls together */ $controls = '
'.$select_month_control.$select_year_control.'       '.$previous_month_link.'     '.$next_month_link.'
'; /* get all events for the given month */ $now=time(); $month = sprintf("%02s", $month); $events = array(); $query=" SELECT id, Date, Name AS title, DATE_ADD(DATE_FORMAT(FROM_UNIXTIME(Date), '%Y-%m-%e'),Interval 1 Day) AS event_date, DATE_FORMAT(FROM_UNIXTIME(`Date`),'%h:%i %p') AS time, DATE_FORMAT(FROM_UNIXTIME(`Date`),'%Y-%m') AS EZ FROM MR_meet WHERE DATE_FORMAT(FROM_UNIXTIME(`Date`),'%Y-%m') LIKE '$year-$month'"; echo $query; $result = $con->query($query); while($row = $result->fetch_assoc()) { $events[$row['event_date']][] = $row; } ?>

XC Meet Calendar

$content $er";?>

HEADER

'.date('F',mktime(0,0,0,$month,1,$year)).' '.$year.''; echo '
'.$controls.'
'; echo '
'; echo draw_calendar($month,$year,$events); echo '

';?>

Welcome to the future of WV Meet Results and Entry

My goal with TriStateRacer.com has always been to use technology to promote the sport that we love! Our new portal combines XC and Track and Field Meet entry as well as the ability to upload results all from one login. The power to download entries and upload results is in your hands.

Help me take running in WV to the next level and help our kids and coaches. Say goodbye to HyTek Team Manager!

Thank you!

Pat Riley
TriStateRacer.com

Instructions

Setup your XC Meet and start accepting entries right now!

  • Login/Create an account at top right "Coaches Login"
  • Click "Add a Home Meet To Our Database"
    • Set the entry deadline
    • Tell coaches to go to TriStateRacer.com/meetresults to enter