Esempio n. 1
0
    echo "<br>wins=$wins draws=$draws losses=$losses dc=$dc id=$id pts=$pts ptsNew=$ptsNew";
    
    $sql = "UPDATE six_profiles SET points2=points WHERE id=$id";
    echo "<br>$sql";
    mysql_query($sql);

    $sql = "UPDATE six_profiles SET points=$ptsNew WHERE id=$id";
    echo "<br>$sql";
    mysql_query($sql);

    $wins = $wins+$row2[0];
    $draws = $draws+$row2[1];
    $losses = $losses+$row2[2];
    $dc = $row['disconnects']+$row2[3];
    $rating = $row['rating'];
    $ratingNew = getSixserverPoints($wins, $draws, $losses+$dc);
    echo "<p>";
    echo "<br>$sql2";
    echo "<br>".$row2[0]."-".$row2[1]."-".$row2[2]."-".$row2[3];
    echo "<br>wins=$wins draws=$draws losses=$losses dc=$dc id=$id rating=$rating ratingNew=$ratingNew";
    
    $sql = "UPDATE six_profiles SET rating=$ratingNew WHERE id=$id";
    echo "<br>$sql";
    mysql_query($sql);
  }
  
}

?>

<?php 
Esempio n. 2
0
}
echo getOuterBoxTop($leaguename . " <span class='grey-small'>&raquo;</span> Sixserver Points Distribution", "");
?>
<p>This is the current Sixserver points distribution grid. Draws are counted as half a win.</p>
<?

  $i = 0;
  echo '<table style="border-collapse:collapse;">';
  while ($i <= 200) {
    echo "<tr>";
    $j = 0;
    while ($j <= 200) {
      if ($type == "pt2") {
        $pt = getSixserverPoints2($j,0,$i);
      } else {
        $pt = getSixserverPoints($j,0,$i);
      }
      echo "<td style=\"border:1px solid #AAAAAA; padding: 3x 3px 3px 3px;white-space:nowrap;border-collapse:collapse;\">Wins: $j<br>Losses: $i<br>Points: <b>".$pt."</b></td>";
      $j = $j+1;
    }
    echo "</tr>";
    $i = $i+1;
  }
  echo "</table>";
?>

<?php 
echo getOuterBoxBottom();
?>
<?
	require('../bottom.php');
Esempio n. 3
0
function RecalculatePointsForProfile($id, $dc, $pts, $rating)
{
    // current season
    $wins = getSixserverWins($id);
    $draws = getSixserverDraws($id);
    $losses = getSixserverLosses($id);
    $ptsNew = getSixserverPoints($wins, $draws, $losses + $dc);
    $msg .= "<br>This season: wins={$wins} draws={$draws} losses={$losses} dc={$dc} id={$id} pts={$pts} ptsNew={$ptsNew}";
    $sql = "UPDATE six_profiles SET points2=points WHERE id={$id}";
    $msg .= "<br>{$sql}";
    mysql_query($sql);
    $sql = "UPDATE six_profiles SET points={$ptsNew} WHERE id={$id}";
    $msg .= "<br>{$sql}";
    mysql_query($sql);
    // rating: all seasons
    $sql2 = "SELECT sum(dc) FROM six_history WHERE profileId=" . $id;
    $result2 = mysql_query($sql2);
    $row2 = mysql_fetch_array($result2);
    $wins = getSixserverWinsAllTime($id);
    $draws = getSixserverDrawsAllTime($id);
    $losses = getSixserverLossesAllTime($id);
    $dc = $dc + $row2[0];
    $ratingNew = getSixserverPoints($wins, $draws, $losses + $dc);
    $msg .= "<br>All time: wins={$wins} draws={$draws} losses={$losses} dc={$dc} id={$id} rating={$rating} ratingNew={$ratingNew}";
    $sql = "UPDATE six_profiles SET rating={$ratingNew} WHERE id={$id}";
    $msg .= "<br>{$sql}";
    mysql_query($sql);
    return $msg;
}