Statistics

GNH16:  DEAL  REGO  WHO IS COMING  STATUS  ACCOMMODATION  DIRECTIONS  PRE-/POST-LUBES  FAQ


[insert_php]
$timestamp = time();
$timestamp_regopen = mktime(18,00,00,8,14,2015);

$host_name = “db586837430.db.1and1.com”;
$database = “db586837430”;
$user_name = “dbo586837430”;
$password = “Yaq1!xsw”;

$db = mysqli_connect($host_name, $user_name, $password, $database);
if (mysqli_connect_errno())
{
echo “Verbindung zum MySQL Server fehlgeschlagen: ” . mysqli_connect_error();
}

$sql_NrOfReg = ‘SELECT COUNT(*) as NrOfReg FROM rego_liste’;
$db_erg_NrOfReg = mysqli_query( $db, $sql_NrOfReg );

while($row = mysqli_fetch_object($db_erg_NrOfReg)) {
$NrOfReg = $row->NrOfReg;
}

// Darstellung Kennels

$sql_kennelstat = ‘SELECT kennel, count(id) as anz FROM rego_liste group by kennel order by anz desc, kennel’;
$db_erg_kennelstat= mysqli_query( $db, $sql_kennelstat );

echo ‘

‘;

while($row = mysqli_fetch_object($db_erg_kennelstat))
{
$kennel = $row->kennel;
$anz = $row->anz;
$anzProz = number_format( $anz / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
//If ($kennel==’NA’) {$kennel=’-‘;}
If ($kennel!=’NA’) {
echo ‘

‘;
} else {
$NAavail=true;
$NAanz=$anz;
$NAanzProz=$anzProz;
$NAbalken=$balken;
}
}
if ($NAavail==true) {
$NAavail=false;
echo ‘

‘;
}
echo ‘

Kennel
‘.$kennel.’
 ‘.$anzProz.’ (‘.$anz.’)
 ‘.$NAanzProz.’ (‘.$NAanz.’)

‘;

// Darstellung country

$sql_stat = ‘SELECT country, count(id) as anz FROM rego_liste group by country order by anz desc, country’;
$db_erg_stat= mysqli_query( $db, $sql_stat );

echo ‘

‘;

while($row = mysqli_fetch_object($db_erg_stat))
{
$country = $row->country;
$anz = $row->anz;
$anzProz = number_format( $anz / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);

echo ‘

‘;

}
echo ‘

Country
‘.$country.’
 ‘.$anzProz.’ (‘.$anz.’)

‘;

// Darstellung Gender

$sql_stat = ‘SELECT gender, count(id) as anz FROM rego_liste group by gender order by anz desc’;
$db_erg_stat= mysqli_query( $db, $sql_stat );

echo ‘

‘;

while($row = mysqli_fetch_object($db_erg_stat))
{
$gender = $row->gender;
$anz = $row->anz;
$anzProz = number_format( $anz / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);

echo ‘

‘;

}
echo ‘

Gender
‘.$gender.’
 ‘.$anzProz.’ (‘.$anz.’)

‘;

// alter darstellen

$sql_stat=’SELECT bdate FROM rego_liste’;
$db_erg_stat= mysqli_query( $db, $sql_stat );

while($row = mysqli_fetch_object($db_erg_stat)) {
$bdate = $row->bdate;

$birth = new DateTime($bdate);
$today = new DateTime();
$diff = $birth->diff($today);
// Echo $diff->format(‘%y’).’jahre
‘;
$diff=$diff->format(‘%y’);
If ($diff<11) {$biszehn++;} Else if ($diff<21) {$biszwanzig++;} Else if ($diff<31) {$bisdreissig++;} Else if ($diff<41) {$bisvierzig++;} Else if ($diff<51) {$bisfünfzig++;} Else if ($diff<61) {$bissechzig++;} Else if ($diff<71) {$bissiebzig++;} Else if ($diff<81) {$bisachtzig++;} Else if ($diff<91) {$bisneunzig++;} Else if ($diff<101) {$bishundert++;} } echo '

‘;
$anzProz = number_format( $biszehn / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $biszwanzig / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $bisdreissig / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $bisvierzig / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $bisfünfzig / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $bissechzig / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $bissiebzig / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $bisachtzig / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $bisneunzig / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

‘;
$anzProz = number_format( $bishundert / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);
Echo ‘

Agegroups
0-10 years
 ‘.$anzProz.’ (‘.$biszehn.’)
11-20 years
 ‘.$anzProz.’ (‘.$biszwanzig.’)
21-30 years
 ‘.$anzProz.’ (‘.$bisdreissig.’)
31-40 years
 ‘.$anzProz.’ (‘.$bisvierzig.’)
41-50 years
 ‘.$anzProz.’ (‘.$bisfünfzig.’)
51-60 years
 ‘.$anzProz.’ (‘.$bissechzig.’)
61-70 years
 ‘.$anzProz.’ (‘.$bissiebzig.’)
71-80 years
 ‘.$anzProz.’ (‘.$bisachtzig.’)
81-90 years
 ‘.$anzProz.’ (‘.$bisneunzig.’)
91-100 years
 ‘.$anzProz.’ (‘.$bishundert.’)

‘;

// Darstellung Run

$sql_runstat = ‘SELECT run, count(id) as anz FROM rego_liste group by run order by anz desc’;
$db_erg_runstat= mysqli_query( $db, $sql_runstat );

echo ‘

‘;

while($row = mysqli_fetch_object($db_erg_runstat))
{
$run = $row->run;
$anz = $row->anz;
$anzProz = number_format( $anz / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);

if ($run!=’NA’) {
echo ‘

‘;

} else {
$NAavail=true;
$NAanz=$anz;
$NAanzProz=$anzProz;
$NAbalken=$balken;
}
}
if ($NAavail==true) {
$NAavail=false;
echo ‘

‘;
}

echo ‘

Runtype
‘.$run.’
 ‘.$anzProz.’ (‘.$anz.’)
 ‘.$NAanzProz.’ (‘.$NAanz.’)

‘;

// Darstellung RDR

$sql_stat = ‘SELECT reddressrun, count(id) as anz FROM rego_liste group by reddressrun order by anz desc’;
$db_erg_stat= mysqli_query( $db, $sql_stat );

echo ‘

‘;

while($row = mysqli_fetch_object($db_erg_stat))
{
$reddressrun = $row->reddressrun;
$anz = $row->anz;
$anzProz = number_format( $anz / $NrOfReg*100, “0”, “,”,””).’%’;
$balken=floor($anzProz*350/100);

if ($reddressrun!=’NA’) {
echo ‘

‘;

} else {
$NAavail=true;
$NAanz=$anz;
$NAanzProz=$anzProz;
$NAbalken=$balken;
}
}

if ($NAavail==true) {
$NAavail=false;
echo ‘

‘;
}
echo ‘

Red Dress Run
‘.$reddressrun.’
 ‘.$anzProz.’ (‘.$anz.’)
 ‘.$NAanzProz.’ (‘.$NAanz.’)

‘;

[/insert_php]