defined('_JEXEC') or defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); require_once 'components/com_jtips/classes/jtip.class.php'; require_once 'components/com_jtips/classes/jseason.class.php'; require_once 'components/com_jtips/classes/jround.class.php'; require_once 'components/com_jtips/modules/Tips/edit.tmpl.php'; global $database; jTipsSpoofCheck(); $tpl = new EditMode(); $tpl->formData = array('title' => 'Tips Editor'); $ids = jTipsGetParam($_REQUEST, 'cid', array()); //Do we have an existing set of tips? $id = array_shift($ids); if ($id) { $jTip = new jTip($database); $jTip->load($id); $jTip->fillInAdditionalFields(); $season_id = $jTip->season->id; $round_id = $jTip->round->id; $user_id = $jTip->user->id; } else { $season_id = jTipsGetParam($_REQUEST, 'season_id', false); $round_id = jTipsGetParam($_REQUEST, 'round_id', false); $user_id = jTipsGetParam($_REQUEST, 'user_id', false); } //need to select the season, then the round, then list the games //get the seasons $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams(array())); //make a set of options for a select list $season_options = objectsToSelectList($jSeasons, 'name'); $filters = array('Select Season' => makeSelectList($season_options, 'season_id', "id='season_id' onChange='this.form.submit();'", $season_id));