- $OUT = loadTemplate('guest_rallye_header', true);
- $SW = 2;
- for ($idx = 0; $idx < $prices; $idx++) {
- if (empty($DATA['userid'][$idx])) $DATA['userid'][$idx] = '---';
- if (empty($DATA['ref'][$idx])) $DATA['ref'][$idx] = '---';
- // Add row
- $OUT .= "<tr>
- <td class=\"switch_sw".$SW." bottom2\"> ".($idx+1).".</td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2\">";
- if (($DATA['userid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
- $OUT .= $DATA['userid'][$idx];
- if (($DATA['userid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
- $OUT .= "</td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2\">";
- if (($DATA['userid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
- $OUT .= $DATA['ref'][$idx];
- if (($DATA['userid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
- $OUT .= "</td>
-</tr>\n";
- $SW = 3 - $SW;
+ $OUT = '';
+ for ($idx = '0'; $idx < $prices; $idx++) {
+ // Prepare marking of default (maybe current user's) id
+ $start = ''; $end = '';
+ if (($DATA['userid'][$idx] == $default) && ($default > 0)) {
+ $start = '<strong>';
+ $end = '</strong>';
+ } // END - if
+
+ // Prepare content
+ $content = array(
+ 'idx' => ($idx + 1),
+ 'start' => $start,
+ 'end' => $end,
+ 'userid' => $DATA['userid'][$idx],
+ 'ref' => $DATA['ref'][$idx],
+ 'infos' => ''
+ );
+
+ // Load row template and switch color
+ $OUT .= loadTemplate('guest_rallye_row', true, $content);