<form class="mb-2" action = "c65.php" method = "post">
<div class="form-group">
<label class='control-label' for='inputAnfangskapital'>Mitarbeiter:</label>
<select name="mitarbeiter">
<option value="Frau Schmidt">Frau Schmidt</option>
<option value="Frau Müller">Frau Müller</option>
<option value="Herr Meyer">Herr Meyer</option>
<option value="Herr Dr. Schuhmacher">Herr Dr. Schuhmacher</option>
</select></div>
<div class="form-group">
<label class='control-label' for='inputMonatsgehalt'>Monatsgehalt (in €)</label>
<input type="text" name="monatsgehalt" id='inputMonatsgehalt' placeholder="Eine Zahl eingeben!" />
</div>
<div class="form-group">
<label class='control-label' for='inputZulage'>Zulage (in €)</label>
<input type="text" name="zulage" id='inputZulage' placeholder="Eine Zahl eingeben!" />
</div>
<div class="form-group">
<label class='control-label' for='inputMonat'>monatlich:</label>
<input name="berechnungsart" type="radio" id='inputMonat' value="monat" />
<label class='control-label' for='inputJahr'>jährlich:</label>
<input name="berechnungsart" type="radio" id='inputJahr' value="jahr" />
</div>
<div class="form-group">
<button type='submit' name="send" class='btn btn-primary'>
<span class='fa fa-send'></span> Send</button>
</div>
</form>
<?php
if(isset($_POST['send'])){
$mitarbeiter = $_POST["mitarbeiter"];
$monatsgehalt = $_POST["monatsgehalt"];
$zulage = $_POST["zulage"];
$berechnungsart = $_POST["berechnungsart"];
if ($berechnungsart == "jahr") {
echo "<strong >Mitarbeiter:</strong> $mitarbeiter";
echo "<table class='table striped'>";
echo "<thead>";
echo "<tr>";
echo "<th>Pos.</th>";
echo "<th>Beschreibung</th>";
echo "<th>Betrag in €</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
echo "<tr>";
echo "<td colspan='3'><b>Eingabedaten</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td>1</td>";
echo "<td>Monatsgehalt:</td>";
echo "<td>" . $monatsgehalt. "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>2</td>";
echo "<td>Zulage:</td>";
echo "<td>" . $zulage ."</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='3'><b>Ausgabedaten</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td>3</td>";
echo "<td>Jahresgehalt</td>";
echo "<td>" . number_format($monatsgehalt * 12 ,2,",",".") . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>4</td>";
echo "<td>Urlaubsgeld 69%</td>";
echo "<td>" . number_format($monatsgehalt * 0.69 ,2,",",".") . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>5</td>";
echo "<td>Weihnachtsgeld 50%</td>";
echo "<td>" . number_format($monatsgehalt * 0.50 ,2,",",".") . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>6</td>";
echo "<td>Bruttogehalt(Summe Pos. 2-5)</td>";
echo "<td>" . number_format($monatsgehalt * 13.19 + $zulage ,2,",",".") . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>7</td>";
echo "<td>Krankenversicherung 7,8%</td>";
echo "<td>" . number_format($monatsgehalt * 0.078*12 ,2,",",".") . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>8</td>";
echo "<td>Rentenversicherung 9,75%</td>";
echo "<td>" . number_format($monatsgehalt * 0.0975*12 ,2,",",".") . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>9</td>";
echo "<td>Arbeitslosenversicherung 3,25%</td>";
echo "<td>" . number_format($monatsgehalt * 0.0325*12 ,2,",",".") . "</td>";
echo "</tr>";
echo "</tbody></table>";
} else if ($berechnungsart == "monat") {
echo "<strong >Mitarbeiter:</strong> $mitarbeiter";
echo "<table class='table striped'>";
echo "<thead>";
echo "<tr>";
echo "<th>Pos.</th>";
echo "<th>Beschreibung</th>";
echo "<th>Betrag in €</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
echo "<tr>";
echo "<td colspan='3'><b>Eingabedaten</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td>1</td>";
echo "<td>Monatsgehalt:</td>";
echo "<td>" . $monatsgehalt. "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>2</td>";
echo "<td>Zulage:</td>";
echo "<td>" . $zulage ."</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='3'><b>Ausgabedaten</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td>7</td>";
echo "<td>Krankenversicherung 7,8%</td>";
echo "<td>" . number_format($monatsgehalt * 0.078 ,2,",",".") . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>8</td>";
echo "<td>Rentenversicherung 9,75%</td>";
echo "<td>" . number_format($monatsgehalt * 0.0975 ,2,",",".") . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>9</td>";
echo "<td>Arbeitslosenversicherung 3,25%</td>";
echo "<td>" . number_format($monatsgehalt * 0.0325 ,2,",",".") . "</td>";
echo "</tr>";
echo "</tbody></table>";
} else {
echo "<p><b>Wählen Sie bitte monatlich oder jährlich aus!</b></p>";
}
}
?>