some edit
This commit is contained in:
+27
-9
@@ -38,9 +38,9 @@ if ($conn->connect_error) {
|
||||
|
||||
$logMessage .= "Database connesso: $dbname\n";
|
||||
|
||||
// Query per selezionare i dati filtrati per iduser
|
||||
// Query per selezionare i dati filtrati per iduser, inclusi maxreschedule e reprogrammed
|
||||
$iduserlogin = $iduserlogin; // Sostituisci con $iduserlogin in produzione
|
||||
$query = "SELECT o.idorderbook, o.order_id, o.idservice, o.order_date_created, o.quantityclass, o.first_lesson_date, o.expireon, s.servicename, s.day, s.time
|
||||
$query = "SELECT o.idorderbook, o.order_id, o.idservice, o.order_date_created, o.quantityclass, o.first_lesson_date, o.expireon, o.maxreschedule, o.reprogrammed, s.servicename, s.day, s.time
|
||||
FROM orderbook o
|
||||
LEFT JOIN service s ON o.idservice = s.idservice
|
||||
WHERE o.iduser = ?";
|
||||
@@ -55,7 +55,7 @@ while ($row = $result->fetch_assoc()) {
|
||||
$idorderbook = $row['idorderbook'];
|
||||
$logMessage .= "Elaborazione ordine: idorderbook = $idorderbook, order_id = {$row['order_id']}\n";
|
||||
|
||||
$lesson_query = "SELECT bc.idbookingclass, bc.bookingstart, bc.status, bc.lostlesson, bc.expirylesson, bc.idservice, s.servicename
|
||||
$lesson_query = "SELECT bc.idbookingclass, bc.bookingstart, bc.status, bc.lostlesson, bc.expirylesson, bc.idservice, bc.is_reprogrammed, s.servicename
|
||||
FROM bookingclass bc
|
||||
LEFT JOIN service s ON bc.idservice = s.idservice
|
||||
WHERE bc.idorder = ?";
|
||||
@@ -195,6 +195,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
<th>Data e Ora</th>
|
||||
<th>Lezione</th>
|
||||
<th>Stato</th>
|
||||
<th>Riprogrammata</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -203,7 +204,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
if (lessons.length === 0) {
|
||||
htmlContent += `
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center; padding: 10px; color: #666; font-size: 13px;">
|
||||
<td colspan="4" style="text-align: center; padding: 10px; color: #666; font-size: 13px;">
|
||||
Nessuna lezione trovata per questo ordine.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -235,6 +236,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
statusText = 'Programmata';
|
||||
}
|
||||
}
|
||||
var isReprogrammedText = lesson.is_reprogrammed === 'Y' ? 'Sì' : 'No';
|
||||
|
||||
htmlContent += `
|
||||
<tr class="${index % 2 === 0 ? 'even-row' : 'odd-row'}">
|
||||
@@ -249,6 +251,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
<td style="padding: 8px;">
|
||||
<span class="badge ${badgeClass}" style="color: ${badgeTextColor}; padding: 6px 10px; font-size: 12px; font-weight: 500;">${statusText}</span>
|
||||
</td>
|
||||
<td style="padding: 8px; font-size: 13px;">${isReprogrammedText}</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
@@ -336,9 +339,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
<h5 style="margin: 0; color: #4c2c92; font-size: 14px;">Da Programmare</h5>
|
||||
<p style="font-size: 24px; font-weight: bold; margin: 5px 0; color: #4c2c92;">${toSchedule}</p>
|
||||
</div>
|
||||
</div> <p style="margin: 0 0 15px 0; color: #333; font-size: 14px; font-weight: 500;">
|
||||
Il tuo ordine scadrà il ${expireOnFormatted}
|
||||
</p>
|
||||
</div>
|
||||
<div style="background-color: #f8f9fa; padding: 15px; border-radius: 8px;">
|
||||
<table class="lesson-table">
|
||||
<thead>
|
||||
@@ -346,6 +347,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
<th>Data e Ora</th>
|
||||
<th>Lezione</th>
|
||||
<th>Stato</th>
|
||||
<th>Riprogrammata</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -354,7 +356,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
if (lessons.length === 0) {
|
||||
htmlContent += `
|
||||
<tr>
|
||||
<td colspan="3" style="text-align: center; padding: 10px; color: #666; font-size: 13px;">
|
||||
<td colspan="4" style="text-align: center; padding: 10px; color: #666; font-size: 13px;">
|
||||
Nessuna lezione trovata per questo ordine.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -386,6 +388,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
statusText = 'Programmata';
|
||||
}
|
||||
}
|
||||
var isReprogrammedText = lesson.is_reprogrammed === 'Y' ? 'Sì' : 'No';
|
||||
|
||||
htmlContent += `
|
||||
<tr class="${index % 2 === 0 ? 'even-row' : 'odd-row'}">
|
||||
@@ -400,6 +403,7 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
<td style="padding: 8px;">
|
||||
<span class="badge ${badgeClass}" style="color: ${badgeTextColor}; padding: 6px 10px; font-size: 12px; font-weight: 500;">${statusText}</span>
|
||||
</td>
|
||||
<td style="padding: 8px; font-size: 13px;">${isReprogrammedText}</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
@@ -676,6 +680,8 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
<th>N. Ticket</th>
|
||||
<th>Prima Lezione</th>
|
||||
<th>Scadenza</th>
|
||||
<th>Riprogr. Massime</th>
|
||||
<th>Riprogrammate</th>
|
||||
<th>Stato</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -696,7 +702,19 @@ file_put_contents($logFile, $logMessage, FILE_APPEND);
|
||||
<td><?php echo $document['day'] . ' ' . $document['time']; ?></td>
|
||||
<td><?php echo $document['quantityclass']; ?></td>
|
||||
<td><?php echo $document['first_lesson_date'] ? date('d-m-Y', strtotime($document['first_lesson_date'])) : '-'; ?></td>
|
||||
<td><?php echo date('d-m-Y', strtotime($document['expireon'])); ?></td>
|
||||
<td style="<?php echo $is_expired ? 'color: #dc3545;' : ''; ?>">
|
||||
<?php echo date('d-m-Y', strtotime($document['expireon'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<span style="display: inline-block; padding: 4px 8px; font-size: 11px; font-weight: 500; color: #fff; background-color: #17a2b8; border-radius: 4px;">
|
||||
<?php echo $document['maxreschedule']; ?>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span style="display: inline-block; padding: 4px 8px; font-size: 11px; font-weight: 500; color: #fff; background-color: <?php echo ($document['reprogrammed'] >= $document['maxreschedule']) ? '#dc3545' : '#28a745'; ?>; border-radius: 4px;">
|
||||
<?php echo $document['reprogrammed']; ?>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge <?php echo $is_expired ? 'bg-danger' : 'bg-primary'; ?>">
|
||||
<?php echo $is_expired ? 'Scaduto' : 'Attivo'; ?>
|
||||
|
||||
Reference in New Issue
Block a user