* * Description: Build the form to download an existing export file or * generate a new one */ global $mosConfig_absolute_path, $jLang; require_once 'components/com_jtips/modules/Export/list.tmpl.php'; $tpl = new ListMode(); //Make available objects options $objects = array('' => $jLang['_ADMIN_CONF_NONE'], 'jBadWord' => $jLang['_ADMIN_EXP_BADWORDS'], 'jComment' => $jLang['_ADMIN_EXP_COMMENTS'], 'jGame' => $jLang['_ADMIN_EXP_GAMES'], 'jHistory' => $jLang['_ADMIN_EXP_HISTORY'], 'jRound' => $jLang['_ADMIN_EXP_ROUNDS'], 'jTeam' => $jLang['_ADMIN_EXP_TEAMS'], 'jSeason' => $jLang['_ADMIN_EXP_SEASONS'], 'jTipsUser' => $jLang['_ADMIN_EXP_USERS'], 'jTip' => $jLang['_ADMIN_EXP_TIPS']); $objectsOptions = array(); foreach ($objects as $key => $val) { $objectsOptions[] = jTipsHTML::makeOption($key, $val); } $tpl->selectLists['objects'] = jTipsHTML::selectList($objectsOptions, 'table', "id='table' class='inputbox'", 'value', 'text'); $actionOptions = array(jTipsHTML::makeOption('download', $jLang['_ADMIN_DASH_DOWNLOAD']), jTipsHTML::makeOption('delete', $jLang['_ADMIN_CONF_COMMENTSACTION_DELETE'])); $disableExportButton = 'disabled'; $history = getExportHistory(); $historyOptions = array(); foreach ($history as $item) { if (is_int(strpos($item, '.csv'))) { $disableExportButton = ''; break; } } foreach ($history as $key => $item) { $historyOptions[] = jTipsHTML::makeOption($key, $item); } $tpl->disableExportButton = $disableExportButton; $tpl->selectLists['history'] = jTipsHTML::selectList($historyOptions, 'export_history', "{$disableExportButton} id='export_history' class='inputbox'", 'value', 'text'); $tpl->selectLists['actions'] = jTipsHTML::selectList($actionOptions, 'expAction', "{$disableExportButton} id='expAction', class='inputbox'", 'value', 'text'); $tpl->display();
defined('_JEXEC') or defined('_VALID_MOS') or die('Restricted Access'); /** * Website: www.jtips.com.au * @author Jeremy Roberts * @copyright Copyright © 2009, jTips * @license Commercial - See website for details * * @since 2.1 - 08/10/2008 * @version 2.1 * @package jTips * * Description: Allow file upload and import of data */ global $mosConfig_absolute_path, $mainframe; require_once 'components/com_jtips/modules/Import/list.tmpl.php'; $mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Import/Import.js'></script>"); $tpl = new ListMode(); $file = $mosConfig_absolute_path . '/administrator/components/com_jtips/import.csv'; $tpl->importExists = jTipsFileExists($file); $objects = array('' => $jLang['_ADMIN_CONF_NONE'], 'jBadWord' => $jLang['_ADMIN_EXP_BADWORDS'], 'jGame' => $jLang['_ADMIN_EXP_GAMES'], 'jRound' => $jLang['_ADMIN_EXP_ROUNDS'], 'jTeam' => $jLang['_ADMIN_EXP_TEAMS'], 'jSeason' => $jLang['_ADMIN_EXP_SEASONS']); $objectsOptions = array(); foreach ($objects as $key => $val) { $objectsOptions[] = jTipsHTML::makeOption($key, $val); } $tpl->selectLists['objects'] = jTipsHTML::selectList($objectsOptions, 'importObject', "id='importObject' class='inputbox' onchange='getOptions(this);'", 'value', 'text'); $tpl->noneOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE'])); $tpl->headers = fetchImportRow(); $tpl->row1Data = fetchImportRow(1); $tpl->row2Data = fetchImportRow(2); $tpl->opts = ''; $tpl->display();
$limit = jTipsGetParam($_REQUEST, 'limit', 25); $direction = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc'); if (empty($direction)) { $direction = 'asc'; } $orderby = jTipsGetParam($_REQUEST, 'filter_order', 'name'); if (empty($orderby)) { $orderby = 'name'; } $params = array('order' => array('type' => 'order', 'direction' => $direction, 'by' => $orderby), 'join_users' => array('type' => 'join', 'join_table' => '#__users', 'lhs_table' => '#__jtips_users', 'lhs_key' => 'user_id', 'rhs_table' => '#__users', 'rhs_key' => 'id')); if ($season_id = jTipsGetParam($_REQUEST, 'season_id', false)) { $params['season_id'] = $season_id; } $jTipsUsers = forceArray($jTipsUser->loadByParams($params, $limit, $limitstart)); $pageNav = new mosPageNav($jTipsUser->getCount(), $limitstart, $limit); $data = array(); $i = 0; foreach ($jTipsUsers as $jTipsUserItem) { $scores = $jTipsUserItem->getSummaryScores(); $data[$jTipsUserItem->id] = array("<label for='cb{$i}'>" . $jTipsUserItem->getUserField('name') . "</label>", $jTipsUserItem->getUserField('username'), $jTipsUserItem->getSeasonName(), $jTipsUserItem->doubleup, number_format($scores[$jTipsUserItem->season_id]['average'], 2), $scores[$jTipsUserItem->season_id]['total_points'], '<div style="text-align:center;"><a href="javascript:toggleBoolean(\'' . $jTipsUserItem->id . '\', \'paid\');"><img src="images/' . ($jTipsUserItem->paid ? "tick" : "publish_x") . '.png" id="paid_' . $jTipsUserItem->id . '" border="0" /></div>', '<div style="text-align:center;"><a href="javascript:toggleBoolean(\'' . $jTipsUserItem->id . '\', \'status\');"><img src="images/' . ($jTipsUserItem->status == 1 ? "tick" : "publish_x") . '.png" border="0" id="status_' . $jTipsUserItem->id . '" /></a></div>'); $i++; } $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams()); $options = array(jTipsHTML::makeOption('', $jLang['_ADMIN_USERS_SELECT_SEASON'])); foreach ($jSeasons as $season) { $options[] = jTipsHTML::makeOption($season->id, $season->name); } $filters = array($jLang['_ADMIN_SEASON_SELECT'] => jTipsHTML::selectList($options, 'season_id', "id='season_id' class='inputbox' onChange='this.form.submit();'", 'value', 'text', jTipsGetParam($_REQUEST, 'season_id', ''))); //BUG 217 - 5th arg was teamEdit, changed to list - this is the TASK form field value jTipsAdminDisplay::ListView($formData, $header, $data, $pageNav, 'list', $filters, $jLang['_ADMIN_USERS_INFO'], true);
* Description: */ jTipsSpoofCheck(); global $jTips, $database; require_once 'components/com_jtips/classes/jseason.class.php'; require_once 'components/com_jtips/classes/juser.class.php'; require_once 'components/com_jtips/modules/Users/edit.tmpl.php'; $tpl = new EditMode(); $tpl->formData = array('title' => $jLang['_ADMIN_USERS_TITLE'] . ": " . $jLang['_ADMIN_OTHER_NEW']); $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams()); $options = array(jTipsHTML::makeOption('', $jLang['_ADMIN_USERS_SELECT_SEASON'])); foreach ($jSeasons as $season) { $options[] = jTipsHTML::makeOption($season->id, $season->name); } $filters = array($jLang['_ADMIN_SEASON_SELECT'] => jTipsHTML::selectList($options, 'season_id', "id='season_id' class='inputbox'", 'value', 'text', jTipsGetParam($_REQUEST, 'season_id', '')), $jLang['_ADMIN_SEARCH'] => "<input type='text' name='user_search' value='" . jTipsGetParam($_REQUEST, 'user_search', '') . "' class='inputbox' /> <button type='submit' class='button'>" . $jLang['_ADMIN_GO'] . "</button> <button type='submit' class='button' onclick='this.form.user_search.value=\"\";'>" . $jLang['_ADMIN_RESET'] . "</button>"); $tpl->selectLists = $filters; $currentDir = jTipsGetParam($_REQUEST, 'filter_order_Dir', 'asc'); if ($currentDir == 'asc') { $dir = 'desc'; } else { $dir = 'asc'; } $tpl->nextDir = $dir; if ($user_search = jTipsGetParam($_REQUEST, 'user_search', false)) { $where = "AND (username LIKE '%" . $database->getEscaped($user_search) . "%' OR name LIKE '%" . $database->getEscaped($user_search) . "%')"; } else { $where = ''; } $offset = jTipsGetParam($_REQUEST, 'limitstart', 0); $query = "SELECT COUNT(*) FROM #__users WHERE block = '0' {$where}";
$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); if (intval($jTips['Is24Hour']) == 1) { $tpl->date_end_time_meridiem = ''; } else { $tpl->date_end_time_meridiem = jTipsHTML::selectList($meridiemOptions, 'date_end_time_meridiem', "class='inputbox'", 'value', 'text', $date_end_time_meridiem); } $jSeason = new jSeason($database); $jSeasons = forceArray($jSeason->loadByParams()); $options = array(jTipsHTML::makeOption('', $jLang['_ADMIN_USERS_SELECT_SEASON'])); foreach ($jSeasons as $season) { $options[] = jTipsHTML::makeOption($season->id, $season->name); } $tpl->selectLists['season_id'] = jTipsHTML::selectList($options, 'season_id', "id='season_id' class='inputbox' onChange='getTheRounds(this);'", 'value', 'text', $focus->season_id); $roundOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE'])); $tpl->selectLists['roundnum'] = jTipsHTML::selectList($roundOptions, 'roundnum', "disabled id='roundnum', class='inputbox'", 'value', 'text', $focus->round); $tpl->display();
function display() { global $jLang, $database, $mosConfig_live_site, $Itemid; $left_id_field = $this->left . '_id'; $right_id_field = $this->right . '_id'; $left_score = $this->left . '_score'; $right_score = $this->right . '_score'; ?> <style type='text/css'> #loader2.ajax-loading { background:url(<?php echo $mosConfig_live_site; ?> /components/com_jtips/images/loading.gif) no-repeat center; padding: 20px 0; } </style> <div id="loader2"></div> <div id="games_table"> <form action="index2.php?Itemid=<?php echo $Itemid; ?> " method="post" name="adminForm" id="jTipsRoundProcessForm"> <input type="hidden" name="option" value="com_jtips" /> <input type="hidden" name="view" value="Administration" /> <input type="hidden" name="action" value="SaveRoundResults" /> <input type="hidden" name="<?php echo jTipsSpoofValue(); ?> " value="1" /> <table class="admintable" cellspacing="0" width="100%"> <thead> <tr class="sectiontableheader"> <th><?php echo $jLang['_COM_GAME_' . strtoupper($this->left)]; ?> </th> <th><?php echo $jLang['_COM_GAME_' . strtoupper($this->right)]; ?> </th> <th><?php echo $jLang['_COM_TIPS_' . strtoupper($this->left) . 'SCORE']; ?> </th> <th><?php echo $jLang['_COM_TIPS_' . strtoupper($this->right) . 'SCORE']; ?> </th> <th><?php echo $jLang['_ADMIN_GAME_BONUS']; ?> </th> </tr> </thead> <tbody> <?php $rowIndex = 0; foreach ($this->jGames as $jGame) { $leftTeam = new jTeam($database); $rightTeam = new jTeam($database); $leftTeam->load($jGame->{$left_id_field}); $rightTeam->load($jGame->{$right_id_field}); ?> <tr class="sectiontableentry<?php echo $rowIndex++ % 2 + 1; ?> "> <td align="left"> <input type="hidden" name="cid[]" value="<?php echo $jGame->id; ?> " /> <?php echo $leftTeam->getDisplayLogoName(); ?> </td> <td align="left"><?php echo $rightTeam->getDisplayLogoName(); ?> </td> <td><input type="text" size="5" class="inputbox" autocomplete="off" style="text-align:center;" name="<?php echo $left_score; ?> []" value="<?php echo $jGame->{$left_score}; ?> " /></td> <td><input type="text" size="5" class="inputbox" autocomplete="off" style="text-align:center;" name="<?php echo $right_score; ?> []" value="<?php echo $jGame->{$right_score}; ?> " /></td> <td align="left"> <?php $bonusDD = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']), jTipsHTML::makeOption($leftTeam->id, $leftTeam->getName()), jTipsHTML::makeOption($rightTeam->id, $rightTeam->getName())); if ($this->jSeason->pick_bonus == 2) { $bonusDD[] = jTipsHTML::makeOption(-2, $jLang['_ADMIN_SEASON_EPTB_BOT']); } echo jTipsHTML::selectList($bonusDD, 'bonus_id[]', "class='inputbox' style='width:95%;'", 'value', 'text', $jGame->bonus_id); ?> </td> </tr> <?php } ?> </tbody> </table> <div class="contentheading" style="text-align:center;"> <?php if (isJoomla15()) { ?> <input type="submit" value="<?php echo $jLang['_COM_ADMIN_RESULTS_SAVE_PROCESS']; ?> " name="submit_process" class="button" /> <input type="button" value="<?php echo $jLang['_COM_CANCEL']; ?> " name="cancel" onClick="window.parent.document.getElementById('sbox-window').close();" class="button" /> <?php } else { ?> <input type="submit" value="<?php echo $jLang['_COM_ADMIN_RESULTS_SAVE_PROCESS']; ?> " name="submit_process" class="button" /> <input type="button" value="<?php echo $jLang['_COM_CANCEL']; ?> " name="cancel" onClick="$('mb_close_link').onclick();" class="button" /> <?php } ?> </div> </form> </div> <?php }
* Description: */ global $mainframe; require_once 'components/com_jtips/modules/Customisations/edit.tmpl.php'; $ids = jTipsGetParam($_REQUEST, 'cid', array()); if (empty($ids)) { //mosRedirect('index2.php?option=com_jtips&module=Customisations', $jLang['_ADMIN_CSTM_NO_FILE_SPECIFIED']); } $id = array_shift($ids); $mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/lib/edit_area/edit_area_full.js'></script>"); $mainframe->addCustomHeadTag("<script type='text/javascript' src='components/com_jtips/modules/Customisations/Edit.js'></script>"); $tpl = new EditMode(); if ($id or $id === '0') { $path = $mosConfig_absolute_path . '/components/com_jtips/custom/'; $files = array(); $fileList = findAllFiles($path, $files); $file = $fileList[$id]; $tpl->path = $file; if (isJoomla15()) { jimport('joomla.filesystem.file'); $tpl->content = JFile::read($file); } else { $tpl->content = file_get_contents($file); } } else { $tpl->path = $tpl->content = ''; $viewOptions = array(jTipsHTML::makeOption('', $jLang['_ADMIN_CONF_NONE']), jTipsHTML::makeOption('Administration', 'Administration'), jTipsHTML::makeOption('CompetitionLadder', 'Competition Ladder'), jTipsHTML::makeOption('Dashboard', 'Dashboard'), jTipsHTML::makeOption('Menu', 'Menu'), jTipsHTML::makeOption('TeamLadder', 'Team Ladder'), jTipsHTML::makeOption('Tips', 'Tips Panel'), jTipsHTML::makeOption('UserPreferences', 'User Preferences')); $tpl->viewList = jTipsHTML::selectList($viewOptions, 'view', "class='inputbox'", 'value', 'text'); //$tpl->displayFileSetup(); } $tpl->display();
function parseEditField($def) { global $jTips; if (isset($def['attributes']) and !empty($def['attributes'])) { $attribs = array(); foreach ($def['attributes'] as $name => $value) { // BUG 393 - values with quotes cause invalid HTML $attribs[] = "{$name}=\"" . str_replace('"', "'", jTipsStripslashes($value)) . "\""; } $attributes = implode(" ", $attribs); } else { $attributes = ''; } switch ($def['type']) { case 'label': $html = "<span class='help'>" . $def['attributes']['value'] . "</span>"; break; case 'select': $html = jTipsHTML::selectList($def['options'], $def['attributes']['name'], $attributes, 'value', 'text', $def['selected']); break; case 'date': //BUG 263 - Date fields in J1.0 must be in YYYY-MM-DD format if (!isJoomla15()) { $def['attributes']['value'] = TimeDate::format($def['attributes']['value'], '%Y-%m-%d'); $attributes = preg_replace("/value='[^']*'/i", "value='" . $def['attributes']['value'] . "'", $attributes); } $html = "<input {$attributes} /> <img src='components/com_jtips/images/calendar.png' onclick='return showCalendar(\"{$def['attributes']['name']}\", \"{$jTips['DateFormat']}\");' border='0' alt='...' align='absmiddle' />"; break; case 'bool': $html = jTipsHTML::yesnoRadioList($def['attributes']['name'], $attributes, $def['selected']); break; case 'img': $html = "<img {$attributes} />"; break; case 'textarea': $html = "<textarea {$attributes}>" . jTipsStripslashes($def['text']) . "</textarea>"; break; case 'editor': jTipsInitEditor(); jTipsEditorArea($def['attributes']['name'], jTipsStripslashes($def['attributes']['value']), $def['attributes']['name'], '100%', '300px', 100, 25); jTipsHTML::keepAlive(); return ''; break; default: if (jTipsGetParam($def['attributes'], 'value')) { $def['attributes']['value'] = jTipsStripslashes($def['attributes']['value']); } $html = "<input {$attributes} />"; break; } return $html; }
function display() { global $jLang; ?> <form action='index2.php' method='post' name='adminForm' enctype='multipart/form-data'> <input type='hidden' name='task' value='' /> <input type='hidden' name='option' value='<?php echo jTipsGetParam($_REQUEST, 'option', 'com_jtips'); ?> ' /> <input type='hidden' name='hidemainmenu' value='0' /> <input type="hidden" name="module" value="Import" /> <input type="hidden" name="<?php echo jTipsSpoofValue(); ?> " value="1" /> <?php if (isJoomla15()) { JToolBarHelper::title($jLang['_ADMIN_IMP_HEADER'], 'import'); } else { ?> <table class='adminheading'> <tr> <th><?php echo $jLang['_ADMIN_IMP_HEADER']; ?> </th> </tr> </table> <?php } ?> <?php if ($this->importExists) { ?> <fieldset> <legend><?php echo $jLang['_ADMIN_IMPORT_SETUP_LEGEND']; ?> </legend> <input type="hidden" name="hasFile" id="hasFile" value="1" /> <input type="hidden" name="importFile" value="1" id="importFile" /> <table class='admintable' width="100%"> <tr> <td class="key"><label for="importObject"><?php echo $jLang['_ADMIN_IMP_SELECT_TYPE']; ?> </label></td> <td><?php echo $this->selectLists['objects']; ?> <span id='loading' style='display:none;'><?php echo getAjaxLoading(); ?> </span></td> </tr> <tr id="match_row" style="display:none;"> <td class="key" valign="top"><?php echo $jLang['_ADMIN_IMP_MATCH_SELECT']; ?> :</td> <td><select name="match_on[]" id="match_on" multiple="multiple" class="inputbox"></select></td> </tr> </table> </fieldset> <fieldset> <legend><?php echo $jLang['_ADMIN_IMP_FIELD_MAPPING_LEGEND']; ?> </legend> <table class='adminlist' width="100%"> <thead> <tr> <th width='25%'><?php echo $jLang['_ADMIN_IMP_COL_HEADER']; ?> </th> <th width='25%'><?php echo $jLang['_ADMIN_IMP_FIELD_MAP']; ?> </th> <th width='25%'>Row 1 Data</th> <th width='25%'>Row 2 Data</th> </tr> </thead> <tbody> <?php for ($i = 0; $i < count($this->headers); $i++) { $col = cleanString($this->headers[$i]); $row1 = isset($this->row1Data[$i]) ? $this->row1Data[$i] : ''; $row2 = isset($this->row2Data[$i]) ? $this->row2Data[$i] : ''; ?> <tr class="row<?php echo $i % 2; ?> "> <td class="key" width='25%'><?php echo $col; ?> </td> <td><?php echo jTipsHTML::selectList($this->noneOptions, "importFields[{$col}]", 'disabled id="' . $col . '" class="importFields"', 'value', 'text'); ?> </td> <td style='text-align:left;'><?php echo jTipsHTML::cleanText($row1); ?> </td> <td style='text-align:left;'><?php echo jTipsHTML::cleanText($row2); ?> </td> </tr> <?php } ?> </tbody> </table> </fieldset> <?php } else { ?> <fieldset> <legend><?php echo $jLang['_ADMIN_IMPORT_UPLOAD_LEGEND']; ?> </legend> <input type="hidden" name="hasFile" id="hasFile" value="0" /> <table class='admintable' width="100%"> <tr> <td class="key" width='25%'><label for="importFile"><?php echo $jLang['_ADMIN_IMP_UPLOAD']; ?> </label></td> <td><input type='file' name='importFile' id="importFile" size='40' /></td> </tr> </table> </fieldset> <?php } ?> </form> <?php }