示例#1
0
function getSummaryDetail(&$jTipsUser, $col)
{
    global $database, $jTips, $jLang, $mosConfig_live_site;
    $Itemid = jTipsGetParam($_REQUEST, 'Itemid', '');
    $jSeason = new jSeason($database);
    $jSeason->load($jTipsUser->season_id);
    switch ($col) {
        case 'season':
            return $jSeason->name;
            break;
        case 'rank':
            $rank = $jTipsUser->getRank();
            if (empty($rank)) {
                return "N/A";
            } else {
                return $rank . " / " . $jTipsUser->getTotalUsers();
            }
            break;
        case 'score':
            return $jTipsUser->getTotalScore('points');
            break;
        case 'average':
            $jRound = new jRound($database);
            $jRound->load($jSeason->getLastRound());
            $round = $jRound->round ? $jRound->round : 1;
            return round($jTipsUser->getTotalScore('points') / $round, 1);
            break;
        case 'precision':
            return $jTipsUser->getTotalScore('precision');
            break;
        case 'projected':
            $jRound = new jRound($database);
            $jRound->load($jSeason->getLatestRound());
            $round = $jRound->round ? $jRound->round : 1;
            $average = $jTipsUser->getTotalScore('points') / $round;
            return round($average * $jSeason->rounds, 1);
            break;
        case 'doubleup':
            return "<img src='{$mosConfig_live_site}/administrator/images/" . ($jTipsUser->doubleup > 0 ? "publish_x.png' title='" . $jLang['_COM_DASH_ROUND'] . " " . $jTipsUser->doubleup . "'" : "tick.png' />");
            break;
        case 'paid':
            global $Itemid;
            if ($jTips['Payments'] == 'paypal' and !$jTipsUser->paid) {
                $sid = $jSeason->id;
                if (!$sid) {
                    $sid = getSeasonID();
                }
                return parsePayPalCode($jTips['PayPal'], 'join', $sid);
            } else {
                if ($jTips['Payments'] == 'manual' and !$jTipsUser->paid) {
                    return "<img src='{$mosConfig_live_site}/administrator/images/publish_x.png' />";
                } else {
                    if ($jTips['Payments'] and $jTipsUser->paid) {
                        $confirm_unsub = 'return confirm("' . $jLang['_COM_UNSUBLINK_PART1'] . ' ' . $jSeason->name . ' ' . $jLang['_COM_UNSUBLINK_PART2'] . '");';
                        return "<div style='text-align:center;'>\n\t\t\t\t\t\t\t<img src='{$mosConfig_live_site}/administrator/images/tick.png' alt='Paid' border='0' />\n\t\t\t\t\t\t\t<!-- br />\n\t\t\t\t\t\t\t<a href='" . jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}&view=Dashboard&action=remove&season={$jSeason->id}") . "' onclick='" . $confirm_unsub . "'>" . $jLang['_COM_UNSUBSCRIBE'] . "</a -->\n\t\t\t\t\t\t</div>";
                    } else {
                        return "-";
                    }
                }
            }
            /*if ($jTips['Payments'] == 'paypal') {
            			if (!$jTipsUser->paid) {
            				return parsePayPalCode($jTips['PayPal'], 'join', $jSeason->id);
            			} else {
            				$confirm_unsub = 'return confirm("' . $jLang['_COM_UNSUBLINK_PART1'] . ' ' . $jSeason->name . ' ' . $jLang['_COM_UNSUBLINK_PART2'] . '");';
            				return "<div style='text-align:center;'>
            							<img src='$mosConfig_live_site/administrator/images/tick.png' alt='Paid' border='0' />
            							<br />
            							<a href='" .jTipsRoute("index.php?option=com_jtips&Itemid=$Itemid&view=Dashboard&action=remove&season={$jSeason->id}"). "' onclick='" .$confirm_unsub ."'>" .$jLang['_COM_UNSUBSCRIBE']. "</a>
            						</div>";
            			}
            		} else if ($jTips['Payments'] == 'manual') {
            			return "<img src='$mosConfig_live_site/administrator/images/" .($jTipsUser->paid == 1 ? "tick.png" : "publish_x.png"). "' />";
            		} else {
            			return "-";
            		}*/
            break;
        default:
            return "-";
            break;
    }
}
示例#2
0
    }
} else {
    if ($my->id and !$jTipsCurrentUser->id and !$jTips['AllowReg']) {
        // user logged in, but registrations disabled
        echo stripslashes($jTips['NoRegMessage']);
    } else {
        if ($my->id and !$jTipsCurrentUser->id and $jTips['AllowReg']) {
            // user logged in, registrations enabled
            if ($jTips['Payments'] == 'paypal') {
                ?>
		<h3 align="center"><?php 
                echo $jLang['_COM_DASH_JOIN_COMP'];
                ?>
</h3>
		<?php 
                echo parsePayPalCode($jTips['PayPal'], 'join', $this->jSeason->id);
            } else {
                ?>
<a
		href="<?php 
                echo jTipsRoute("index.php?option=com_jtips&Itemid={$Itemid}&view=Dashboard&action=add");
                ?>
"
		title="<?php 
                echo $jLang['_COM_JOIN_NOW'];
                ?>
"><?php 
                echo $jLang['_COM_DASH_JOIN_COMP'];
                ?>
</a><?php 
            }