$query = mysql_query($sql); $i = 0; $rowclass = ''; while ($result = mysql_fetch_array($query)) { $rowclass = $i % 2 == 0 ? ' class="altrow"' : ''; echo ' <tr' . $rowclass . '>' . "\n"; echo ' <td>Week ' . $result['weekNum'] . '</td>' . "\n"; echo ' <td>' . date('n/j g:i a', strtotime($result['firstGameTime'])) . '</td>' . "\n"; echo ' <td>' . date('n/j g:i a', strtotime($result['cutoffTime'])) . '</td>' . "\n"; if ($result['expired']) { //if week is expired, show score (if scores are entered) if ($lastCompletedWeek >= (int) $result['weekNum']) { //scores entered, show score $weekTotal = getGameTotal($result['weekNum']); //get player score $userScore = getUserScore($result['weekNum'], $user->userID); echo ' <td class="lighter" style="color: #000;">Score: ' . $userScore . '/' . $weekTotal . ' (' . number_format($userScore / $weekTotal * 100, 2) . '%)</td>' . "\n"; } else { //scores not entered, show ??? echo ' <td class="lighter" style="color: #000;">week closed, scores not entered.</td>' . "\n"; } } else { //week is not expired yet, check to see if all picks have been entered $picks = getUserPicks($result['weekNum'], $user->userID); if (sizeof($picks) < (int) $result['gamesTotal']) { //not all picks were entered $tmpStyle = ''; if ((int) $currentWeek == (int) $result['weekNum']) { //only show in red if this is the current week $tmpStyle = ' style="color: red;"'; }
<div id="navigation"> <ul> <li><a href="{$LEVELFLAG}/index.php?page=home">Home</a></li> <li><a href="{$LEVELFLAG}/index.php?page=contact">Contact</a></li> <li><a href="http://www.pragyan.org/10/forum/digitalfortress">Forum</a></li> HEAD; if ($USERLOGGEDIN == true) { $HEAD .= <<<HEAD \t\t<li><a href="{$LEVELFLAG}/index.php?page=challenges">Challenges</a></li> \t\t<li><a href="{$LEVELFLAG}/index.php?page=logout">Logout</a></li> HEAD; } $HEAD .= "</div>"; if ($USERLOGGEDIN == true) { $score = getUserScore(); $rank = getUserRank($score); $HEAD .= "<div style='float : right;padding-top:10px;'>Your Score : {$score} Your Rank : {$rank}</div>"; } $HEAD .= <<<HEAD <div style="clear: both;"> </div> <div style="clear: both;"> </div> HEAD; $FOOT = <<<FOOT <div id="footer"> <div style="float: right;"> <a href="{$LEVELFLAG}/index.php?page=contact"><img src="contact.gif" alt="Contact" /></a> </div> © 2010 Digital Fortress, <a href="http://www.pragyan.org">Pragyan `10</a>. All rights reserved. </div> </div>
$i = 0; $rowclass = ''; while ($row = $query->fetch_assoc()) { //$rowclass = (($i % 2 == 0) ? ' class="altrow"' : ''); echo ' <div class="row-week">' . "\n"; echo ' <p><b>Week ' . $row['weekNum'] . '</b><br />' . "\n"; echo ' First game: ' . date('n/j g:i a', strtotime($row['firstGameTime'])) . '<br />' . "\n"; echo ' Cutoff: ' . date('n/j g:i a', strtotime($row['cutoffTime'])) . '</p>' . "\n"; //echo ' </tr>'."\n"; if ($row['expired']) { //if week is expired, show score (if scores are entered) if ($lastCompletedWeek >= (int) $row['weekNum']) { //scores entered, show score $weekTotal = getGameTotal($row['weekNum']); //get player score $userScore = getUserScore($row['weekNum'], $user->userID); echo ' <div class="bg-info"><b>Score: ' . $userScore . '/' . $weekTotal . ' (' . number_format($userScore / $weekTotal * 100, 2) . '%)</b><br /><a href="results.php?week=' . $row['weekNum'] . '">See Results »</a></div>' . "\n"; } else { //scores not entered, show ??? echo ' <div class="bg-info">Week is closed,</b> but scores have not yet been entered.<br /><a href="results.php?week=' . $row['weekNum'] . '">See Results »</a></div>' . "\n"; } } else { //week is not expired yet, check to see if all picks have been entered $picks = getUserPicks($row['weekNum'], $user->userID); if (sizeof($picks) < (int) $row['gamesTotal']) { //not all picks were entered $tmpStyle = ''; if ((int) $currentWeek == (int) $row['weekNum']) { //only show in red if this is the current week $tmpStyle = ' style="color: red;"'; }
<li><a href="#">账户等级</a></li> <li><a href="#">消息中心</a></li> </ul> </div> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> <div class="media"> <div class="media-left media-heading"> <a href="#"> <img class="media-object" src="../image/defaultMembershipPhoto.png" alt="用户头像" width="100px" height="100px"> </a> </div> <div class="media-body"> <h2 class="media-heading"><?php echo $_SESSION['valid_user']; ?> </h2> <div class="progress" style="max-width: 200px"> <div class="progress-bar" role="progressbar" style="width: 100%;"> 当前积分:<?php echo getUserScore($_SESSION['valid_user']); ?> </div> </div> <h5>会员等级:士兵</h5> </div> </div> </div> </div> </div> </body>