diff options
Diffstat (limited to 'kalorien_rechner')
| -rwxr-xr-x | kalorien_rechner/ausgabe.php | 118 | ||||
| -rwxr-xr-x | kalorien_rechner/index.html | 104 | ||||
| -rwxr-xr-x | kalorien_rechner/kfa.jpg | bin | 0 -> 35236 bytes | |||
| -rwxr-xr-x | kalorien_rechner/kfa_info.html | 123 |
4 files changed, 345 insertions, 0 deletions
diff --git a/kalorien_rechner/ausgabe.php b/kalorien_rechner/ausgabe.php new file mode 100755 index 0000000..5aa63ab --- /dev/null +++ b/kalorien_rechner/ausgabe.php @@ -0,0 +1,118 @@ +<?php +session_start(); + +if (isset($_POST['rechnen'])) { + $geschlecht = $_POST['geschlecht']; + $gewicht = $_POST['gewicht']; + $groesse = $_POST['groesse']; + $alter = $_POST['alter']; + $aktivitaet = $_POST['aktivitaet']; + $sport = $_POST['sport']; + $ziel = $_POST['ziel']; + + if ($geschlecht == 'maennlich') { + $grundumsatz = 66.47 + (13.7 * $gewicht) + (5 * $groesse) - (6.8 * $alter); + } else $grundumsatz = 655.1 + (9.6 * $gewicht) + (1.8 * $groesse) - (4.7 * $alter); + + $leistungsumsatz = ($grundumsatz * $aktivitaet) + ($sport * 100); + + if ($ziel == 'abnehmen') { + $absolut_kalorien = $leistungsumsatz - 400; + } elseif ($ziel == 'zunehmen') { + $absolut_kalorien = $leistungsumsatz + 400; + } else $absolut_kalorien = $leistungsumsatz; + + if ($ziel == 'abnehmen') { + $protein = $gewicht * 2.2; + } else if ($ziel == 'zunehmen') { + $protein = $gewicht * 1.8; + } else $protein = $gewicht * 2; + + $protein = $protein > 0 ? round($protein) : 0; + $absolut_zucker = $absolut_kalorien / 40; + $zucker = $absolut_zucker > 0 ? round($absolut_zucker) : 0; + $absolut_kohlenhydrate = ($absolut_kalorien - (4 * $protein) - (9 * $gewicht) - (4 * $zucker)) / 4; + $kohlenhydrate = $absolut_kohlenhydrate > 0 ? round($absolut_kohlenhydrate) : 0; + $fett = $gewicht; + $kalorien = $absolut_kalorien > 0 ? round($absolut_kalorien) : 0; +} +?> + +<!DOCTYPE html> +<html lang="de"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Kalorien Ausgabe</title> + <link rel="icon" type="image/x-icon" href="/style/avocado.png"> + <link rel="stylesheet" type="text/css" href="/style/style.css"> +</head> +<body> +<nav class="medium_box"> + <ul class="hor_spacing"> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/login">Login</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box tertiary_color_style" href="/kalorien_rechner">Kalorien-rechner</a> + </li> + <li class=hor_spacing_item> + <a class="small_box color_inverse_on_hover" href="/kalorien_zaehler">Kalorien-zähler</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/rezepte">Rezepte</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/workouts">Workouts</a> + </li> + </ul> +</nav> +<main class="big_box hor_spacing"> + <h1>Täglicher Bedarf</h1> + + <?php if (isset($_POST['rechnen'])) { ?> + <div class="flexbox hor_spacing_item"> + <div class="medium_box" style="flex: 1"> + <h2 style="margin: 0">Proteine:</h2> + <div style="font-size: 100px"><?= $protein ?></div> + <h2 style="margin: 0">gramm</h2> + </div> + <div class="medium_box" style="flex: 1"> + <h2 style="margin: 0">Kohlenhydrate:</h2> + <div style="font-size: 100px"><?= $kohlenhydrate ?></div> + <h2 style="margin: 0">gramm</h2> + </div> + <div class="medium_box" style="flex: 1"> + <h2 style="margin: 0">Fette:</h2> + <div style="font-size: 100px"><?= $fett ?></div> + <h2 style="margin: 0">gramm</h2> + </div> + </div> + <div class="flexbox hor_spacing_item"> + <div class="medium_box" style="flex: 1"> + <h2 style="margin: 0">Zucker:</h2> + <div style="font-size: 100px"><?= $zucker ?></div> + <h2 style="margin: 0">gramm</h2> + </div> + <div class="medium_box" style="flex: 2"> + <h2 style="margin: 0">Um ihr Ziel zu erreichen müssen Sie am Tag</h2> + <div style="font-size: 100px"><?= $kalorien ?></div> + <h2 style="margin: 0">Kalorien zu sich nehmen</h2> + </div> + <form action="/kalorien_zaehler/index.php" method="POST" style="flex: 1"> + <input style="display: none" name="gesamt_kalorien" value="<?= $zielkalorien ?>" /> + <input style="display: none" name="gesamt_kohlenhydrate" value="<?= $kohlenhydrate ?>" /> + <input style="display: none" name="gesamt_fett" value="<?= $fett ?>" /> + <input style="display: none" name="gesamt_protein" value="<?= $protein ?>" /> + <input style="display: none" name="gesamt_zucker" value="<?= $zucker ?>" /> + <button class="medium_box color_inverse_on_hover" style="height: 100%; width: 100%" type="submit" name="werte_uebernehmen"> + <h2 style="font-size: 50px; margin: 0">Werte<br>Speichern</h2> + </button> + </form> + </div> + <?php } else { ?> + <h2>Fülle erst das <a class="small_box color_inverse_on_hover" href="/kalorien_rechner">Formular</a> aus!</h2> + <?php } ?> +</main> +</body> +</html> diff --git a/kalorien_rechner/index.html b/kalorien_rechner/index.html new file mode 100755 index 0000000..06424f2 --- /dev/null +++ b/kalorien_rechner/index.html @@ -0,0 +1,104 @@ +<!DOCTYPE html> +<html lang="de"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Kalorien Rechner</title> + <link rel="icon" type="image/x-icon" href="/style/avocado.png"> + <link rel="stylesheet" type="text/css" href="/style/style.css"> +</head> +<body> +<nav class="medium_box"> + <ul class="hor_spacing"> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/login">Login</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box tertiary_color_style" href="/kalorien_rechner">Kalorien-rechner</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/kalorien_zaehler">Kalorien-zähler</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/rezepte">Rezepte</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/workouts">Workouts</a> + </li> + </ul> +</nav> + +<main class="big_box"> + <h1>Kalorien-rechner</h1> + <form class="hor_spacing" method="post" action="./ausgabe.php"> + <div class="medium_box hor_spacing_item"> + <h2>Geschlecht:</h2> + <div class="flexbox special_radio"> + <input type="radio" name="geschlecht" id="maennlich" value="maennlich" required> + <label class="small_box" style="flex: 1" for="maennlich">Männlich</label> + <input type="radio" name="geschlecht" id="weiblich" value="weiblich" required> + <label class="small_box" style="flex: 1" for="weiblich">Weiblich</label> + </div> + </div> + <div class="flexbox hor_spacing_item"> + <div class="medium_box" style="flex: 1; display: block"> + <h2>Alter in Jahre:</h2> + <input class="small_box color_inverse_on_hover" type="number" name="alter" min="0" max="200" step="1" required><label for="alter"> Jahre + </div> + <div class="medium_box" style="flex: 1; display: block"> + <h2>Gewicht in Kilogramm:</h2> + <input class="small_box color_inverse_on_hover" type="number" name="gewicht" min="0" max="999" step="1" required><label for="gewicht"> kg + </div> + </div> + <div class="flexbox hor_spacing_item"> + <div class="medium_box" style="flex: 1; display: block"> + <h2>Größe in Centimeter:</h2> + <input class="small_box color_inverse_on_hover" type="number" name="groesse" min="0" max="300" step="1" required> cm + </div> + <div class="medium_box" style="flex: 1; display: block"> + <h2>Körperfettanteil in Prozent: <a class="small_box color_inverse_on_hover" href="./kfa_info.html" target="_blank">ⓘ</a></h2> + <input class="small_box color_inverse_on_hover" type="number" name="koerperfettanteil" min="0" max="100" step="1" required> % + </div> + </div> + <div class="flexbox hor_spacing_item"> + <div class="medium_box" style="flex: 1; display: block"> + <h2>Sport pro Woche:</h2> + <select class="small_box color_inverse_on_hover" name="sport" required> + <option value="" selected>--Wie oft machst du Sport?--</option> + <option value="0">Kein Sport</option> + <option value="1">1x</option> + <option value="2">2x</option> + <option value="3">3x</option> + <option value="4">4x</option> + <option value="5">5x</option> + <option value="6">6x</option> + <option value="7">7x oder öfter</option> + </select> + </div> + <div class="medium_box" style="flex: 1; display: block"> + <h2>Alltagsaktivität (ohne Sport):</h2> + <select class="small_box color_inverse_on_hover" name="aktivitaet" required> + <option value="" selected>--Wie aktiv ist dein Alltag?--</option> + <option value="1.2">Wenig aktiv (nur sitzend)</option> + <option value="1.4">Etwas aktiv (meist sitzend)</option> + <option value="1.6">Aktiv (viel laufend)</option> + <option value="1.8">Sehr aktiv (harte körperliche Arbeit)</option> + </select> + </div> + </div> + <div class="medium_box hor_spacing_item"> + <h2>Ziel:</h2> + <div class="flexbox special_radio"> + <input type="radio" name="ziel" id="abnehmen" value="abnehmen" required> + <label class="small_box" style="flex: 1; display: block" for="abnehmen">Abnehmen</label> + <input type="radio" name="ziel" id="gewicht_halten" value="gewicht_halten" required> + <label class="small_box" style="flex: 1; display: block" for="gewicht_halten">Gewicht halten</label> + <input type="radio" name="ziel" id="zunehmen" value="zunehmen" required> + <label class="small_box" style="flex: 1; display: block" for="zunehmen">Zunehmen</label> + </div> + </div> + <button class="medium_box hor_spacing_item color_inverse_on_hover" style="width: 100%" type="submit" name="rechnen"><h2 style="margin: 0">RECHNEN</div></button> + </form> +</main> +</body> +</html>
\ No newline at end of file diff --git a/kalorien_rechner/kfa.jpg b/kalorien_rechner/kfa.jpg Binary files differnew file mode 100755 index 0000000..bd2e904 --- /dev/null +++ b/kalorien_rechner/kfa.jpg diff --git a/kalorien_rechner/kfa_info.html b/kalorien_rechner/kfa_info.html new file mode 100755 index 0000000..265c01c --- /dev/null +++ b/kalorien_rechner/kfa_info.html @@ -0,0 +1,123 @@ +<!DOCTYPE html> +<html lang="de"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Körperfettanteil Info</title> + <link rel="icon" type="image/x-icon" href="/style/avocado.png"> + <link rel="stylesheet" type="text/css" href="/style/style.css"> +</head> +<body> +<nav class="medium_box"> + <ul class="hor_spacing"> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/login">Login</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box tertiary_color_style" href="/kalorien_rechner">Kalorien-rechner</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/kalorien_zaehler">Kalorien-zähler</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/rezepte">Rezepte</a> + </li> + <li class="hor_spacing_item"> + <a class="small_box color_inverse_on_hover" href="/workouts">Workouts</a> + </li> + </ul> +</nav> +<main class="big_box"> + <h1>Körperfett Kalkulation</h1> + <div class="hor_spacing"> + <table class="hor_spacing_item"> + <tr> + <th> + <h2>Körperbau</h2> + </th> + <th> + <h2>Männer</h2> + </th> + <th> + <h2>Frauen</h2> + </th> + </tr> + <tr> + <td> + <h2>Super muskulös</h2> + <p>Nur essentielles Körperfett</p> + </td> + <td> + <h2>2-5%</h2> + <p>Körperfett</p> + </td> + <td> + <h2>10-12%</h2> + <p>Körperfett</p> + </td> + </tr> + <tr> + <td> + <h2>Athletisch</h2> + <p>Geringer Prozentsatz von Körperfett</p> + </td> + <td> + <h2>6-13%</h2> + <p>Körperfett</p> + </td> + <td> + <h2>13-17%</h2> + <p>Körperfett</p> + </td> + </tr> + <tr> + <td> + <h2>Fit</h2> + <p>Schlank und leicht definiert</p> + </td> + <td> + <h2>14-17%</h2> + <p>Körperfett</p> + </td> + <td> + <h2>18-25%</h2> + <p>Körperfett</p> + </td> + </tr> + <tr> + <td> + <h2>Durchschnitt</h2> + <p>Keine klare Trennung von Muskeln und Fett</p> + </td> + <td> + <h2>18-24%</h2> + <p>Körperfett</p> + </td> + <td> + <h2>25-31%</h2> + <p>Körperfett</p> + </td> + </tr> + <tr> + <td> + <h2>Übergewichtig</h2> + <p>Offensichtiliche Zeichen von hohem Körperfett</p> + </td> + <td> + <h2>Mehr als 25%</h2> + <p>Körperfett</p> + </td> + <td> + <h2>Bis zu 50%</h2> + <p>Körperfett</p> + </td> + </tr> + </table> + <img class="hor_spacing_item" style="width: 100%" src="./kfa.jpg"> + <p> + Berechne deinen genauen Körperfettanteil <a class="small_box color_inverse_on_hover" href="https://www.hammer.de/fitnesswissen/koerperfett-rechner">hier</a>. + </p> + </div> +</main> +</body> +</html> |
