<form method="post" action="nedost.php>
<h4>Курьер 1</h4>
<table class="table text-center">
<thead class="text-uppercase">
<tr>
<th scope="col">ID</th>
<th scope="col">Метро</th>
<th scope="col">Время</th>
<th scope="col">ФИО</th>
<th scope="col">Сумма</th>
<th scope="col"> </th>
<th scope="col"> </th>
<th scope="col"> </th>
</tr>
</thead>
<?php
$post = get_cargo_users1();
?>
<?php foreach ($post as $users): ?>
<tbody>
<tr>
<td><input type="hidden" name="form_id" value="<?=$users['id']?>"></td>
<td><?=htmlspecialchars($users['delivery_adress'], ENT_QUOTES)?></td>
<td><?=htmlspecialchars($users['delivery_time'], ENT_QUOTES)?></td>
<td><?=htmlspecialchars($users['surname'], ENT_QUOTES)?> <?=htmlspecialchars($users['name'], ENT_QUOTES)?> <?=htmlspecialchars($users['second_name'], ENT_QUOTES)?></td>
<td><?=htmlspecialchars($users['manager_comment'], ENT_QUOTES)?></td>
<td><button type="submit" formmethod="post" name="delivered" formaction="dost.php" class="btn btn-xs btn-success mb-3" id="delivered">Отдал</button></td>
<td><button type="submit" formmethod="post" name="undelivered" formaction="nedost.php" class="btn btn-xs btn-danger mb-3">Отказ</button></td>
<td><button type="button" formmethod="post" name="delivery" class="btn btn-xs btn-warning mb-3" data-toggle="modal" data-target="#exampleModalLong">Перенос</button></td>
</tr>
</tbody>
<?php endforeach ?>
</table>
</form>
...
<?php foreach ($post as $users) { ?>
<form method="post" action="nedost.php">
<tbody>
<tr>
<td><input type="hidden" name="form_id" value="<?=$users['id']?>"></td>
<td><?=htmlspecialchars($users['delivery_adress'], ENT_QUOTES)?></td>
<td><?=htmlspecialchars($users['delivery_time'], ENT_QUOTES)?></td>
<td><?=htmlspecialchars($users['surname'], ENT_QUOTES)?> <?=htmlspecialchars($users['name'], ENT_QUOTES)?> <?=htmlspecialchars($users['second_name'], ENT_QUOTES)?></td>
<td><?=htmlspecialchars($users['manager_comment'], ENT_QUOTES)?></td>
<td><button type="submit" formmethod="post" name="delivered" formaction="dost.php" class="btn btn-xs btn-success mb-3" id="delivered">Отдал</button></td>
<td><button type="submit" formmethod="post" name="undelivered" formaction="nedost.php" class="btn btn-xs btn-danger mb-3">Отказ</button></td>
<td><button type="button" formmethod="post" name="delivery" class="btn btn-xs btn-warning mb-3" data-toggle="modal" data-target="#exampleModalLong">Перенос</button></td>
</tr>
</tbody>
</form>
<?php } ?>
...