{source}
<?php
$iddat = $_GET['mitgliedid'];
if ($_SERVER['DOCUMENT_ROOT']=="C:/xampp/htdocs") {
include $_SERVER['DOCUMENT_ROOT']. "/unstest/includes/unsvar.php";
$pfad = "/unstest/images/comprofiler/";
}
Else {
include $_SERVER['DOCUMENT_ROOT']."/includes/unsvar.php";
$pfad = "/images/comprofiler/";
}

$mysqli = new mysqli($dbhost, $dbusername, $dbpassword, $dbname);
if ($mysqli -> connect_error) {
echo "Fehler bei Verbindung: " . mysqli_connect_error();
exit();
}
if (!$mysqli -> set_charset("utf8")) {
echo "Fehler beim Laden von UTF8 " . $mysqli -> error;
} ?>

<style>
.bto {
border-top: 1px dotted #000000;
}

.ble {
border-left: 1px dotted #000000;
}

.bri {
border-right: 1px dotted #000000;
}

.bbo {
border-bottom: 1px dotted #000000;
}

#detailviewcontainer {
width:100%;
}

#detailviewP, #detailviewD, #detailviewPm, #detailviewDm {
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}

#detailviewP {
display:block;
float:right;
}

#detailviewD {
float:left;
width:60%;
}

#detailviewD th, #detailviewD td{
text-align:left;
}

#detailviewD th {
padding: 5px 10px 5px 5px;
max-width: 140px;
width: auto;
}

#detailviewD td {
padding: 5px 5px;
}

#detailviewPm {
display:block;
text-align: center;
margin-bottom:20px;
}

#detailviewDm {
width:100%;
}

#detailviewDm th, #detailviewDm td {
text-align:center;
}

</style>

<?php

