All pastes #584470 Raw Edit

statistieken.php

public php v1 · immutable
·published 2007-06-22 19:47 UTC
rendered paste body
<?phpdefine('PUN_ROOT', './');define('STATISTIEKEN', 1); define('INDEX', 1); @include PUN_ROOT.'config.php';require PUN_ROOT.'include/common.php';// title$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Statistieken';require PUN_ROOT.'header.php';?><h1>Team Statistieken</h1>  <h4>Laatst geupdate: 27 Mei 2007</h4><h2>Algemeen</h2><div class="box"><table style="border-collapse:collapse;">  <thead>  <tr>    <th>Aantal gewonnen</th>    <th>Aantal gelijk</th>    <th>Aantal verloren</th>    <th>Totaal</th>  </tr>  </thead>  <tr>    <td style="text-align: center;">406(49%)</td>    <td style="text-align: center;">133(16%)</td>    <td style="text-align: center;">291(35%)</td>    <td style="text-align: center;">830</td>  </tr></table></div><br /><?phpfunction start_statistieken_table($header){  echo '<h2>'.$header.'</h2><div class="box"><table style="border-collapse:collapse;">';}function statistieken($positie, $naam, $aantal_gespeelde_spelen) {  echo ('<tr>          <td style="width: 5%;">'.$positie.'</td>          <td>'.$naam.'</td>          <td style="width: 10%;">'.$aantal_gespeelde_spelen.'</td>        </tr>');}function statistieken_percentage($positie, $naam, $percentage) {  echo ('<tr>          <td style="width: 5%;">'.$positie.'</td>          <td>'.$naam.'</td>          <td style="width: 10%;">'.$percentage.'%</td>        </tr>');}function end_table(){  echo '</table></div>';}echo '<div style="float:left; width: 48%;">';start_statistieken_table('De top 10 van grootgebruikers:');statistieken('1', 'Gigagea', '414');statistieken('2', 'Torenwachter', '356');statistieken('3', 'kierownik', '351');statistieken('4', 'Ronaldkieft', '326');statistieken('5', 'Jamo', '320');statistieken('6', 'Moortje', '309');statistieken('7', 'mirjam', '215');statistieken('8', 'Andre_1968', '212');statistieken('9', 'JohanHardeman', '197');statistieken('10', 'trincot', '171');end_table();echo "</div>";echo '<div style="float:right; width: 48%;">';start_statistieken_table('Top 10 winstpercentages (vanaf 20 spellen gespeeld)');statistieken_percentage('1', 'Stino',           '87');statistieken_percentage('2', 'Trincot',         '86');statistieken_percentage('3', 'RonaldKieft',     '71');statistieken_percentage('4', 'Jamo',            '68');statistieken_percentage('5', 'Pipo_papfles',    '67');statistieken_percentage('6', 'Moortje',         '65');statistieken_percentage('',  'Rustje',          '65');statistieken_percentage('',  'steventje',       '65');statistieken_percentage('9', 'torenwachter',    '63');statistieken_percentage('10', 'kierownik',      '60');end_table();echo "</div>";echo '<div class="clearer"></div><br />';echo '<div style="float:left; width: 48%;">';start_statistieken_table('De tob 10 slechtste spelers:');statistieken_percentage('1',  'vanhameren',    '20');statistieken_percentage('2',  'lieke1960',     '26');statistieken_percentage('3',  'mirjam',        '29');statistieken_percentage('4',  'daba',          '35');statistieken_percentage('5',  'gigagea',       '39');statistieken_percentage('6',  'Andre_1968',    '41');statistieken_percentage('7',  'klaoske',       '42');statistieken_percentage('8',  'Nevertje',      '50');statistieken_percentage('9',  'JohanHardeman', '52');statistieken_percentage('10', 'kierownik',     '60');end_table();echo "</div>";// begin 10 oudste spelersfunction start_10_oudste_spelers_table($header){  echo ('<h2>'.$header.'</h2><div class="box">        <table style="border-collapse:collapse;">');}function top_10_oudste_spelers($positie, $naam, $geboorte_datum) {  echo ('<tr>          <td style="width: 5%;">'.$positie.'</td>          <td>'.$naam.'</td>          <td style="width: 10%;">'.leeftijd( $geboorte_datum ).'</td>        </tr>');}function leeftijd($birthdate) {    if (!is_numeric($birthdate)) $birthdate = strtotime($birthdate);  //converts to unix if not already    $sub_yr = 1970;    while ($birthdate < 0) {    //workaround for dates before 1970        $birthdate = strtotime((date('Y',$birthdate)+10).date('-m-d',$birthdate));        $sub_yr -= 10;    }    return date('Y',time()-$birthdate)-$sub_yr;}echo '<div style="float:right; width: 48%;">';start_10_oudste_spelers_table('Top 10 oudste spelers');top_10_oudste_spelers('1',  'Jamo',           '20 October 1951');top_10_oudste_spelers('2',  'klaoske',        '01 June 1954');top_10_oudste_spelers('3',  'wwwilly',        '01 June 1960');top_10_oudste_spelers('4',  'lieke1960',      '13 November 1960');top_10_oudste_spelers('5',  'trincot',        '11 July 1965');top_10_oudste_spelers('6',  'torenwachter',   '22 December 1965');top_10_oudste_spelers('7',  'Andre_1968',     '14 April 1968');top_10_oudste_spelers('8',  'daba',           '06 Januari 1970');top_10_oudste_spelers('9',  'mirjam',         '20 August 1971');top_10_oudste_spelers('10', 'steventje',      '21 April 1973');end_table();echo "</div>";echo "<div class=\"clearer\"></div><br />";echo '<div style="float:left; width: 100%;">';start_statistieken_table('Toernooiwinsten per lid:');// update tot 7-6-07statistieken('1', 'Steventje', '47');statistieken('2', 'Torenwachter', '36');statistieken('3', 'Stino', '28');statistieken('4', 'Trincot', '20');statistieken('5', 'Kierownik', '20');statistieken('6', 'Moortje', '19');statistieken('7', 'Nevertje', '17');statistieken('8', 'Pipo Papfles', '14');statistieken('9', 'RonaldKieft', '12');statistieken('10', 'Jamo', '12');statistieken('11', 'wwwilly', '12');statistieken('12', 'Rustje', '7');statistieken('13', 'Johan Hardeman', '4');statistieken('14', 'Klaoske', '3');statistieken('15', 'Daba', '1');statistieken('16', 'Mirjam', '1');statistieken('17', 'Gigagea', '0');statistieken('18', 'Lieke 1960', '0');statistieken('19', 'André 1968', '0');statistieken('20', 'VanHameren', '0');end_table();echo "</div>";echo "<div class=\"clearer\"></div><br />";// tabel gespeelde spelen en toebehoren start hierfunction start_gespeelde_spelen_table($header){  echo ('<h2>'.$header.'</h2><div class="box">        <table style="border-collapse:collapse;">          <thead><tr>            <th>Spel</th>            <th>Gewonnen</th>            <th>Verloren</th>            <th>Gelijk</th>            <th>Totaal</th>          </tr></thead>');}function Gespeelde_spelen($spel, $gewonnen, $gelijk, $verloren, $totaal) {  echo ('<tr>          <td>'.$spel.'</td>          <td>'.$gewonnen.'</td>          <td>'.$gelijk.'</td>          <td>'.$verloren.'</td>          <td>'.$totaal.'</td>        </tr>');}start_gespeelde_spelen_table('Gespeelde spelen');Gespeelde_spelen('4 op een rij (tetris)', '98',  '9',  '9',  '116');Gespeelde_spelen('4 op een rij',          '157', '20', '13', '190');Gespeelde_spelen('backgammon',            '18',  '50', '18', '86');Gespeelde_spelen('woordspel',             '15',  '44', '12', '71');Gespeelde_spelen('zeeslag',               '18',  '28', '12', '58');Gespeelde_spelen('dobbelspel',            '15',  '19', '20', '54');Gespeelde_spelen('go-moku',               '24',  '20', '7',  '51');Gespeelde_spelen('molenspel',             '19',  '10', '4',  '33');Gespeelde_spelen('pente',                 '4',   '15', '7',  '26');Gespeelde_spelen('streetsoccer',          '10',  '9',  '3',  '22');Gespeelde_spelen('sudoku',                '3',   '10',  '6', '19');Gespeelde_spelen('lost cities',           '5',   '10',  '3', '18');Gespeelde_spelen('stad en land',          '1',   '8',   '3', '12');Gespeelde_spelen('ur',                    '1',   '7',   '4', '12');Gespeelde_spelen('reversi',               '4',   '5',   '2', '11');Gespeelde_spelen('dammen',                '2',   '6',   '2', '10');Gespeelde_spelen('de beer is los',        '5',   '2',   '1', '8');Gespeelde_spelen('atazx',                 '2',   '5',   '1', '8');Gespeelde_spelen('tablut',                '0',   '5',   '3', '8');Gespeelde_spelen('kamertjeverhuur',       '0',   '6',   '1', '7');Gespeelde_spelen('pinguin',               '2',   '2',   '1', '5');Gespeelde_spelen('codekraker',            '2',   '1',   '0', '3');Gespeelde_spelen('schaken',               '1',   '0',   '1', '2');end_table();echo '<br />';function start_rating_table($header){  echo ('<h2>'.$header.'</h2><div class="box">        <table style="border-collapse:collapse;">          <thead><tr>            <th>Spel</th>            <th>Rating nu</th>            <th>Hoogste rating</th>            <th>Positie nu</th>            <th>Hoogst behaalde positie</th>            <th>Aantal dagen op 1</th>          </tr></thead>');}function rating($spel, $rating_nu, $hoogste_rating, $positie_nu, $hoogste_positie, $aantal_dagen) {  echo ('<tr>          <td>'.$spel.'</td>          <td>'.$rating_nu.'</td>          <td>'.$hoogste_rating.'</td>          <td>'.$positie_nu.'</td>          <td>'.$hoogste_positie.'</td>          <td>'.$aantal_dagen.'</td>        </tr>');}start_rating_table('Ratinglijst per spel');rating('4 op een rij (tetris)', '1974', '1974', '1', '1', '493');rating('4 op een rij',          '1935', '1935', '1', '1', '256');rating('molenspel',             '1647', '1725', '2', '1', '154');rating('go-moku',               '1604', '1631', '8', '6', '0');rating('streetsoccer',          '1555', '1642', '7', '3', '0');rating('dobbelspel',            '1471', '1500', '40', '26', '0');rating('lost cities',           '1459', '1500', '30', '26', '0');rating('woordspel',             '1401', '1500', '26', '17', '0');rating('zeeslag',               '1384', '1500', '37', '10', '0');rating('backgammon',            '1351', '1500', '48', '38', '0');rating('sudoku',                '1341', '1500', '30', '27', '0');rating('de beer is los',        '1579*', '1500', '', '', '');rating('ur',                    '1319*', '1500', '', '', '');rating('stad en land',          '1247*', '1500', '', '', '');rating('kamertjeverhuur',       '1237*', '1500', '', '', '');// rating('gemiddeld',             '1518', '1532', '13', '8', '0');end_table();echo "<br />";function bekers( $goud, $zilver, $brons ){  if ( !empty( $goud ) ) {    $str = "<td style=\"width: 10px; background-color: gold;\">$goud</td>";  } else {    $str = "<td style=\"width: 10px; background-color: gold;\"></td>";  }  if ( !empty( $zilver ) ) {    $str .= "<td style=\"width: 10px; background-color: silver;\">$zilver</td>";  } else {    $str .= "<td style=\"width: 10px; background-color: silver;\"></td>";  }  if ( !empty( $brons ) ) {    $str .= "<td style=\"width: 10px; background-color: #B87333;\">$brons</td>";  } else {    $str .= "<td style=\"width: 10px; background-color: #B87333;\"></td>";  }  return $str;}start_statistieken_table('Toernooibekers per lid:');?><tr>  <td>&nbsp;</td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=4%20op%20een%20rij&amp;t3=117" alt="" /></td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=4%20op%20een%20rij(tetris)&amp;t3=117" alt="" /></td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=attax&amp;t3=117" alt="" /></td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=backgammon&amp;t3=117" alt="" /></td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=boer%20zoekt%20land&amp;t3=117" alt="" /></td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=checkers&amp;t3=117" alt="" /></td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=codekraker&amp;t3=117" alt="" /></td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=dammen&amp;t3=117" alt="" /></td>  <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=de%20beer%20is%20los&amp;t3=117" alt="" /></td><!--   <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=dobbelspel&amp;t3=117" alt="" /></td> --><!--   <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=go&amp;t3=117" alt="" /></td> --><!--   <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=go%20(9x9)&amp;t3=117" alt="" /></td> --><!--   <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=go-moku&amp;t3=117" alt="" /></td> --><!--   <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=halma&amp;t3=117" alt="" /></td> --><!--   <td colspan="3" style="text-align: center;"><img src="./include/verticale-tekst.php?t1=kamertjeverhuur&amp;t3=117" alt="" /></td> --></tr><tr>  <td style="width: auto;">kierownik</td>  <!-- 4 op een rij -->        <?php echo bekers( '10', '16', '40' ); ?>  <!-- 4 op een rij(tetris) --><?php echo bekers( '1', '10', '15' ); ?>  <!-- attax -->               <?php echo bekers( '', '', '' ); ?>  <!-- backgammon -->          <?php echo bekers( '1', '7', '12' ); ?>  <!--boer zoekt land -->      <?php echo bekers( '', '', '' ); ?>  <!--checkers -->             <?php echo bekers( '', '', '' ); ?>  <!--codekraker -->           <?php echo bekers( '', '', '' ); ?>  <!--dammen -->               <?php echo bekers( '', '', '' ); ?>  <!--de beer is los -->       <?php echo bekers( '', '', '' ); ?></tr><tr>  <td>gigagea</td>  <!-- 4 op een rij -->        <?php echo bekers( '10', '16', '40' ); ?>  <!-- 4 op een rij(tetris) --><?php echo bekers( '1', '10', '15' ); ?>  <!-- attax -->               <?php echo bekers( '', '', '' ); ?>  <!-- backgammon -->          <?php echo bekers( '', '', '' ); ?>  <!--boer zoekt land -->      <?php echo bekers( '', '', '' ); ?>  <!--checkers -->             <?php echo bekers( '', '', '' ); ?>  <!--codekraker -->           <?php echo bekers( '', '', '' ); ?>  <!--dammen -->               <?php echo bekers( '', '', '' ); ?>  <!--de beer is los -->       <?php echo bekers( '', '', '' ); ?></tr><tr>  <td>torenwachter</td>  <!-- 4 op een rij -->        <?php echo bekers( '10', '16', '40' ); ?>  <!-- 4 op een rij(tetris) --><?php echo bekers( '1', '10', '15' ); ?>  <!-- attax -->               <?php echo bekers( '', '', '' ); ?>  <!-- backgammon -->          <?php echo bekers( '', '', '' ); ?>  <!--boer zoekt land -->      <?php echo bekers( '', '', '' ); ?>  <!--checkers -->             <?php echo bekers( '', '', '' ); ?>  <!--codekraker -->           <?php echo bekers( '', '', '' ); ?>  <!--dammen -->               <?php echo bekers( '', '', '' ); ?>  <!--de beer is los -->       <?php echo bekers( '', '', '' ); ?></tr><?phpend_table();?><div class="clearer"></div><?phprequire PUN_ROOT.'footer.php';