fixed summary order and orders
This commit is contained in:
parent
9447d62c27
commit
10ef6db5c5
@ -44,10 +44,13 @@ while ($row = $result->fetch_assoc()) {
|
||||
$lesson_result = $conn->query($lesson_query);
|
||||
$lessons = array();
|
||||
while ($lesson_row = $lesson_result->fetch_assoc()) {
|
||||
$lesson_row['bookingstart'] = date('c', strtotime($lesson_row['bookingstart'])); // Formato ISO 8601
|
||||
$lessons[] = $lesson_row;
|
||||
}
|
||||
$row['lessons'] = $lessons;
|
||||
$documents[] = $row;
|
||||
// Debug: verifica il numero di lezioni
|
||||
echo "<!-- Lezioni per order_id " . $row['order_id'] . ": " . count($lessons) . " -->";
|
||||
}
|
||||
?>
|
||||
|
||||
@ -78,6 +81,7 @@ while ($row = $result->fetch_assoc()) {
|
||||
// Handle order click for popup
|
||||
$('.order-row').click(function() {
|
||||
var lessons = $(this).data('lessons');
|
||||
console.log('Lezioni ricevute:', lessons); // Debug
|
||||
var total = $(this).data('total');
|
||||
var orderId = $(this).data('order-id');
|
||||
var isExpired = $(this).data('is-expired');
|
||||
@ -99,6 +103,15 @@ while ($row = $result->fetch_assoc()) {
|
||||
}).length;
|
||||
var toSchedule = total - (booked + completed + lost + expired);
|
||||
|
||||
console.log({
|
||||
booked: booked,
|
||||
completed: completed,
|
||||
lost: lost,
|
||||
expired: expired,
|
||||
toSchedule: toSchedule,
|
||||
total: total
|
||||
});
|
||||
|
||||
var htmlContent = `
|
||||
<h4 style="margin-bottom: 20px; color: #333; font-weight: 600;">
|
||||
Dettagli Ordine #${orderId}
|
||||
@ -629,6 +642,7 @@ while ($row = $result->fetch_assoc()) {
|
||||
<button class="details-btn" data-order-id="<?php echo $document['order_id']; ?>" data-lessons='<?php echo json_encode($document['lessons']); ?>' data-total='<?php echo $document['quantityclass']; ?>' data-is-expired='<?php echo $is_expired ? 'true' : 'false'; ?>'>Dettagli</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php echo "<!-- Total per order_id " . $document['order_id'] . ": " . $document['quantityclass'] . " -->"; ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -343,85 +343,8 @@ if ($result_dayoff->num_rows > 0) {
|
||||
<div class="main-content">
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php if ($message == 'success') { ?>
|
||||
<div class="alert alert-success" role="alert">
|
||||
Operazione completata con successo
|
||||
</div>
|
||||
<?php } elseif ($message == 'error') { ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
Errore durante l'aggiornamento
|
||||
</div>
|
||||
<?php } elseif ($message == 'success_dayoff') { ?>
|
||||
<div class="alert alert-success" role="alert">
|
||||
DayOff inserito con successo
|
||||
</div>
|
||||
<?php } elseif ($message == 'error_dayoff') { ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
Errore durante l'inserimento del DayOff
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<h5>Benvenuta/o <?php echo $firstname; ?></h5>
|
||||
<p>Giorni DayOff</p>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Giorno Day Off</th>
|
||||
<th>ACTION</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($documents as $document) { ?>
|
||||
<tr>
|
||||
<td><?php echo $document["dayoffdate"]; ?></td>
|
||||
<td>
|
||||
<form method="post" action="removedayoff.php?iddayoff=<?php echo $document["iddayoff"]; ?>">
|
||||
<input type="hidden" name="date" value="<?php echo $document["dayoffdate"]; ?>">
|
||||
<button type="submit" class="btn btn-danger">Rimuovi</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="">
|
||||
<div class="row mb-2">
|
||||
<div class="col-xl-3 col-md-12">
|
||||
<div class="pb-3 pb-xl-0">
|
||||
<div class="position-relative">
|
||||
<h3>Inserisci Dayoff</h3>
|
||||
</div>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<label for="dayoff">Data di Scadenza:</label>
|
||||
<input type="text" id="dayoff" class="form-control datepicker" name="dayoff" required><br>
|
||||
<input type="submit" class="btn btn-primary w-md" value="Inserisci" name="submit">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-9 col-md-12"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user