update dossier chekcqual
This commit is contained in:
@@ -32,11 +32,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
// Lista dei campi da sanificare e controllare se sono piene
|
||||
$fields = [
|
||||
'productionplace_same', 'classificationshoes', 'destinationuseppe',
|
||||
'manufacutringprocess', 'ppeageing', 'obsolescencedeadline',
|
||||
'localisationppemarking', 'manufacturerlogoid', 'sizeexamplecemark',
|
||||
'monthyearprod', 'serialbatchnumber', 'standarduse', 'symbolsaddreq',
|
||||
'proddescription', 'packaging', 'declarconformity', 'webaddress'
|
||||
'productionplace_same',
|
||||
'classificationshoes',
|
||||
'destinationuseppe',
|
||||
'manufacutringprocess',
|
||||
'ppeageing',
|
||||
'obsolescencedeadline',
|
||||
'localisationppemarking',
|
||||
'manufacturerlogoid',
|
||||
'sizeexamplecemark',
|
||||
'monthyearprod',
|
||||
'serialbatchnumber',
|
||||
'standarduse',
|
||||
'symbolsaddreq',
|
||||
'proddescription',
|
||||
'packaging',
|
||||
'declarconformity',
|
||||
'webaddress'
|
||||
];
|
||||
|
||||
foreach ($fields as $field) {
|
||||
@@ -413,11 +425,36 @@ $archivetrflist->execute(); ?>
|
||||
#documentPreview {
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
min-height: 800px;
|
||||
/* Per mantenere una dimensione simile all'iframe originale */
|
||||
}
|
||||
|
||||
iframe {
|
||||
width: 80%;
|
||||
border: none;
|
||||
#preloader {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 4px solid #f3f3f3;
|
||||
border-top: 4px solid #3498db;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -463,7 +500,7 @@ $archivetrflist->execute(); ?>
|
||||
<div class="col-lg-12">
|
||||
<div class="card card-body">
|
||||
<h4 class="card-title mt-0"><?php echo $articletd; ?> <?php echo $description; ?> - TRF: <?php echo $trfnumb; ?></h4>
|
||||
<p class="card-text text-muted "><?php echo $questionstarttd; ?></p>
|
||||
<p class="card-text text-muted ">Preview</p>
|
||||
|
||||
</div><!--end card-->
|
||||
</div><!--end col-->
|
||||
@@ -472,13 +509,22 @@ $archivetrflist->execute(); ?>
|
||||
</div>
|
||||
|
||||
<div id="documentPreview">
|
||||
<iframe id="previewFrame" style="width:100%; height:800px;" frameborder="0"></iframe>
|
||||
<div id="preloader">
|
||||
<div class="spinner"></div>
|
||||
Loading...
|
||||
</div>
|
||||
</div>
|
||||
<div id="actionButtons" class="mt-3">
|
||||
<br>
|
||||
<a href="declarationtd.php?idtd=<?php echo $idtd; ?>&idtrftd=<?php echo $idtrftd; ?>"><button type="button" class="btn btn-gradient-success waves-effect waves-light"><?php echo $proceed; ?></button></a>
|
||||
<?php if ((Auth::user()->hasRole('Admin')) || (Auth::user()->hasRole('CustomerService')) || (Auth::user()->hasRole('Superuser'))) : ?>
|
||||
<a href="trfdetails.php?idtrf=<?php echo $idtrftd; ?>" target="_blank"><button type="button" class="btn btn-gradient-dark waves-effect waves-light">MODIFICA TRF</button></a>
|
||||
<?php endif; ?>
|
||||
<a href="techdossier_adddocument.php?idtd=<?php echo $idtd; ?>&idtrftd=<?php echo $idtrftd; ?>"><button type="button" class="btn btn-dark waves-effect waves-light" onclick="history.back()"><?php echo $backstep; ?></button></a>
|
||||
<a href="techdossier_stepsummarypreview.php?idtd=<?php echo $idtd; ?>&idtrftd=<?php echo $idtrftd; ?>" target='_blank'><button type="button" class="btn btn-dark waves-effect waves-light">Preview</button></a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Funzione per ottenere i parametri dalla pagina
|
||||
function getParamsFromPage() {
|
||||
// I valori di idtd e idtrftd vengono passati dalla pagina PHP
|
||||
let idtd = <?php echo json_encode($idtd); ?>;
|
||||
let idtrftd = <?php echo json_encode($idtrftd); ?>;
|
||||
return {
|
||||
@@ -487,35 +533,31 @@ $archivetrflist->execute(); ?>
|
||||
};
|
||||
}
|
||||
|
||||
// Funzione per aggiornare l'iframe con i parametri dinamici
|
||||
function updateIframe() {
|
||||
async function loadPreview() {
|
||||
let params = getParamsFromPage();
|
||||
let iframe = document.getElementById('previewFrame');
|
||||
let baseURL = 'http://localhost/cmccopiaoriginale/public/techdossier_stepsummarypreview.php';
|
||||
let queryString = `?idtd=${params.idtd}&idtrftd=${params.idtrftd}`;
|
||||
iframe.src = baseURL + queryString;
|
||||
let previewContainer = document.getElementById('documentPreview');
|
||||
let preloader = document.getElementById('preloader');
|
||||
let baseURL = 'https://www.cimac.it/modulo_certificazione/public/techdossier_stepsummarypreview.php';
|
||||
let url = `${baseURL}?idtd=${params.idtd}&idtrftd=${params.idtrftd}`;
|
||||
|
||||
// Mostra il preloader (già presente nell'HTML)
|
||||
preloader.style.display = 'block';
|
||||
|
||||
try {
|
||||
let response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error('Errore nel caricamento del contenuto');
|
||||
}
|
||||
let html = await response.text();
|
||||
previewContainer.innerHTML = html; // Sostituisce il preloader con il contenuto
|
||||
} catch (error) {
|
||||
previewContainer.innerHTML = '<p>Errore: impossibile caricare l\'anteprima. Contatta l\'assistenza.</p>';
|
||||
console.error('Errore:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Funzione per ridimensionare l'iframe
|
||||
function resizeIframe() {
|
||||
let iframe = document.getElementById('previewFrame');
|
||||
iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
|
||||
iframe.style.width = iframe.contentWindow.document.body.scrollWidth + 'px';
|
||||
}
|
||||
|
||||
// Chiamata alla funzione per aggiornare l'iframe
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
updateIframe();
|
||||
});
|
||||
|
||||
// Aggiungi un listener per ridimensionare l'iframe una volta che il contenuto è stato caricato
|
||||
document.getElementById('previewFrame').onload = function() {
|
||||
resizeIframe();
|
||||
};
|
||||
|
||||
// Event listener per ridimensionare l'iframe quando la finestra viene ridimensionata
|
||||
window.addEventListener('resize', function() {
|
||||
resizeIframe();
|
||||
loadPreview();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -532,24 +574,16 @@ $archivetrflist->execute(); ?>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a href="declarationtd.php?idtd=<?php echo $idtd; ?>&idtrftd=<?php echo $idtrftd; ?>"><button type="button" class="btn btn-gradient-success waves-effect waves-light"><?php echo $proceed; ?></button></a>
|
||||
<?php if ((Auth::user()->hasRole('Admin')) || (Auth::user()->hasRole('CustomerService')) || (Auth::user()->hasRole('Superuser'))) : ?>
|
||||
<a href="trfdetails.php?idtrf=<?php echo $idtrftd; ?>" target="_blank"><button type="button" class="btn btn-gradient-dark waves-effect waves-light">MODIFICA TRF</button></a>
|
||||
<?php endif; ?>
|
||||
<a href="techdossier_adddocument.php?idtd=<?php echo $idtd; ?>&idtrftd=<?php echo $idtrftd; ?>"><button type="button" class="btn btn-dark waves-effect waves-light" onclick="history.back()"><?php echo $backstep; ?></button></a>
|
||||
<a href="techdossier_stepsummarypreview.php?idtd=<?php echo $idtd; ?>&idtrftd=<?php echo $idtrftd; ?>" target='_blank'><button type="button" class="btn btn-dark waves-effect waves-light">Preview</button></a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title end breadcrumb -->
|
||||
<!-- end page title end breadcrumb -->
|
||||
|
||||
|
||||
</div><!-- container -->
|
||||
<!-- footer start -->
|
||||
<?php include 'include/footer.php'; ?>
|
||||
</footer><!--end footer-->
|
||||
</div><!-- container -->
|
||||
<!-- footer start -->
|
||||
<?php include 'include/footer.php'; ?>
|
||||
</footer><!--end footer-->
|
||||
</div>
|
||||
<!-- end page content -->
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user