$tpl->date_start_time_minute = jTipsHTML::integerSelectList('00', $end, $step, 'date_start_time_minute', "class='inputbox'", $date_start_time_minute); if (intval($jTips['Is24Hour']) == 1) { $tpl->date_start_time_meridiem = ''; } else { $tpl->date_start_time_meridiem = jTipsHTML::selectList($meridiemOptions, 'date_start_time_meridiem', "class='inputbox'", 'value', 'text', $date_start_time_meridiem); } //now prepare the end_time if (!$focus->end_time) { $focus->end_time = gmdate('Y-m-d H:i:s'); } //BUG 263 if (!isJoomla15()) { $tpl->date_end_date = TimeDate::toDisplayDate($focus->end_time, true); $tpl->date_end_date = TimeDate::toDatabaseDate($tpl->date_end_date); } else { $tpl->date_end_date = TimeDate::toDisplayDate($focus->end_time, true); } $date_end_time_hour = TimeDate::format($focus->end_time, '%I', true); $date_end_time_minute = TimeDate::format($focus->end_time, '%M', true); $date_end_time_meridiem = strtolower(TimeDate::format($focus->end_time, '%p', true)); // BUG 326 - Optionally allo 24-hour format if (intval($jTips['Is24Hour']) == 1) { $hour_end = 23; if ($date_end_time_meridiem == 'pm') { $date_end_time_hour += 12; } } else { $hour_end = 12; } $tpl->date_end_time_hour = jTipsHTML::integerSelectList(1, $hour_end, 1, 'date_end_time_hour', "class='inputbox'", $date_end_time_hour); $tpl->date_end_time_minute = jTipsHTML::integerSelectList('00', $end, $step, 'date_end_time_minute', "class='inputbox'", $date_end_time_minute);
$jGame->tough_score = 0; } } //parse the game time if necessary if ($jSeason->game_times and jTipsGetParam($_REQUEST['start_time_date'], $i, false)) { $start_time_date = jTipsGetParam($_REQUEST['start_time_date'], $i, strftime($jTips['DateFormat'])) . " "; $start_minute = jTipsGetParam($_REQUEST['start_time_minute'], $i, ''); $start_time_time = jTipsGetParam($_REQUEST['start_time_hour'], $i, '') . ":" . str_pad($start_minute, 2, '0', STR_PAD_LEFT) . jTipsGetParam($_REQUEST['start_time_meridiem'], $i, ''); if (!preg_match('/\\d/', $start_time_time)) { $start_time_time = strftime($jTips['TimeFormat']); } $start_time = $start_time_date . " " . $start_time_time; //jTipsDebug($start_time); //BUG 263 - set the date fields if we are in J1.0 if (!isJoomla15()) { $start_time = TimeDate::toDisplayDate($start_time_date) . " " . $start_time_time; } //jTipsDebug($start_time); $jGame->start_time = TimeDate::toDatabaseDateTime($start_time); //jTipsDebug($jGame->start_time); } else { if ($jRound->getStatus() === false) { $jGame->start_time = null; } } //set the game scores if ($jRound->getStatus() !== FALSE) { $jGame->home_score = jTipsGetParam($_REQUEST['home_score'], $i, null); $jGame->away_score = jTipsGetParam($_REQUEST['away_score'], $i, null); /* * Can't put this code here since it will destroy the
function export() { global $database; $query = "SELECT name AS 'Season Name', description AS 'Description', " . "start_time AS 'Season Start', end_time AS 'Season End', " . "rounds AS 'Total Rounds', games_per_round AS 'Games Per Round' " . "FROM " . $this->_tbl; $database->setQuery($query); $rows = $database->loadAssocList(); $lines = $headers = array(); while ($row = current($rows)) { $line = array(); if (empty($headers)) { foreach ($row as $heading => $val) { array_push($headers, $heading); } } foreach ($row as $heading => $val) { if ($heading == 'Season Start' or $heading == 'Season End') { //$val = getLocalDate($val); //BUG 277 - call to undefined function $val = TimeDate::toDisplayDate($val); } array_push($line, str_replace('"', "'", addslashes($val))); } array_push($lines, '"' . implode('","', $line) . '"'); $row = next($rows); } $body = implode("\r\n", $lines); $export = '"' . implode('","', $headers) . '"' . "\r\n" . $body; return $export; }
* * Description: Save the season data from the posted form */ global $mainframe, $database, $mosConfig_absolute_path; //Make sure this is not a hack job jTipsSpoofCheck(); require_once 'components/com_jtips/classes/jseason.class.php'; $jSeason = new jSeason($database); if ($id = jTipsGetParam($_REQUEST, 'id', FALSE)) { $jSeason->load($id); } $jSeason->bind($_REQUEST); //BUG 263 - set the date fields if we are in J1.0 if (!isJoomla15()) { $jSeason->start_time = TimeDate::toDisplayDate($jSeason->start_time); $jSeason->end_time = TimeDate::toDisplayDate($jSeason->end_time); } if ($_FILES['image']['name'] and imageDirCheck()) { $logofile = 'images/jtips/' . $_FILES['image']['name']; if (isJoomla15()) { jimport('joomla.filesystem.file'); jTipsLogger::_log('MOVING ' . $_FILES['image']['tmp_name'] . ' TO ' . $logofile, 'ERROR'); //JFile::move($_FILES['image']['tmp_name'], $mosConfig_absolute_path.'/'.$logofile); //BUG 270 - to complete upload, use the upload function, not move JFile::upload($_FILES['image']['tmp_name'], $mosConfig_absolute_path . '/' . $logofile); } else { if (!is_dir($mosConfig_absolute_path . '/images/jtips') or !file_exists($mosConfig_absolute_path . '/images/jtips')) { mkdir($mosConfig_absolute_path . '/images/jtips'); } move_uploaded_file($_FILES['image']['tmp_name'], $mosConfig_absolute_path . '/' . $logofile); }
* Website: www.jtips.com.au * Created: 09/09/2008 * * Description: * * */ global $jLang, $database, $jTips; //This breaks the shortcuts on the dashboard //jTipsSpoofCheck(); require_once 'components/com_jtips/classes/jseason.class.php'; $ids = jTipsGetParam($_REQUEST, 'cid', array()); //Do we have an existing Season? $id = array_shift($ids); $jSeason = new jSeason($database); if (is_numeric($id)) { $jSeason->load($id); } else { $jSeason->start_time = $jSeason->end_time = gmdate('Y-m-d H:i:s'); } $title = $jLang['_ADMIN_SEASON_MANAGER'] . ": " . ($jSeason->exists() ? $jLang['_ADMIN_OTHER_EDIT'] : $jLang['_ADMIN_OTHER_NEW']); $formData = array('core' => array('legend' => '_ADMIN_SEASON_CORE_FIELDS_FS', 'fields' => array('id' => array('field' => array('type' => 'hidden', 'attributes' => array('type' => 'hidden', 'name' => 'id', 'id' => 'id', 'value' => $jSeason->id))), 'name' => array('label' => '_ADMIN_SEASON_NAME', 'field' => array('type' => 'text', 'attributes' => array('size' => '50', 'type' => 'text', 'class' => 'inputbox', 'name' => 'name', 'id' => 'name', 'value' => $jSeason->name))), 'url' => array('label' => '_ADMIN_SEASON_LINKURL', 'field' => array('type' => 'text', 'attributes' => array('type' => 'text', 'size' => '50', 'class' => 'inputbox', 'name' => 'url', 'id' => 'url', 'value' => $jSeason->url))), 'tip_display' => array('label' => '_ADMIN_SEASON_TIPSDISPLAY', 'field' => array('type' => 'select', 'attributes' => array('class' => 'inputbox', 'name' => 'tip_display', 'id' => 'tip_display'), 'options' => array(jTipsHTML::makeOption(0, $jLang['_ADMIN_SEASON_NAMEONLY']), jTipsHTML::makeOption(1, $jLang['_ADMIN_SEASON_LOGOONLY']), jTipsHTML::makeOption(2, $jLang['_ADMIN_SEASON_NAMELOGO'])), 'selected' => $jSeason->tip_display)), 'tips_layout' => array('label' => '_ADMIN_CONF_TIPS_PANEL_LAYOUT', 'field' => array('type' => 'select', 'attributes' => array('class' => 'inputbox', 'name' => 'tips_layout', 'id' => 'tips_layout'), 'options' => array(jTipsHTML::makeOption('home', $jLang['_ADMIN_CONF_HOME']), jTipsHTML::makeOption('away', $jLang['_ADMIN_CONF_AWAY'])), 'selected' => $jSeason->tips_layout), 'description' => '_ADMIN_CONF_TIPS_PANEL_LAYOUT_DEF'), 'start_time' => array('label' => '_ADMIN_SEASON_START_DATE', 'field' => array('type' => 'date', 'attributes' => array('name' => 'start_time', 'id' => 'start_time', 'value' => TimeDate::toDisplayDate($jSeason->start_time), 'class' => 'inputbox', 'type' => 'text')), 'description' => '_ADMIN_SEASON_START_DATE_DEF'), 'end_time' => array('label' => '_ADMIN_SEASON_END_DATE', 'field' => array('type' => 'date', 'attributes' => array('name' => 'end_time', 'id' => 'end_time', 'value' => TimeDate::toDisplayDate($jSeason->end_time), 'class' => 'inputbox', 'type' => 'text')), 'description' => '_ADMIN_SEASON_END_DATE_DEF'), 'rounds' => array('label' => '_ADMIN_SEASON_ROUNDS', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'rounds', 'id' => 'rounds', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->rounds))), 'disable_tips' => array('label' => '_ADMIN_SEASON_DISABLE_TIPS', 'description' => '_ADMIN_SEASON_DISABLE_TIPS_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'disable_tips', 'id' => 'disable_tips'), 'selected' => $jSeason->disable_tips)), 'scorer_id' => array('label' => '_ADMIN_SEASON_SCORER', 'description' => '_ADMIN_SEASON_SCORER_DEF', 'field' => array('type' => 'select', 'attributes' => array('id' => 'scorer_id', 'name' => 'scorer_id', 'class' => 'inputbox'), 'selected' => $jSeason->scorer_id, 'options' => jTipsGetAvailableScorers())), 'description' => array('label' => '_ADMIN_SEASON_DESCR', 'field' => array('type' => 'editor', 'attributes' => array('name' => 'description', 'id' => 'description', 'rows' => 10, 'cols' => 50, 'value' => jTipsStripslashes($jSeason->description))))))); $formData['image'] = array('legend' => '_ADMIN_SEASON_LOGO_PATH', 'fields' => array('imageupload' => array('label' => '_ADMIN_SEASON_LOGO_PATH', 'field' => array('type' => 'file', 'attributes' => array('size' => '50', 'type' => 'file', 'class' => 'inputbox', 'name' => 'image', 'id' => 'image', 'value' => $jSeason->image))))); if ($jSeason->image) { $formData['image']['fields']['current_image'] = array('label' => '_ADMIN_TEAM_CURRENT_LOGO', 'field' => array('type' => 'img', 'attributes' => array('alt' => 'Logo', 'id' => 'current_logo', 'src' => $mosConfig_live_site . '/' . $jSeason->image))); $formData['image']['fields']['remove_image'] = array('label' => '_ADMIN_TEAM_REMOVE_LOGO', 'field' => array('type' => 'checkbox', 'attributes' => array('class' => 'inputbox', 'name' => 'remove_image', 'value' => '1', 'type' => 'checkbox', 'onClick' => 'if (this.checked){$("image").disabled=true;}else{$("image").disabled=false}')), 'description' => '_ADMIN_TEAM_REMOVE_LOGO_DEF'); } $formData['team_points'] = array('legend' => '_ADMIN_SEASON_TEAM_POINTS_FS', 'fields' => array('team_win' => array('label' => '_ADMIN_SEASON_TWP', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_win', 'id' => 'team_win', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_win)), 'description' => '_ADMIN_SEASON_TWP_DEF'), 'team_draw' => array('label' => '_ADMIN_SEASON_TDP', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_draw', 'id' => 'team_draw', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_draw)), 'description' => '_ADMIN_SEASON_TDP_DEF'), 'team_lose' => array('label' => '_ADMIN_SEASON_TLP', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_lose', 'id' => 'team_lose', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_lose)), 'description' => '_ADMIN_SEASON_TLP_DEF'), 'team_bye' => array('label' => '_ADMIN_SEASON_TBP', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_bye', 'id' => 'team_bye', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_bye)), 'description' => '_ADMIN_SEASON_TBP_DEF'), 'team_bonus' => array('label' => '_ADMIN_SEASON_BONUS_TEAM', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'team_bonus', 'id' => 'team_bonus', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->team_bonus))), 'team_starts' => array('label' => '_ADMIN_SEASON_ETS', 'description' => '_ADMIN_SEASON_ETS_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'team_starts', 'id' => 'team_starts'), 'selected' => $jSeason->team_starts)))); $formData['points_configuration'] = array('legend' => '_ADMIN_SEASON_TIPS_CONFIG_FS', 'fields' => array('pick_score' => array('label' => '_ADMIN_SEASON_EPTS', 'description' => '_ADMIN_SEASON_EPTS_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'pick_score', 'id' => 'pick_score'), 'selected' => $jSeason->pick_score)), 'pick_margin' => array('label' => '_ADMIN_SEASON_EPTM', 'description' => '_ADMIN_SEASON_EPTM_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'pick_margin', 'id' => 'pick_margin'), 'selected' => $jSeason->pick_margin)), 'pick_draw' => array('label' => '_ADMIN_SEASON_EPTD', 'description' => '_ADMIN_SEASON_EPTD_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'pick_draw', 'id' => 'pick_draw'), 'selected' => $jSeason->pick_draw)), 'pick_bonus' => array('label' => '_ADMIN_SEASON_EPTB', 'description' => '_ADMIN_SEASON_EPTB_DEF', 'field' => array('type' => 'select', 'attributes' => array('class' => 'inputbox', 'name' => 'pick_bonus', 'id' => 'pick_bonus'), 'selected' => $jSeason->pick_bonus, 'options' => array(jTipsHTML::makeOption(0, $jLang['_ADMIN_SEASON_EPTB_DIS']), jTipsHTML::makeOption(1, $jLang['_ADMIN_SEASON_EPTB_SIN']), jTipsHTML::makeOption(2, $jLang['_ADMIN_SEASON_EPTB_BOT'])))), 'game_times' => array('label' => '_ADMIN_SEASON_GAME_TIMES', 'description' => '_ADMIN_SEASON_GAME_TIMES_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'game_times', 'id' => 'game_times'), 'selected' => $jSeason->game_times)), 'tough_score' => array('label' => '_ADMIN_SEASON_TOUGH_SCORE', 'description' => '_ADMIN_SEASON_TOUGH_SCORE_DEF', 'field' => array('type' => 'bool', 'attributes' => array('class' => 'inputbox', 'name' => 'tough_score', 'id' => 'tough_score'), 'selected' => $jSeason->tough_score)))); $formData['user_points'] = array('legend' => '_ADMIN_SEASON_USER_POINTS_FS', 'fields' => array('user_correct' => array('label' => '_ADMIN_SEASON_UCORR', 'description' => '_ADMIN_SEASON_UCORR_DEF', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_correct', 'id' => 'user_correct', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_correct))), 'user_draw' => array('label' => '_ADMIN_SEASON_UDRAW', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_draw', 'id' => 'user_draw', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_draw))), 'user_none' => array('label' => '_ADMIN_SEASON_UNONE', 'description' => '_ADMIN_SEASON_UNONE_DEF', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_none', 'id' => 'user_none', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_none))), 'precision_score' => array('label' => '_ADMIN_SEASON_PRECISION', 'description' => '_ADMIN_SEASON_PRECISION_DEF', 'field' => array('type' => 'bool', 'attributes' => array('name' => 'precision_score', 'id' => 'precision_score'), 'selected' => $jSeason->precision_score)), 'user_bonus' => array('label' => '_ADMIN_SEASON_UPERF', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_bonus', 'id' => 'user_bonus', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_bonus))), 'user_pick_score' => array('label' => '_ADMIN_SEASON_USCOR', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_pick_score', 'id' => 'user_pick_score', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_pick_score))), 'user_pick_margin' => array('label' => '_ADMIN_SEASON_UMARG', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_pick_margin', 'id' => 'user_pick_margin', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_pick_margin))), 'user_pick_bonus' => array('label' => '_ADMIN_SEASON_UBONU', 'field' => array('type' => 'text', 'attributes' => array('class' => 'inputbox', 'name' => 'user_pick_bonus', 'id' => 'user_pick_bonus', 'style' => 'text-align:center', 'size' => 10, 'value' => $jSeason->user_pick_bonus))), 'default_points' => array('label' => '_ADMIN_SEASON_DEFAULT_POINTS', 'description' => '_ADMIN_SEASON_DEFAULT_POINTS_DEF', 'field' => array('type' => 'select', 'attributes' => array('name' => 'default_points', 'id' => 'default_points', 'class' => 'inputbox'), 'options' => array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']), jTipsHTML::makeOption('low', $jLang['_ADMIN_SEASON_DEFAULT_POINTS_LOW']), jTipsHTML::makeOption('avg', $jLang['_ADMIN_SEASON_DEFAULT_POINTS_AVG'])), 'selected' => $jSeason->default_points)))); jTipsAdminDisplay::EditView($title, $formData, 'season');
function display() { global $jTipsCurrentUser, $database, $mainframe, $mosConfig_absolute_path, $jLang, $jTips, $mosConfig_live_site; $width = $jTips['ShowTipsWidth'] - 40; ?> <style type="text/css"> @import url(<?php echo $mosConfig_live_site; ?> /templates/<?php echo jTipsGetTemplateName(); ?> /css/template.css); @import url(<?php echo $mosConfig_live_site; ?> /components/com_jtips/css/jtips-popup.css); </style> <?php if ($jTips['ShowTipsPadding']) { ?> <div style="float:left;padding-top:10px;padding-left:10px;padding-right:10px;padding-bottom:10px;width:<?php echo $width; ?> px;text-align:center;"> <?php } if (!empty($this->jTeam->url)) { ?> <div style="float:right;"> <a href="<?php echo $this->jTeam->url; ?> " target="_blank"><img src="images/M_images/weblink.png" align="absmiddle" border="0" alt="<?php echo $jLang['_COM_TEAM_HOME_PAGE']; ?> " title="<?php echo $this->jTeam->url; ?> " /></a> <a href="<?php echo $this->jTeam->url; ?> " target="_blank"><?php echo preg_replace('/.*[^\\/]:\\/+/i', '', $this->jTeam->url); ?> </a> </div> <?php } ?> <h1 align="left"><?php echo $this->jTeam->getName(); ?> </h1> <?php $img = ''; if (!empty($this->jTeam->logo) and jTipsFileExists($mosConfig_absolute_path . '/' . getJtipsImage($this->jTeam->logo, 100))) { $path = getJtipsImage($this->jTeam->logo, 100); $name = $this->jTeam->getName(); $img = "<img src='{$mosConfig_live_site}/{$path}' align='left' border='1' style='margin-right:10px;margin-bottom:10px;' alt='{$name}' />"; } $about = $img . jTipsStripslashes($this->jTeam->about); if (!empty($about)) { ?> <p style="padding-top:5px;" align="left"> <?php echo $about; ?> </p> <?php } ?> <div style="clear:both;"> </div> <h2 align="center" class="contentheading"><?php echo $jLang['_COM_TEAM_HISTORY']; ?> </h2> <table width="100%" border="0" cellspacing="0"> <thead> <tr class="sectiontableheader"> <th><?php echo $jLang['_COM_DASH_ROUND']; ?> </th> <th><?php echo $jLang['_ADMIN_ROUND_DATE']; ?> </th> <th><?php echo $jLang['_COM_TEAM_VS']; ?> </th> <th><?php echo $jLang['_ADMIN_TEAM_LOCATION']; ?> </th> <th><?php echo $jLang['_COM_SCORE']; ?> </th> <th><?php echo $jLang['_COM_TIPS_RESULT']; ?> </th> </tr> </thead> <tbody> <?php $rowIndex = 0; $history = $this->jTeam->getHistory(); foreach ($history as $game) { $other = new jTeam($database); if ($this->jTeam->id == $game->home_id) { $other->load($game->away_id); $location = $jLang['_COM_TEAM_HOME']; } else { $other->load($game->home_id); $location = $jLang['_COM_TEAM_AWAY']; } $isBye = false; if (!$other->id) { $isBye = true; } if ($game->winner_id == $this->jTeam->id) { $result = 'tick'; $alt = $jLang['_COM_TEAM_WIN']; } else { if ($game->winner_id == '-1') { $result = 'draw'; $alt = $jLang['_COM_TEAM_DRAW']; } else { $result = 'cross'; $alt = $jLang['_COM_TEAM_LOSS']; } } $date = TimeDate::toDisplayDate($game->start_time, true, false); $live_site = $mainframe->getCfg('live_site'); if (strrpos($live_site, '/') == strlen($live_site) - 1) { $live_site = substr($live_site, 0, -1); } $thisRowIndex = $rowIndex++; ?> <tr class="sectiontableentry<?php echo $thisRowIndex % 2 + 1; ?> jtablerow<?php echo $thisRowIndex % 2 + 1; ?> "> <td align="center"><?php echo $game->round; ?> .</td> <td align="left"><?php echo $date; ?> </td> <td align="left"><?php echo $isBye ? '<em>' . $jLang['_COM_BYE'] . '</em>' : $other->getDisplayLogoName(); ?> </td> <td align="center"><?php echo $isBye ? ' ' : $location; ?> </td> <td align="center"><?php echo $isBye ? ' ' : $game->home_score . ' - ' . $game->away_score; ?> </td> <td align="center"><img src="<?php echo $mosConfig_live_site; ?> /components/com_jtips/images/<?php echo $result; ?> .png" alt="<?php echo $alt; ?> " title="<?php echo $alt; ?> " border="0" /></td> </tr> <?php } ?> </tbody> </table> <?php if ($jTips['ShowTipsPadding']) { echo "</div>"; } }
function display() { global $mainframe, $database, $jTips, $jLang, $jLicence, $mosConfig_absolute_path, $mosConfig_live_site, $database; jTipsLogger::_log('Loading dashboard', 'INFO'); jTipsCommonHTML::loadOverlib(); $option = jTipsGetParam($_REQUEST, 'option', 'com_jtips'); if (isJoomla15()) { JToolbarHelper::title($jLang['_ADMIN_DASH_CPANEL'], 'frontpage'); } else { ?> <table class="adminheading" border="0" width="100%"> <tr> <th class="cpanel" align="left"><?php echo $jLang['_ADMIN_DASH_CPANEL']; ?> </th> <td align="right"><a href="http://www.jtips.com.au" target="_blank" title="jTips Home"><img src="<?php echo $mosConfig_live_site; ?> /components/com_jtips/images/license_logo.png" alt="" border="0" /></a></td> </tr> </table> <?php } ?> <table class="adminform"> <tr> <td width="55%" valign="top"> <?php jTipsLogger::_log('Building dashboard icons', 'INFO'); foreach ($this->menu as $item) { if (isset($item['url']) and !empty($item['url'])) { $link = $item['url']; $extra = "target='_blank'"; } else { $link = "index2.php?option={$option}&task=" . $item['task']; $extra = ""; } ?> <div id="cpanel" style="float:left;"> <div class="icon"> <a href="<?php echo $link; ?> " <?php echo $extra; ?> > <img src="components/com_jtips/images/<?php echo $item['image']; ?> " alt="<?php echo $jLang[$item['alt']]; ?> " align="middle" border="0" /><span><?php echo $jLang[$item['link']]; ?> </span></a> </div> </div> <?php } ?> </td> <td width="45%" valign="top"> <div style="width: 100%;"> <?php $tabs = new jTipsTabs(1); $tabs->startPane('dashpanel'); $tabs->startTab($jLang['_ADMIN_DASH_TAB_SUMMARY'], 'summary'); $center = "style='text-align:center;'"; ?> <table class='adminlist'> <thead> <tr> <th><?php echo $jLang['_COM_DASH_SEASON']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_COM_DASH_CURR_ROUND']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_TOTAL_USERS']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_PENDING_TIPS']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_PENDING_PAYMENT']; ?> </th> </tr> </thead> <tbody> <?php jTipsLogger::_log('Loading season data', 'INFO'); $total_user_count = 0; foreach ($this->jSeasons as $jSeason) { if (TimeDate::toDatabaseDate($jSeason->end_time) > gmdate('Y-m-d')) { $round_id = $jSeason->getCurrentRound(); $jRound = new jRound($database); if ($round_id) { $jRound->load($round_id); } $jTipsUsers = $jSeason->getUsers(); $total_users = 0; $no_tips = 0; $has_paid = 0; $no_tips_overlib = ""; foreach ($jTipsUsers as $jTipsUser) { $total_users++; if (!$jTipsUser->hasTipped($jRound->id)) { $no_tips++; if ($no_tips < 10) { $no_tips_overlib .= "<br />" . htmlentities($jTipsUser->getName()); } else { if ($no_tips == 10) { $no_tips_overlib .= "<br />...more"; } } } if ($jTipsUser->paid == 1) { $has_paid++; } } if ($jTips['Payments'] != 0) { $pending_payment = $total_users - $has_paid; } else { $pending_payment = "N/A"; } $no_tips_overlib = substr($no_tips_overlib, 6); if ($no_tips > 0) { $no_tips_overlib_call = jTipsToolTip($no_tips_overlib, "Users Missing Tips"); } else { $no_tips_overlib_call = ''; } ?> <tr> <td><?php echo $jSeason->name; ?> </td> <td <?php echo $center; ?> ><?php echo $jRound->round; ?> </td> <td <?php echo $center; ?> ><?php echo $total_users; ?> </td> <td <?php echo $center; ?> ><?php echo $no_tips . " " . $no_tips_overlib_call; ?> </td> <td <?php echo $center; ?> ><?php echo $pending_payment; ?> </td> </tr> <?php $total_user_count += $total_users; } } ?> </tbody> </table> <?php $tabs->endTab(); $tabs->startTab($jLang['_ADMIN_DASH_TAB_UPDATED'], 'update'); $filesWritable = filesWritable(); ?> <table class="adminlist" width="100%"> <thead> <tr> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_UPG_THISVERSION']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_UPG_LATESTVERSION']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_UPG_UPGRADE']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_UPG_FILE_CHECK']; ?> </th> </tr> </thead> <tbody> <tr> <td <?php echo $center; ?> ><?php echo getFullVersion(); ?> </td> <!-- td <?php echo $center; ?> id="latest_version"><input type="button" onclick="liveCheckLatestVersion('latest_version');" class="button" value="Check Now" <?php if (!$filesWritable) { echo "disabled"; } ?> /></td --> <td <?php echo $center; ?> >N/A</td> <!-- td <?php echo $center; ?> ><span id="liveupdatespan"><?php echo getUpdateButton('', ''); ?> </span></td --> <td <?php echo $center; ?> >N/A</td> <td <?php echo $center; ?> > <?php if ($filesWritable) { $tip = $jLang['_ADMIN_DASH_UPG_FILE_CHECK_OK']; $tipTitle = $jLang['_ADMIN_DASH_UPG_FILE_CHECK_OK_TITLE']; $img = 'checkin.png'; echo jTipsToolTip($tip, $tipTitle, '', $img); } else { $tip = $jLang['_ADMIN_DASH_UPG_FILE_CHECK_FAIL']; $tipTitle = $jLang['_ADMIN_DASH_UPG_FILE_CHECK_FAIL_TITLE']; $img = 'warning.png'; ?> <a href=> <?php echo jTipsToolTip($tip, $tipTitle, '', $img, '', "index2.php?option=com_jtips&module=Upgrade&task=list"); ?> </a> <?php } ?> </td> </tr> <?php if (needsUpgrade()) { ?> <tr> <td colspan="4" id="upgrade_area" <?php echo $center; ?> > <input type="button" class="button" name="upgrade" value="<?php echo $jLang['_ADMIN_UPGRADE_BUTTON']; ?> " onclick="doUpgrade(this);" /> </td> </tr> <?php } ?> </tbody> <thead> <tr> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_LAST_VALIDATED']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_VALIDATION']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_DASH_EXPIRY_DATE']; ?> </th> <th <?php echo $center; ?> ><?php echo $jLang['_ADMIN_LICENSE_USER_COUNT']; ?> </th> </tr> </thead> <tbody> <tr> <td <?php echo $center; ?> ><?php $validation_date = $jLicence->getValidationDate(); if ($validation_date == -1) { echo $jLang['_ADMIN_DASH_LIC_EXPIRED']; } else { echo $validation_date; } ?> </td> <td <?php echo $center; ?> ><a href="index2.php?option=com_jtips&task=Validate&module=Dashboard"><?php echo $jLang['_ADMIN_DASH_REVALIDATE']; ?> </a></td> <td <?php echo $center; ?> ><?php echo TimeDate::toDisplayDate($jLicence->licence['license_expiry']); ?> </td> <td <?php echo $center; ?> ><?php echo $jLicence->getActiveUserCount(); ?> / <?php echo $jLicence->getLicensedUsers(); ?> </td> </tr> </tbody> <thead> <tr> <th <?php echo $center; ?> colspan="4"><?php echo $jLang['_ADMIN_DASH_LOGGING']; ?> </th> </tr> </thead> <tbody> <tr> <td nowrap><?php echo $jLang['_ADMIN_DASH_FILE_SIZE']; ?> : <?php echo size_readable(filesize($mosConfig_absolute_path . '/components/com_jtips/jtips.log')); ?> </td> <td <?php echo $center; ?> ><a href="index2.php?option=com_jtips&task=DownloadLog&module=Dashboard"><?php echo $jLang['_ADMIN_DASH_DOWNLOAD']; ?> </a></td> <td <?php echo $center; ?> ><a href="index2.php?option=com_jtips&task=PurgeLog&module=Dashboard"><?php echo $jLang['_ADMIN_DASH_PURGE']; ?> </a></td> <td> </td> </tr> </tbody> <tfoot> <tr> <td colspan="4"><small><em><?php echo $jLang['_ADMIN_DASH_LOG_ROTATED']; ?> </em></small></td> </tr> </tfoot> </table> <?php $tabs->endTab(); $tabs->startTab($jLang['_ADMIN_DASH_TAB_ABOUT'], 'about'); ?> <div style="text-align:center;"><img src="components/com_jtips/images/logo.png" border="0" /> <h1><?php echo getFullVersion(); ?> </h1></div> <p><?php echo $jLang['_ADMIN_DASH_ABOUT_UPDATES']; ?> <a href="http://www.jtips.com.au/" target="_blank">http://www.jtips.com.au</a></p> <p><?php echo $jLang['_ADMIN_DASH_ABOUT_SALES']; ?> <a href="mailto:sales@jtips.com.au?subject=jTips Enquiry">sales@jtips.com.au</a></p> <p><?php echo $jLang['_ADMIN_DASH_ABOUT_SUPPORT']; ?> <a href="http://www.jtips.com.au" target="_blank">jTips.com.au</a></p> <p><?php echo $jLang['_ADMIN_DASH_ABOUT_REBUILD']; ?> <a href="#" onclick="sendRebuildRequest('rebuildProgress');">» <?php echo $jLang['_COMMON_CLICK_HERE']; ?> «</a> <span id="rebuildProgress"></span></p> <?php $tabs->endTab(); $tabs->startTab($jLang['_ADMIN_DASH_TAB_CREDITS'], 'credits'); ?> <p><strong><?php echo $jLang['_ADMIN_DASH_CREDITS']; ?> :</strong></p> <table class="adminlist" width="100%"> <thead> <tr> <th><?php echo $jLang['_ADMIN_DASH_CREDITS_PACKAGE']; ?> </th> <th><?php echo $jLang['_ADMIN_DASH_CREDITS_HOMEPAGE']; ?> </th> </tr> </thead> <tbody> <tr> <td>mootools</td> <td><a href="http://mootools.net/" target="_blank">http://mootools.net</a></td> </tr> <tr> <td>tnimg</td> <td><a href="http://vagh.armdex.com/tnimg" target="_blank">http://vagh.armdex.com/tnimg</a></td> </tr> <tr> <td>cURL</td> <td><a href="http://www.phpclasses.org/browse/package/1988.html" target="_blank">http://www.phpclasses.org</a></td> </tr> <tr> <td>dUnzip2</td> <td><a href="http://www.phpclasses.org/browse/package/2495.html" target="_blank">http://www.phpclasses.org</a></td> </tr> <tr> <td>MOOdalBox</td> <td><a href="http://www.e-magine.ro/web-dev-and-design/36/moodalbox/" target="_blank">http://www.e-magine.ro</a></td> </tr> <tr> <td>Silk Icons</td> <td><a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">http://www.famfamfam.com</a></td> </tr> <tr> <td>datejs</td> <td><a href="http://www.datejs.com/" target="_blank">http://www.datejs.com</a></td> </tr> <tr> <td>strftime in javascript</td> <td><a href="http://tech.bluesmoon.info/2008/04/strftime-in-javascript.html" target="_blank">http://tech.bluesmoon.info/2008/04/strftime-in-javascript.html</a></td> </tr> <tr> <td>Editor Area</td> <td><a href="http://www.cdolivet.net/editarea/" target="_blank">http://www.cdolivet.net/editarea</a></td> </tr> <tr> <td>GNOME Icons</td> <td><a href="http://commons.wikimedia.org/wiki/GNOME_Desktop_icons" target="_blank">http://commons.wikimedia.org/wiki/GNOME_Desktop_icons</a></td> </tr> </tbody> </table> <?php $tabs->endTab(); $tabs->startTab($jLang['_ADMIN_DASH_TAB_HELP'], 'help'); ?> <h2><?php echo $jLang['_ADMIN_DASH_HELP']; ?> </h2> <p><?php echo $jLang['_ADMIN_DASH_HELP_INTRO']; ?> <a href="http://www.jtips.com.au" target="_blank">www.jtips.com.au</a></p> <ul> <li><?php echo $jLang['_ADMIN_DASH_HELP_GETTING_STARTED']; ?> </li> <li><?php echo $jLang['_ADMIN_DASH_HELP_GUIDES']; ?> </li> <li><?php echo $jLang['_ADMIN_DASH_HELP_TRICKS']; ?> </li> </ul> <p>Do you have an invalid license key? Please contact jTips Support at <a href="mailto:support@jtips.com.au">support@jtips.com.au</a> and confirm your license key is valid for the domain <strong><?php echo $_SERVER['SERVER_NAME']; ?> </strong>.</p> <?php $tabs->endTab(); $tabs->endPane(); ?> </div> </td> </tr> </table> <?php }
function export() { global $database; $query = "SELECT u.name AS 'Full Name', u.username AS 'User Name', " . "s.name AS 'Season Name', r.round AS 'Round', c.comment As 'Comment', " . "c.updated AS 'Last Modified' " . "FROM " . $this->_tbl . " c JOIN jos_jtips_rounds r ON c.round_id = r.id " . "JOIN #__jtips_seasons s ON r.season_id = s.id " . "JOIN #__jtips_users ju ON c.user_id = ju.id " . "JOIN #__users u ON ju.user_id = u.id"; $database->setQuery($query); $rows = $database->loadAssocList(); $lines = $headers = array(); while ($row = current($rows)) { $line = array(); if (empty($headers)) { foreach ($row as $heading => $val) { array_push($headers, $heading); } } foreach ($row as $heading => $val) { if ($heading == 'Last Modified') { //$val = getLocalDate($val); //BUG 277 - call to undefined function $val = TimeDate::toDisplayDate($val); } array_push($line, str_replace('"', "'", addslashes($val))); } array_push($lines, '"' . implode('","', $line) . '"'); $row = next($rows); } $body = implode("\r\n", $lines); $export = '"' . implode('","', $headers) . '"' . "\r\n" . $body; return $export; }
?> </th> </tr> </thead> <tbody> <tr class='sectiontableentry1 jtablerow1'> <td><?php echo $this->jRound->round; ?> </td> <td><?php echo $this->jSeason->rounds; ?> </td> <!-- td><?php echo $this->jSeason->games_per_round; ?> </td --> <td><?php echo TimeDate::toDisplayDate($this->jSeason->start_time, true, false); ?> </td> <td><?php echo TimeDate::toDisplayDate($this->jSeason->end_time, true, false); ?> </td> </tr> </tbody> </table> <?php }