Personal results 2017-10-18T10:37:19+00:00


10) $strCode=1; @$HeaderName=''; @$NofCols=0; @$RoundName=0; @$sorttype=''; @$NofGames=0; @$prevMatch=0; @$wTotal=0; @$bTotal=0; @$OppName=''; @$OppCode=''; @$botLine=''; @$NofGames=0; @$statWTotal=0; @$statBTotal=0; @$statWGames=0; @$statBGames=0; @$statTotal=0; @$statGames=0; @$statRA=0; @$statRW=0; @$statRN=0; function Rchg ($Ro, $Rc, $W, $N, $k) { $RD=array(3,10,17,25,32,39,46,53,61,68,76,83,91,98,106,113,121,129,137,145,153,162,170,179,188,197,206,215,225,235,245,256,267,278,290,302,315,328,344,357,374,391,411,432,456,484,517,559,619,735,999); $LP=array(0.5,0.49,0.48,0.47,0.46,0.45,0.44,0.43,0.42,0.41,0.4,0.39,0.38,0.37,0.36,0.35,0.34,0.33,0.32,0.31,0.3,0.29,0.28,0.27,0.26,0.25,0.24,0.23,0.22,0.21,0.2,0.19,0.18,0.17,0.16,0.15,0.14,0.13,0.12,0.11,0.1,0.09,0.08,0.07,0.06,0.05,0.04,0.03,0.02,0.01,0); if ($Ro-$Rc>350) $Rc=$Ro-350; if ($Rc-$Ro>350) $Rc=$Ro+350; $diff=$Ro-$Rc; $diffa=Abs($diff); for ($i=0; $i=$diffa) $statLP=$LP($i); break; }; if ($diff<0) { $percent=$statlp;} else { $percent=1-$statlp;}; $change=$W-$percent*$N; return round($k*$change,2); }; function Rperf($Rc, $W, $N){ $P=array(0.00,0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.10,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.20,0.21,0.22,0.23,0.24,0.25,0.26,0.27,0.28,0.29,0.30,0.31,0.32,0.33,0.34,0.35,0.36,0.37,0.38,0.39,0.40,0.41,0.42,0.43,0.44,0.45,0.46,0.47,0.48,0.49,0.50,0.51,0.52,0.53,0.54,0.55,0.56,0.57,0.58,0.59,0.60,0.61,0.62,0.63,0.64,0.65,0.66,0.67,0.68,0.69,0.70,0.71,0.72,0.73,0.74,0.75,0.76,0.77,0.78,0.79,0.80,0.81,0.82,0.83,0.84,0.85,0.86,0.87,0.88,0.89,0.90,0.91,0.92,0.93,0.94,0.95,0.96,0.97,0.98,0.99,1.00); $Dp=array(-700,-677,-589,-538,-501,-470,-444,-422,-401,-383,-366,-351,-336,-322,-309,-296,-284,-273,-262,-251,-240,-230,-220,-211,-202,-193,-184,-175,-166,-158,-149,-141,-133,-125,-117,-110,-102,-95,-87,-80,-72,-65,-57,-50,-43,-36,-29,-21,-14,-7,0,7,14,21,29,36,43,50,57,65,72,80,87,95,102,110,117,125,133,141,149,158,166,175,184,193,202,211,220,230,240,251,262,273,284,296,309,322,336,351,366,383,401,422,444,470,501,538,589,677,700); if ($N==0) { return 0;} else { $statP=round($W/$N,2); for ($i=0; $i$N/2) { $chg=($W-$N/2)/0.5*12.5; $Rperf=$Rc+$chg; }; return Round($Rperf,0); } }; @$strCode=$_GET["id"]; if (!is_numeric($strCode)) { $strCode=1;} if ($strCode>128){ $strCode=1;} if ($_SERVER['SERVER_NAME']=='localhost') { $connection = mysqli_connect("localhost", "chessdaily", "gisellism","ratings"); $db = mysqli_select_db($connection, "ratings") or die ("Unable to connect to FIDE ratings database. Try again or contact webmaster admin@fide.com."); } else { $connection = mysqli_connect("localhost", "tbilisi2017_db_u", "s&8w34hbsd98c_+934","tbilisi2017_db"); $db = mysqli_select_db($connection, "tbilisi2017_db") or die ("Unable to connect to FIDE ratings database. Try again or contact webmaster admin@fide.com."); }; $sql = mysqli_query($connection,"select distinct plname, plcode, plcountry, code, k, ro, title from results,players WHERE plcode=id order by plname;"); if (mysqli_num_rows($sql)>0) { $NofCols=9; while ($rstSearch = mysqli_fetch_array($sql)) { ?>


$rstSearch["round"]) { for ($tmpI=1; $tmpI<=$NofCols-$NofGames;$tmpI++){ if ($i<>1){ ?> "; }; }; if ($i<>1){ ?>$bTotal) or ($wTotal==$bTotal and $wTotal+$bTotal==$NofCols and $lastGameColor=="b")) { echo ''; $botLine=str_replace('style="font-weight:bold;" ',' ',$botLine); } if ($wTotal==$bTotal and $wTotal+$bTotal<>$NofCols) { $botLine=str_replace('style="font-weight:bold;" ',' ',$botLine); } echo $botLine; $botLine=""; $NofGames=0; if ($i<>1){ ?>  '.$rstSearch["opname"].' ('.$rstSearch["opcountry"].')'; $botLine=$botLine.'"; $whiteCode=$rstSearch["plcode"]; }else{ if ($whiteCode<>$rstSearch["plcode"]) {?> '.$resw.''; }else{?> '.$resb.''; } } $prevMatch=$rstSearch["round"]; } for ($tmpI=1; $tmpI<= ($NofCols-$NofGames-1);$tmpI++) { if ($i<>1 or true) { ?> '; } if ($i<>1 or true) { ?>$bTotal) or ($wTotal==$bTotal and $wTotal+$bTotal==$NofCols and $lastGameColor=="b")) { echo ''; $botLine=str_replace('style="font-weight:bold;" ',' ',$botLine); } if ($wTotal==$bTotal and $wTotal+$bTotal<>$NofCols) { $botLine=str_replace('style="font-weight:bold;" ',' ',$botLine); } echo $botLine; $botLine=""; $NofGames=0; if ($i<>1 or true){ ?>
  Name G1 G2 R1 R2 r3 r4 B1 B2 SD Total  7) {echo 2;} else { echo 1;}?> align=center>
7) { echo 2; } else { echo 1;}?> align=center>
      6 and $RoundName<70){ $tb=" SD "; $game=$game-6; } if ($game>4 and $RoundName<70){ $tb=" Blitz "; $game=$game-4; } if ($game>2 and $RoundName<70){ $tb=" Rapid "; $game=$game-2; } if ($tour<7){ echo "Round ".$tour; } elseif ($tour==6){ ?> Semifinal Final
      6 and $RoundName<60){ $tb=" SD "; $game=$game-6; } if ($game>4 and $RoundName<60){ $tb=" Blitz "; $game=$game-4; } if ($game>2 and $RoundName<60){ $tb=" Rapid "; $game=$game-2; } if ($tour<6){ ?> Round Semifinal FinalG1G2G3G4R1R2r3r4Bz
SD
Total
      6 and $RoundName<60){ $tb=" SD "; $game=$game-6; } if ($game>4 and $RoundName<60){ $tb=" Blitz "; $game=$game-4; } if ($game>2 and $RoundName<60){ $tb=" Rapid "; $game=$game-2; } if ($tour<6){ ?> Round Semifinal Final G1G2G3G4G5G6Rp1Rp2Tot
  () '.$resb."  
7) {echo 2;} else {echo 1;}?> align=center>
:
: