Modify for M18b certification - Added multi site as request by M Piccolini

This commit is contained in:
2024-09-19 12:20:18 +02:00
parent 91ae77aff1
commit 11954159d4
18 changed files with 292 additions and 10 deletions
+58 -2
View File
@@ -358,6 +358,12 @@ $idprotectioncategoryJson = json_encode($idproteccategorylistRecord);
.table tbody .for-add:nth-child(1) {
display: none;
}
.flashing-green {
background-color: #d4edda;
/* Verde chiaro */
transition: background-color 0.5s ease;
}
</style>
<style>
body {
@@ -506,10 +512,22 @@ $idprotectioncategoryJson = json_encode($idproteccategorylistRecord);
<div class="progress mb-4">
<div class="progress-bar" role="progressbar" style="width: 20%;" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">20%</div>
</div>
<div>
<h4 class="alert-heading font-18 text-dark"><?php echo $certificatem18a; ?></h4>
<p><?php echo $certificatem18a_help; ?></p>
<p><?php echo $certificatem18a_help; ?></p><br>
<!-- Dropdown per il tipo di certificazione con larghezza ridotta -->
<div class="form-group" style="max-width: 300px;">
<label for="certificationtype"><strong><?php echo $certificationtypedtitle; ?></strong></label>
<select id="certificationtype" name="certificationtype" class="form-control">
<option value=""><?php echo $pleaseselect; ?></option>
<option value="1" <?php echo ($trfnumberfinal->getColumnVal("certificationtyped") == 1) ? 'selected' : ''; ?>><?php echo $certd_1; ?></option>
<option value="2" <?php echo ($trfnumberfinal->getColumnVal("certificationtyped") == 2) ? 'selected' : ''; ?>><?php echo $certd_2; ?></option>
<option value="3" <?php echo ($trfnumberfinal->getColumnVal("certificationtyped") == 3) ? 'selected' : ''; ?>><?php echo $certd_3; ?></option>
<option value="4" <?php echo ($trfnumberfinal->getColumnVal("certificationtyped") == 4) ? 'selected' : ''; ?>><?php echo $certd_4; ?></option>
</select>
</div>
<form action="trfdetails.php" method="get" class="was-validated" name="myForm">
<input name="certtype" type="hidden" id="certtype" value="<?php echo ($certtype->getColumnVal("idcertificationtype")); ?>">
<input name="tempcode" type="hidden" id="tempcode" value="<?php echo $tempcode; ?>">
@@ -556,7 +574,6 @@ $idprotectioncategoryJson = json_encode($idproteccategorylistRecord);
</tbody>
</table> <br>
<a class="badge_btn" onclick="window.open('contactpopaudit.php?kindcontacts=audit&idtrf=<?php echo $idtrf; ?>&idcontacts=<?php echo ($auditcontactlist->getColumnVal("idcontacts")); ?>', '_blank', 'location=yes,height=950,width=1400,scrollbars=yes,status=yes');"><button type="button" class="btn btn-primary waves-effect waves-light">MODIFICA</button></a>
<!-- Pulsante per aggiungere un nuovo contatto -->
<a class="badge_btn" onclick="window.open('contactpopaudit.php?kindcontacts=audit&idtrf=<?php echo $idtrf; ?>&add_new_contact=1', '_blank', 'location=yes,height=950,width=1400,scrollbars=yes,status=yes');">
<button type="button" class="btn btn-success waves-effect waves-light">AGGIUNGI</button>
@@ -852,6 +869,45 @@ $idprotectioncategoryJson = json_encode($idproteccategorylistRecord);
});
});
</script>
<script>
// Funzione per aggiornare il dropdown e flashare in verde
function flashGreen() {
var dropdown = document.getElementById('certificationtype');
dropdown.classList.add('flashing-green');
// Rimuovi la classe dopo 2 secondi
setTimeout(function() {
dropdown.classList.remove('flashing-green');
}, 2000);
}
// Funzione per inviare l'aggiornamento tramite AJAX
function updateCertificationType() {
var certificationType = document.getElementById('certificationtype').value;
var idtrf = <?php echo $idtrf; ?>; // ID del trf (puoi usare la variabile PHP)
// Esegui la chiamata AJAX
var xhr = new XMLHttpRequest();
xhr.open("POST", "update_certificationtype.php", true); // Nome del file PHP che gestirà l'aggiornamento
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
// Funzione di callback al termine dell'aggiornamento
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
// Dopo l'aggiornamento, flash verde
flashGreen();
}
};
// Invio dei dati al server
xhr.send("certificationtype=" + certificationType + "&idtrf=" + idtrf);
}
// Ascolta il cambio del valore del dropdown
document.getElementById('certificationtype').addEventListener('change', function() {
updateCertificationType();
});
</script>
<!-- jQuery -->
<!-- <script src="assets/js/jquery.min.js"></script> -->