$yr = date('Y');
if(isset($_POST["months"])){
$month=$_POST["months"]; }
else {
$month = date('F');
}
$departure_data = json_decode(get_post_meta($post->ID, $month.'_departure', true));
?>
<?php
if ($departure_data) { ?>
<h3 id="departures" class="text-center padding2">Group Be part of Trekking - 2022</h3><div class="alignright padding2"><type methodology="POST" motion="">
<choose title="months" onchange="this.type.submit()">
<possibility worth="" disabled chosen>Choose Month</possibility>
<possibility worth="September">September</possibility>
<possibility worth="October">October</possibility>
<possibility worth="November">November</possibility>
<possibility worth="December">December</possibility>
</choose>
</type></div>
<desk><tbody><tr><td>Departure Dates</td><td>Worth in USD</td><td>House Left</td><td>Reserving</td></tr>
<?php foreach ($departure_data as $group_join) { ?>
<tr><td><?= $group_join->tripdate . ' ,'. $yr ?> </td>
<td><?php echo $two_pax; ?> </td>
<td><?= $group_join->spaceleft; ?> </td>
<td> <button kind="button" onclick="location.href="https://wordpress.stackexchange.com/?journey=[trip]&date=<?= $group_join->tripdate; ?>"">Inquire</button></td>
</tr>
<?php } ?>
</tbody>
</desk>
<?php
} else {
echo "No Departure accessible!"; };