internetprogrammierung/segments/_myFriendsBook.php

117 lines
4.4 KiB
PHP
Raw Normal View History

<p></p>
<div class="container">
<div class="row">
<div class="col-12">
<div class="alert alert-dark" role="alert">
2018-06-21 21:31:21 +02:00
<h4>Take a look at your FriendsBook!</h4>
<hr />
2018-06-21 21:29:20 +02:00
<button id="btnCreateTan" type="button" style="float: right;"class="btn btn-info">Create Tan</button>
<h5>Want more entries? Go and invite your friends with the friendsTAN</h5>
<br>
<div class="alert alert-dark" role="alert">
2018-06-21 21:29:20 +02:00
<h5>Your unused Tans:</h5>
<?php
$uID = 0;
$uID = $_SESSION['user'];
$stmt = $database->prepare("SELECT id FROM tans WHERE userID = '$uID' AND `used` = false ");
$stmt->execute();
$result = $stmt->get_result();
while ($object = $result->fetch_object()) {
echo $object->id . " | ";
}
?>
</div>
2018-06-18 19:10:54 +02:00
<div id="genTan"></div>
</div>
<div class="card-columns">
2018-06-18 20:59:32 +02:00
<!--start of cards -->
<?php
$uID = 0;
$uID = $_SESSION['user'];
$stmt = $database->prepare("SELECT * FROM entries WHERE userID = '$uID'");
$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
2018-06-18 20:59:32 +02:00
echo'<div class="card">';
echo'<div class="card-body">';
echo'<h5 class="card-title">' . $row['vorname'] . ' ' . $row['nachname'] . '</h5>';
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['geburtstag']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Geburtstag: ' . $row['geburtstag'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['wohnort']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Wohnort: ' . $row['wohnort'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['strasse']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Straße: ' . $row['strasse'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['kennenUns']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Woher kennen wir uns? ' . $row['kennenUns'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['festnetz']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Festnetz: ' . $row['festnetz'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['handynummer']))){
echo'<p class="card-text">Handynummer: ' . $row['handynummer'] . '</p>';
2018-06-18 20:59:32 +02:00
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['email']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">E-Mail: ' . $row['email'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['hobbies']))){
echo'<p class="card-text">Hobbies: ' . $row['hobbies'] . ' </p>';
2018-06-18 20:59:32 +02:00
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['berufswunsch']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Berufswunsch: ' . $row['berufswunsch'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['essen']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Das könnte ich jeden Tag essen: ' . $row['essen'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['insel']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Was ich auf eine Insel mitnehmen würde: ' . $row['insel'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['film']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Lieblingsfilm: ' . $row['film'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['sport']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Lieblingssport: ' . $row['sport'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['charakter']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Coolster Film oder Spielecharakter: ' . $row['charakter'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['tier']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Mein Lieblingstier: ' . $row['tier'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['musik']))){
echo'<p class="card-text">Lieblingsmusik: ' . $row['musik'] . '</p>';
2018-06-18 20:59:32 +02:00
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['game']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Geilstes Game: ' . $row['game'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['alk']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Lieblings alkoholisches Getränk: ' . $row['alk'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['story']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Meine heftigeste Suffstory: ' . $row['story'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['absturz']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Letzter Absturz: ' . $row['absturz'] . '</p>';
}
2018-06-19 17:37:02 +02:00
if(!empty(trim($row['trinkspiel']))){
2018-06-18 20:59:32 +02:00
echo'<p class="card-text">Lieblings Trinkspiel: ' . $row['trinkspiel'] . '</p>';
}
2018-06-18 20:59:32 +02:00
echo'</div>'; //Close Card Body
echo'</div>'; //Close Card
}
2018-06-18 20:59:32 +02:00
?>
</div>
<!-- end of card-colums-->
2018-06-18 20:59:32 +02:00
</div>
</div>
</div> <!-- Ende container My FriendsBook -->