$OUT .= "<TR>
<TD class=\"switch_sw".$SW." bottom2\"> ".($idx+1).".</TD>
<TD align=\"center\" class=\"switch_sw".$SW." bottom2\">";
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
$OUT .= $DATA['uid'][$idx];
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
$OUT .= "</TD>
<TD align=\"center\" class=\"switch_sw".$SW." bottom2\">";
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
$OUT .= $DATA['ref'][$idx];
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
$OUT .= "</TD>
</TR>\n";
$SW = 3 - $SW;
// Return array
return $prices;
}
+
//
-function RALLYE_LOAD_USERS_ARRAY($rallye)
-{
+function RALLYE_LOAD_USERS_ARRAY ($rallye) {
global $_CONFIG;
// Fix zero points to 0.00000
// Load users uid old points earned
$result_user = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s ORDER BY userid",
- array(bigintval($rallye)), __FILE__, __LINE__);
- while(list($uid, $refs, $cpoints) = SQL_FETCHROW($result_user))
- {
+ array(bigintval($rallye)), __FILE__, __LINE__);
+ while (list($uid, $refs, $cpoints) = SQL_FETCHROW($result_user)) {
// Load current ref count
$cnt = RALLYE_GET_REFCOUNT($uid, $refs);
$prices = RALLYE_LOAD_PRICES_ARRAY($rallye);
// Merge users into prices
- foreach ($prices['level'] as $k => $lvl)
- {
- $prices['uid'][$k] = $users['uid'][$k];
- if (empty($prices['uid'][$k])) $prices['uid'][$k] = "---";
- $prices['ref'][$k] = $users['ref'][$k];
- if (empty($prices['ref'][$k])) $prices['ref'][$k] = "---";
- $prices['cpoints'][$k] = $users['cpoints'][$k];
- }
+ foreach ($prices['level'] as $k => $lvl) {
+ // We only need to check one element in $users, see above while() block
+ if (isset($users['uid'][$k])) {
+ $prices['uid'][$k] = $users['uid'][$k];
+ if (empty($prices['uid'][$k])) $prices['uid'][$k] = "---";
+ $prices['ref'][$k] = $users['ref'][$k];
+ if (empty($prices['ref'][$k])) $prices['ref'][$k] = "---";
+ $prices['cpoints'][$k] = $users['cpoints'][$k];
+ } // END - if
+ } // END - foreach
// Return completed array
return $prices;
}
+
//
-function RALLYE_LIST_WINNERS($rallye,$default=0)
-{
+function RALLYE_LIST_WINNERS ($rallye, $default=0) {
// First check how many prices are set
$result_prices = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s ORDER BY price_level",
array(bigintval($rallye)), __FILE__, __LINE__);
$OUT .= "<TR>
<TD class=\"switch_sw".$SW." bottom2".$ADD."\"> ".($idx+1).".</TD>
<TD align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
$OUT .= $DATA['uid'][$idx];
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
$OUT .= "</TD>
<TD align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
$OUT .= $DATA['ref'][$idx];
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
$OUT .= "</TD>
<TD align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
$OUT .= $DATA['infos'][$idx];
- if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+ if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
$OUT .= "</TD>
</TR>\n";
$SW = 3 - $SW;
if (!empty($ral[0]))
{
// Generate selection box for all found templates
- $OUT = "<SELECT name=\"".$name."\" size=\"1\" class=\"admin_select\">
- <OPTION value=\"\">".SELECT_NONE."</OPTION>\n";
+ $OUT = "<select name=\"".$name."\" size=\"1\" class=\"admin_select\">
+ <option value=\"\">".SELECT_NONE."</option>\n";
foreach ($ral as $rallye)
{
- $OUT .= " <OPTION value=\"".$rallye."\"";
+ $OUT .= " <option value=\"".$rallye."\"";
if ($default == $rallye) $OUT .= " selected default";
- $OUT .= ">".$rallye."</OPTION>\n";
+ $OUT .= ">".$rallye."</option>\n";
}
- $OUT .= "</SELECT>\n";
+ $OUT .= "</select>\n";
}
else
{
if ($cnt > 0) break;
}
}
- //* DEBUG: */ echo "<PRE>";
+ //* DEBUG: */ echo "<pre>";
//* DEBUG: */ print_r($cacheArray['refsystem']);
- //* DEBUG: */ echo "</PRE>";
+ //* DEBUG: */ echo "</pre>";
//* DEBUG: */ die();
if ($cnt > 0) {