Location: PHPKode > projects > Skat Statistics > skatstat-1.7.1/skatstat/index.php
<?
include_once("include.php");
include_once("smfunc.php");
include_once("authentication.php");

/**
 * turn off all error reporting on a production site
 */
error_reporting(0);

check_auth();

$SKAT_SESSION[debug]    = false;
$CatId                  = getGet('CatId');
$ListenId               = getGet('SpiellisteId');

if( !$SKAT_SESSION[admin] && $ListenId )
{
  include("header_simple.php");
  Spielliste( "", $ListenId );
  include("footer_simple.php");
  exit;
}

if( $CatId )
{
  # Erfolgsquote Grand
  if( $CONF[EQGrand] == getGet( $CONF[EQ] ) )
  {
    generateErfolgsquotenStatGrand( $CatId );
    return;
  }
  elseif( $CONF[EQNull] == getGet( $CONF[EQ] ) )
  {
    generateErfolgsquotenStatNull( $CatId );
    return;
  }
  elseif( $CONF[EQFarbe] == getGet( $CONF[EQ] ) )
  {
    generateErfolgsquotenStatFarbe( $CatId );
    return;
  }
  elseif( $CONF[HSHand] == getGet( $CONF[HS] ) )
  {
    generateHandspielStat( $CatId );
    return;
  }
  elseif( $CONF[HSGrand] == getGet( $CONF[HS] ) )
  {
    generateGrandHighScore( $CatId );
    return;
  }
  elseif( $CONF[HSFarbe] == getGet( $CONF[HS] ) )
  {
    generateFarbHighScore( $CatId );
    return;
  }
  elseif( $CONF[HSNull] == getGet( $CONF[HS] ) )
  {
    generateNullHighScore( $CatId);
    return;
  }
  elseif( $CONF[HSSpiel] == getGet( $CONF[HS] ) )
  {
    generateScoreSheetHighscore( $CatId, "", 0 );
    return;
  }
  elseif( $CONF[LSHand] == getGet( $CONF[LS] ) )
  {
    generateHandspielStat( $CatId );
    return;
  }
  elseif( $CONF[LSGrand] == getGet( $CONF[LS] ) )
  {
    generateGrandLowscore( $CatId );
    return;
  }
  elseif( $CONF[LSFarbe] == getGet( $CONF[LS] ) )
  {
    generateFarbLowscore( $CatId );
    return;
  }
  elseif( $CONF[LSNull] == getGet( $CONF[LS] ) )
  {
    generateNullLowscore( $CatId);
    return;
  }
  elseif( $CONF[LSSpiel] == getGet( $CONF[LS] ) )
  {
    generateScoreSheetHighscore( $CatId, "", 1 );
    return;
  }
  elseif( getGet( $CONF[QU] ) )
  {
    generateQuarterlyHighscore( $CatId, getGet( $CONF[QU] ) );
    return;
  }
}

# send header page
include("header.php");


$time_start = microtime(true);

if( ! $CatId )
{
  $CatId = getPost( 'CatId' );
}
$LisId   = getGet('Listen');
$SpId    = getGet('SpId' );
$Faq     = getGet('Faq' );
$Grand   = getGet('Grand' );
$Logout  = getGet('Logout' );

?>
<div id="Skatseite">
<div id="Header">
<?
     generateHtmlNavi();
?>
</div>

<div id="Content2">
<?
$timestart = getTime();

if( $SKAT_SESSION[admin] && ( 1 == getGet( "Mngt" ) || 1 == getPost( "Mngt" ) ))
{
  list_all_player();
}
elseif( $SKAT_SESSION[admin] && (2 == getGet( "Mngt" )|| 2 == getPost( "Mngt" )  ))
{
  list_all_cat();
}
elseif( $SKAT_SESSION[admin] && (3 == getGet( "Mngt" )|| 3 == getPost( "Mngt" )  ))
{
  list_all_go();
}
elseif( $SKAT_SESSION[admin] && ( $SKAT_SESSION[handheld] || 4 == getGet( "Mngt" )|| 4 == getPost( "Mngt" )  ))
{

  require("smspielliste.php");
}
elseif( $ListenId )
{
  Spielliste( "", $ListenId );
}
elseif( $SKAT_SESSION[admin] && (5 == getGet( "Mngt" )|| 5 == getPost( "Mngt" )  ))
{
  list_all_user();
}
elseif( $SKAT_SESSION[admin] && (6 == getGet( "Mngt" )|| 6 == getPost( "Mngt" )  ))
{
  listGroupProperties();
  updateSessionVars();
}
elseif( $SKAT_SESSION[admin] && (7 == getGet( "Mngt" )|| 7 == getPost( "Mngt" )  ))
{
  list_all_clubs();
}
elseif( $CatId && $SpId )
{
  echo generatePlayerStatisticPage( $CatId, $SpId );
}
elseif( $LisId )
{
  echo generateListenPage( $LisId, $SpId );
}
elseif( $CatId )
{
  generateCategoryPage( $CatId );
}
elseif( $Faq )
{
  include( "fragen.php" );
}
elseif( $Logout )
{
  include( "logout.php" );
}
elseif( $Grand )
{
  generateHallOfFame();
}
else
{
  // Admin mode
  if( $SKAT_SESSION[admin] )
  {
    generateFirstPage();
  }
  else
  {
    generateHallOfFame();
  }
}
?>
<!-- end of content -->
</div>
<div class="Footer">
<?
$timeend = getTime();

echo "<div class=\"PageFootnote\">Seitenaufbau ben&ouml;tigte " . ($timeend - $timestart) . " Sekunden</div>";
?>

</div> <!-- end content -->

</div> <!-- end skatseite -->


<?
# send footer page
include("footer.php");
?>
Return current item: Skat Statistics