Wenn Verschiebung aktiv, kein Button mehr
This commit is contained in:
24
index.php
24
index.php
@@ -282,10 +282,32 @@ $german_weekdays = [
|
||||
</div>
|
||||
<p class="text-muted">nächster Termin:</p>
|
||||
<p class="text-muted h3 fw-bold mb-2"><?= $german_weekday . ' ' . date('d.m.Y H:i', strtotime($row['meeting_date'])) ?></p>
|
||||
<div class="mt-3 mb-2">
|
||||
<?php
|
||||
// Prüfen, ob der aktuelle Benutzer bereits einen aktiven Vorschlag hat
|
||||
$has_active_proposal = false;
|
||||
if ($row) {
|
||||
$check_proposal = mysqli_prepare($conn, "
|
||||
SELECT 1 FROM meeting_reschedule_proposals
|
||||
WHERE meeting_id = ? AND proposed_by_user_id = ? AND status = 'pending'
|
||||
");
|
||||
mysqli_stmt_bind_param($check_proposal, "ii", $meeting_id, $logged_in_user_id);
|
||||
mysqli_stmt_execute($check_proposal);
|
||||
$result_proposal = mysqli_stmt_get_result($check_proposal);
|
||||
$has_active_proposal = (mysqli_fetch_assoc($result_proposal) !== null);
|
||||
mysqli_stmt_close($check_proposal);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="mt-3 mb-2 text-center">
|
||||
<?php if ($has_active_proposal): ?>
|
||||
<div class="alert alert-info alert-sm mb-0" role="alert">
|
||||
Dein Terminverschiebungsvorschlag befindet sich noch in der Abstimmung.
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<button class="btn btn-sm btn-outline-primary" type="button" data-bs-toggle="collapse" data-bs-target="#rescheduleForm" aria-expanded="false" aria-controls="rescheduleForm">
|
||||
Terminverschiebung vorschlagen
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user