function free_seats($angebot_id) { $angebot = fetch_one_ride($angebot_id); $anzahl = $angebot['anzahl']; return $anzahl - count_mitfahrer($angebot_id); }
echo $r['fahrzeug']; ?> </p> <p>Treffpunkt: <?php echo $r['treffpunkt']; ?> </p> <p>Preis: <?php echo $r['preis']; ?> </p> <!-- inner loop for "mitfahrer" --> <hr> <p>Mitfahrer:</p> <?php if (count_mitfahrer($r['id']) != 0) { ?> <ol> <?php $mitfahrer = fetch_coriders($r['id']); foreach ($mitfahrer as $mf) { $name = $mf['name']; echo "<li>{$name}</li>"; } ?> </ol> <?php } ?> <br> <p> <!-- add class="dead" if not available-->