$ergebnis = $mysqli -> query("SELECT
lastname,
firstname,
cb_spitzname,
cb_rnummer,
cb_position,
torsum,
(SELECT COUNT(*) FROM $torliste AS torpl WHERE tortab.torsum < torpl.torsum) + 1 AS torplatz,
trainsum,
(SELECT COUNT(*) FROM $trainliste AS trainpl WHERE traintab.trainsum < trainpl.trainsum) + 1 AS trainplatz,
biersum,
(SELECT COUNT(*) FROM $bfaktor AS bierpl WHERE biertab.biersum < bierpl.biersum) + 1 AS bierplatz,
cb_mitgliedv,
cb_strasse,
cb_plz,
cb_ort,
cb_telefon,
cb_aliasmail,
email,
cb_beruf,
cb_famstand,
cb_gebdat,
(YEAR(CURDATE())-YEAR(cb_gebdat)) - (RIGHT(CURDATE(),5)<RIGHT(cb_gebdat,5)) AS age,
cb_groesse,
cb_schuhgroesse,
cb_hobbies,
cb_getraenk,
cb_speise,
cb_erfolg,
cb_motto,
avatar


FROM
$torliste AS tortab,
$trainliste AS traintab,
$bfaktor AS biertab,
unsw_users AS benutzer,
unsw_comprofiler AS prof

WHERE
tortab.id = $iddat AND
traintab.id = $iddat AND
biertab.id = $iddat AND
benutzer.id = $iddat AND
prof.id = $iddat");

while ($ausgabe = $ergebnis -> fetch_array()) { ?>

<!-- Ansicht Normal -->

<div class='hidden-phone' id='detailviewcontainer'>
<div id='detailviewP'>
<table style='width:auto; margin:0 auto;'>
<tr>
<td>
<?php
echo "<a href='". $pfad . $ausgabe['avatar'] . "' class='jcepopup noicon' rel='caption[" . $ausgabe['firstname'] . " " . $ausgabe['lastname'] . "]' target='_blank'><img style='margin: 0px; border: 1px dotted #000000; padding: 5px;width:250px;' src='" . $pfad . $ausgabe['avatar'] . "' alt='" . strtolower($ausgabe['firstname'] . $ausgabe['lastname']) . "' width='250'/>"; ?>
</td>
</tr>
</table>
</div>
<div id='detailviewD'>
<table style='width:100%; margin:0 auto;'>
<tr class='row_0 ble bto bri'>
<th>Nachname:</th><td clas='bto bri'><?php echo $ausgabe['lastname'] ?></td>
</tr>
<tr class='row_1 ble bri'>
<th>Vorname:</th><td><?php echo $ausgabe['firstname'] ?></td>
</tr>
<tr class='row_0 ble bri'>
<th>Spitzname:</th><td><?php echo $ausgabe['cb_spitzname'] ?></td>
</tr>
<tr class='row_1 ble bri'>
<th>Rückennummer:</th><td><?php echo $ausgabe['cb_rnummer'] ?></td>
</tr>
<tr class='row_0 ble bri'>
<th>Position:</th><td><?php echo $ausgabe['cb_position'] ?></td>
</tr>
<tr class='row_1 ble bri'>
<th>Tore (Platz):</th><td><?php echo $ausgabe['torsum'] ?> (<?php echo $ausgabe['torplatz'] ?>.)</td>
</tr>
<tr class='row_0 ble bri'>
<th>Trainingsanwesenheit:</th><td><?php echo $ausgabe['trainsum'] ?> (<?php echo $ausgabe['trainplatz'] ?>.)</td>
</tr>
<tr class='row_1 ble bri'>
<th>B-Faktor:</th><td><?php echo $ausgabe['biersum'] ?> (<?php echo $ausgabe['bierplatz'] ?>.)</td>
</tr>
<tr class='row_0 bbo ble bri'>
<th>Mitglied seit:</th><td><?php echo $ausgabe['cb_mitgliedv'] ?></td>
</tr>
<tr><td>&nbsp;</td></tr>

<?php
if (!$user -> guest) { ?>
<tr class='row_0 bto ble bri'>
<th>Straße:</th><td><?php echo $ausgabe['cb_strasse'] ?></td>
</tr>
<?php
}

if (!$user -> guest) { ?>
<tr class='row_1 ble bri'>
<th>Ort:</th><td><?php echo $ausgabe['cb_plz'] ?> <?php echo $ausgabe['cb_ort'] ?></td>
</tr>
<?php
}

if ($user -> guest) { ?>
<tr class='row_0 bto ble bri'>
<th>aus:</th><td><?php echo $ausgabe['cb_ort'] ?></td>
</tr>
<?php
}

if (!$user -> guest) { ?>
<tr class='row_0 ble bri'>
<th>Telefonnummer:</th><td><?php echo $ausgabe['cb_telefon'] ?></td>
</tr>
<?php
}
if ($user -> guest) { ?>
<tr class='row_1 ble bri'>
<th>E-Mail:</th><td><?php echo $ausgabe['cb_aliasmail'] ?></td>
</tr>
<?php
}

if (!$user -> guest) { ?>
<tr class='row_1 ble bri'>
<th>E-Mail:</th><td><?php echo $ausgabe['email'] ?></td>
</tr>
<?php
} ?>
<tr class='row_0 ble bri'>
<th>Beruf:</th><td><?php echo $ausgabe['cb_beruf'] ?></td>
</tr>
<tr class='row_1 ble bri'>
<th>Familienstand:</th><td><?php echo $ausgabe['cb_famstand'] ?></td>
</tr>
<?php
if (!$user -> guest) { ?>
<tr class='row_0 ble bri'>
<th>Geburtsdatum:</th><td><?php echo date('d.m.Y', strtotime($ausgabe['cb_gebdat'])) ?></td>
</tr>
<?php
}
if ($user -> guest) {
$teil=explode(".",date('d.m.Y', strtotime($ausgabe['cb_gebdat'])));
$gebd=$teil[0];
$gebm=$teil[1];
$geby=$teil[2];
$time=time();
$akty=date("Y", $time);
$aktm=date("m", $time);
$aktd=date("d", $time);
$alter=$akty-$geby;
$v=$aktm-$gebm;
if ($v < 0)
$alter=$alter-1;
if ($v == 0) {
$d=$aktd-$gebd;
if ($d < 0)
$alter=$alter-1;} ?>
<tr class='row_0 bbo ble bri'>
<th>Alter:</th><td><?php echo $alter ?> Jahre</td>
</tr>
<?php
}
?>
<tr><td>&nbsp;</td></tr>

<tr class='row_0 bto ble bri'>
<th>Körpergröße:</th><td><?php echo $ausgabe['cb_groesse'] ?> cm</td>
</tr>
<tr class='row_1 bbo ble bri'>
<th>Schuhgröße:</th><td><?php echo $ausgabe['cb_schuhgroesse'] ?></td>
</tr>
<tr><td>&nbsp;</td></tr>

<tr class='row_0 bto ble bri'>
<th>Hobbies:</th><td><?php echo $ausgabe['cb_hobbies'] ?></td>
</tr>
<tr class='row_1 ble bri'>
<th>Lieblingsgetränk:</th><td><?php echo $ausgabe['cb_getraenk'] ?></td>
</tr>
<tr class='row_0 bbo ble bri'>
<th>Lieblingsspeise:</th><td><?php echo $ausgabe['cb_speise'] ?></td>
</tr>
<tr><td>&nbsp;</td></tr>

<tr class='row_1 ble bri bto'>
<th>Größter Erfolg:</th><td><?php echo $ausgabe['cb_erfolg'] ?></td>
</tr>
<tr class='row_0 ble bri bbo'>
<th>Lebensmotto:</th><td><?php echo $ausgabe['cb_motto'] ?></td>
</tr>
</table>
</div>
</div>

<!-- Ansicht Mobiltelefon -->
<div class='visible-phone' id='detailviewcontainerm'>
<div id='detailviewPm'>
<table style='width:auto; margin:0 auto;'>
<tr>
<td>
<?php
echo "<a href='". $pfad . $ausgabe['avatar'] . "' class='jcepopup noicon' rel='caption[" . $ausgabe['firstname'] . " " . $ausgabe['lastname'] . "]' target='_blank'><img style='margin: 0px; border: 1px dotted #000000; padding: 5px;width:250px;' src='" . $pfad . $ausgabe['avatar'] . "' alt='" . strtolower($ausgabe['firstname'] . $ausgabe['lastname']) . "' width='250'/>"; ?>
</td>
</tr>
</table>
</div>
<div id='detailviewDm'>
<table style='width:100%; margin:0 auto;'>
<tr class='row_0 ble bri bto'><th>Nachname:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['lastname'] ?></td></tr>
<tr class='row_1 ble bri'><th>Vorname:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['firstname'] ?></td></tr>
<tr class='row_0 ble bri'><th>Spitzname:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['cb_spitzname'] ?></td></tr>
<tr class='row_1 ble bri'><th>Rückennummer:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['cb_rnummer'] ?></td></tr>
<tr class='row_0 ble bri'><th>Position:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['cb_position'] ?></td></tr>
<tr class='row_1 ble bri'><th>Tore (Platz):</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['torsum'] ?> (<?php echo $ausgabe['torplatz'] ?>.)</td></tr>
<tr class='row_0 ble bri'><th>Trainingsanwesenheit:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['trainsum'] ?> (<?php echo $ausgabe['trainplatz'] ?>.)</td></tr>
<tr class='row_1 ble bri'><th>B-Faktor:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['biersum'] ?> (<?php echo $ausgabe['bierplatz'] ?>.)</td></tr>
<tr class='row_0 ble bri'><th>Mitglied seit:</th></tr>
<tr class='row_0 ble bri bbo'><td><?php echo $ausgabe['cb_mitgliedv'] ?></td></tr>
<tr><td>&nbsp;</td></tr>

<?php
if (!$user -> guest) { ?>
<tr class='row_0 ble bri bto'><th>Straße:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['cb_strasse'] ?></td></tr>
<?php
}

if (!$user -> guest) { ?>
<tr class='row_1 ble bri'><th>Ort:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['cb_plz'] ?> <?php echo $ausgabe['cb_ort'] ?></td></tr>
<?php
}

if ($user -> guest) { ?>
<tr class='row_0 ble bri bto'><th>aus:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['cb_ort'] ?></td></tr>
<?php
}

if (!$user -> guest) { ?>
<tr class='row_0 ble bri'><th>Telefonnummer:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['cb_telefon'] ?></td></tr>
<?php
}

if ($user -> guest) { ?>
<tr class='row_1 ble bri'><th>E-Mail:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['cb_aliasmail'] ?></td></tr>
<?php
}

if (!$user -> guest) { ?>
<tr class='row_1 ble bri'><th>E-Mail:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['email'] ?></td></tr>
<?php
} ?>

<tr class='row_0 ble bri'><th>Beruf:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['cb_beruf'] ?></td></tr>
<tr class='row_1 ble bri'><th>Familienstand:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['cb_famstand'] ?></td></tr>

<?php
if (!$user -> guest) { ?>
<tr class='row_0 ble bri'><th>Geburtsdatum:</th></tr>
<tr class='row_0 ble bri'><td><?php echo date('d.m.Y', strtotime($ausgabe['cb_gebdat'])) ?></td></tr>
<?php
}

if ($user -> guest) {
$teil=explode(".",date('d.m.Y', strtotime($ausgabe['cb_gebdat'])));
$gebd=$teil[0];
$gebm=$teil[1];
$geby=$teil[2];
$time=time();
$akty=date("Y", $time);
$aktm=date("m", $time);
$aktd=date("d", $time);
$alter=$akty-$geby;
$v=$aktm-$gebm;
if ($v < 0)
$alter=$alter-1;
if ($v == 0) {
$d=$aktd-$gebd;
if ($d < 0)
$alter=$alter-1;} ?>
<tr class='row_0 ble bri'><th>Alter:</th></tr>
<tr class='row_0 ble bri bbo'><td><?php echo $alter ?> Jahre</td></tr>
<?php
} ?>

<tr><td>&nbsp;</td></tr>

<tr class='row_0 ble bri bto'><th>Körpergröße:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['cb_groesse'] ?> cm</td></tr>
<tr class='row_1 ble bri'><th>Schuhgröße:</th></tr>
<tr class='row_1 ble bri bbo'><td><?php echo $ausgabe['cb_schuhgroesse'] ?></td></tr>

<tr><td>&nbsp;</td></tr>

<tr class='row_0 ble bri bto'><th>Hobbies:</th></tr>
<tr class='row_0 ble bri'><td><?php echo $ausgabe['cb_hobbies'] ?></td></tr>
<tr class='row_1 ble bri'><th>Lieblingsgetränk:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['cb_getraenk'] ?></td></tr>
<tr class='row_0 ble bri'><th>Lieblingsspeise:</th></tr>
<tr class='row_0 ble bri bbo'><td><?php echo $ausgabe['cb_speise'] ?></td></tr>

<tr><td>&nbsp;</td></tr>

<tr class='row_1 ble bri bto'><th>Größter Erfolg:</th></tr>
<tr class='row_1 ble bri'><td><?php echo $ausgabe['cb_erfolg'] ?></td></tr>
<tr class='row_0 ble bri'><th>Lebensmotto:</th></tr>
<tr class='row_0 ble bri bbo'><td><?php echo $ausgabe['cb_motto'] ?></td></tr>
</table>
</div>
</div>

<?php
}
?>

<div style='clear:both; display:block; width:100%;padding:20px;text-align:center;'>
<script type="text/javascript">document.write('<a href="javascript:history.back()"><span style="font-size: 13px;">Zurück</span></a>')</script>
</div>

<?php
$ergebnis -> close();
$mysqli -> close();
?>
{/source}