Exemplo n.º 1
0
 function process()
 {
     global $CONFIG;
     $query_args = array('_order' => 'e.type,e.open,e.close,e.registration_id');
     $season_id = $_GET['season'];
     if ($season_id > 0) {
         $current_season = Season::load(array('id' => $season_id));
         $query_args['season_id'] = $season_id;
         $this->title = "{$current_season->display_name} Registration";
     } else {
         $this->title = "Registration";
         $query_args['_extra'] = 'e.open < DATE_ADD(NOW(), INTERVAL 1 WEEK) AND e.close > NOW()';
         $season_id = -1;
     }
     $this->template_name = 'pages/event/list.tpl';
     $pulldown_choices = getOptionsFromQuery("SELECT s.id AS theKey, s.display_name AS theValue FROM season s, registration_events e WHERE e.season_id = s.id GROUP BY s.id HAVING count(*) > 0 ORDER BY s.year, s.season");
     $pulldown_choices[-1] = "All open events";
     $this->smarty->assign('seasons', $pulldown_choices);
     $this->smarty->assign('season_id', $season_id);
     $type_desc = event_types();
     $events = array();
     $sth = Event::query($query_args);
     while ($e = $sth->fetchObject('Event')) {
         $e->full_type = $type_desc[$e->type];
         $events[] = $e;
     }
     $this->smarty->assign('events', $events);
     return true;
 }
Exemplo n.º 2
0
 function __construct($id)
 {
     $this->season = Season::load(array('id' => $id));
     if (!$this->season) {
         error_exit("That season does not exist");
     }
     season_add_to_menu($this->season);
 }
Exemplo n.º 3
0
 function __construct($load_mode = LOAD_RELATED_DATA)
 {
     // If we have a parent, override the overridables.
     if ($this->parent_fid) {
         $parent = Field::load(array('fid' => $this->parent_fid));
         $this->name = $parent->name;
         $this->code = $parent->code;
         $this->region = $parent->region;
         $this->location_street = $parent->location_street;
         $this->location_city = $parent->location_city;
         $this->location_province = $parent->location_province;
         $this->location_country = $parent->location_country;
         $this->driving_directions = $parent->driving_directions;
         $this->transit_directions = $parent->transit_directions;
         $this->biking_directions = $parent->biking_directions;
         $this->parking_details = $parent->parking_details;
         $this->washrooms = $parent->washrooms;
         $this->public_instructions = $parent->public_instructions;
         $this->site_instructions = $parent->site_instructions;
         $this->sponsor = $parent->sponsor;
         $this->location_url = $parent->location_url;
         $this->layout_url = $parent->layout_url;
         $this->fullname = join(" ", array($this->name, $this->num));
         $this->is_indoor = $parent->is_indoor;
         // Fields may have their own parking details, or inherit from the parent
         if (!$this->parking) {
             $this->parking = $parent->parking;
         }
     }
     if ($load_mode == LOAD_OBJECT_ONLY) {
         return;
     }
     $current_season_id = strtolower(variable_get("current_season", 1));
     $current_season = Season::load(array('id' => $current_season_id));
     $permit_dir = join("/", array(strtolower($current_season->season), $current_season->year, 'permits'));
     $system_permit_dir = join("/", array(variable_get("league_file_base", '/opt/websites/www.ocua.ca/static-content/leagues'), $permit_dir));
     # Auto-detect the permit URLs
     $this->permit_url = '';
     if (is_dir($system_permit_dir)) {
         if ($dh = opendir($system_permit_dir)) {
             while (($file = readdir($dh)) !== false) {
                 if (fnmatch($this->code . "*", $file)) {
                     $this->permit_url .= l($file, variable_get("league_url_base", 'http://www.ocua.ca/leagues') . "/{$permit_dir}/{$file}\"") . '<br />';
                 }
             }
         }
     }
     if (!$this->rating) {
         # If no rating, mark as unknown
         $this->rating = '?';
     }
     return true;
 }
Exemplo n.º 4
0
 function process()
 {
     global $lr_session;
     $current_season_id = $_GET['season'];
     if (!$current_season_id) {
         $current_season_id = strtolower(variable_get('current_season', 1));
     }
     $current_season = Season::load(array('id' => $current_season_id));
     if (!$current_season) {
         $current_season_id = 1;
         $current_season = Season::load(array('id' => $current_season_id));
     }
     $this->title = "{$current_season->display_name} Leagues";
     $this->template_name = 'pages/league/list.tpl';
     $this->smarty->assign('seasons', getOptionsFromQuery("SELECT id AS theKey, display_name AS theValue FROM season ORDER BY year, id"));
     $this->smarty->assign('current_season', $current_season);
     $current_season->load_leagues();
     $this->smarty->assign('leagues', $current_season->leagues);
     return true;
 }