update dossier chekcqual
This commit is contained in:
+56
-16
@@ -51,11 +51,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) {
|
||||
@@ -677,7 +689,8 @@ if ($virusprot == "Y") :
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 50%;" colspan="1">Protezione da Virus</td>
|
||||
<td>{}</td>
|
||||
<td>' . (($virusprot == 'Y') ? 'Sì' : 'No') . '</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>';
|
||||
@@ -816,17 +829,28 @@ $partsquery->setQuery("SELECT * FROM identificationparts WHERE identificationpar
|
||||
$partsquery->execute();
|
||||
|
||||
while (!$partsquery->atEnd()) {
|
||||
// Decodifica e sanitizza ogni valore del database
|
||||
$partsidnumber = htmlspecialchars(html_entity_decode($partsquery->getColumnVal('partsidnumber'), ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
||||
$description = htmlspecialchars(html_entity_decode($partsquery->getColumnVal('description_identificationparts'), ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
||||
$article = htmlspecialchars(html_entity_decode($partsquery->getColumnVal('article_identificationparts'), ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
||||
$color = htmlspecialchars(html_entity_decode($partsquery->getColumnVal('color_identificationparts'), ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
||||
$material = htmlspecialchars(html_entity_decode($partsquery->getColumnVal('material_identificationparts'), ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
||||
$reportnumber = htmlspecialchars(html_entity_decode($partsquery->getColumnVal('cmcreportnumber_identificationparts'), ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
||||
$reportdate = htmlspecialchars(html_entity_decode($partsquery->getColumnVal('cmcreportdate_identificationparts'), ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
||||
|
||||
// Costruisci la riga HTML
|
||||
$html .= "<tr>
|
||||
<td class='header-data'>{$partsquery->getColumnVal('partsidnumber')}</td>
|
||||
<td class='header-data'>{$partsquery->getColumnVal('description_identificationparts')}</td>
|
||||
<td class='header-data'>{$partsquery->getColumnVal('article_identificationparts')}</td>
|
||||
<td class='header-data'>{$partsquery->getColumnVal('color_identificationparts')}</td>
|
||||
<td class='header-data'>{$partsquery->getColumnVal('material_identificationparts')}</td>
|
||||
<td class='header-data'>{$partsquery->getColumnVal('cmcreportnumber_identificationparts')}</td>
|
||||
<td class='header-data'>{$partsquery->getColumnVal('cmcreportdate_identificationparts')}</td>
|
||||
</tr>";
|
||||
<td class='header-data'>" . $partsidnumber . "</td>
|
||||
<td class='header-data'>" . $description . "</td>
|
||||
<td class='header-data'>" . $article . "</td>
|
||||
<td class='header-data'>" . $color . "</td>
|
||||
<td class='header-data'>" . $material . "</td>
|
||||
<td class='header-data'>" . $reportnumber . "</td>
|
||||
<td class='header-data'>" . $reportdate . "</td>
|
||||
</tr>";
|
||||
$partsquery->moveNext();
|
||||
}
|
||||
|
||||
$html .= '</tbody></table>';
|
||||
|
||||
//ce mark example
|
||||
@@ -873,7 +897,9 @@ $html .= <<<HTML
|
||||
HTML;
|
||||
|
||||
if ($cemarkup == 'Y') {
|
||||
$filePathdoc = '{$base_url}uploadtddocuments/' . htmlspecialchars($fileDetails['filename_fileattached']);
|
||||
// $filePathdoc = '{$base_url}uploadtddocuments/' . htmlspecialchars($fileDetails['filename_fileattached']);
|
||||
$filePathdoc = $base_url . "uploadtddocuments/" . htmlspecialchars($fileDetails['filename_fileattached']);
|
||||
$localFilePath = $_SERVER['DOCUMENT_ROOT'] . "/modulo_certificazione/public/uploadtddocuments/" . htmlspecialchars($fileDetails['filename_fileattached']);
|
||||
$fileDescription = htmlspecialchars($fileDetails['description_fileattached']);
|
||||
$fileExtension = strtolower(pathinfo($filePathdoc, PATHINFO_EXTENSION));
|
||||
|
||||
@@ -883,8 +909,21 @@ if ($cemarkup == 'Y') {
|
||||
<td>
|
||||
HTML;
|
||||
|
||||
// if (in_array($fileExtension, ['jpg', 'jpeg', 'png', 'gif'])) {
|
||||
// $html .= "<img src='$filePathdoc' alt='$fileDescription' style='max-height: 200px;'>";
|
||||
//} else {
|
||||
// $linkattach = $base_url . "uploadtddocuments/" . $fileDetails['filename_fileattached'];
|
||||
// $html .= "<a href='{$linkattach}' target='_blank'>$fileDescription</a>";
|
||||
// }
|
||||
|
||||
if (in_array($fileExtension, ['jpg', 'jpeg', 'png', 'gif'])) {
|
||||
$html .= "<img src='$filePathdoc' alt='$fileDescription' style='max-height: 200px;'>";
|
||||
if (file_exists($localFilePath)) {
|
||||
$imageData = base64_encode(file_get_contents($localFilePath));
|
||||
$mimeType = mime_content_type($localFilePath);
|
||||
$html .= "<img src='data:$mimeType;base64,$imageData' alt='$fileDescription' style='max-height: 200px;'>";
|
||||
} else {
|
||||
$html .= "<p>Image file not found: $localFilePath</p>";
|
||||
}
|
||||
} else {
|
||||
$linkattach = $base_url . "uploadtddocuments/" . $fileDetails['filename_fileattached'];
|
||||
$html .= "<a href='{$linkattach}' target='_blank'>$fileDescription</a>";
|
||||
@@ -1063,6 +1102,7 @@ HTML;
|
||||
$html .= '</tbody></table></body></html>';
|
||||
|
||||
//echo $html;
|
||||
|
||||
// Carica il tuo HTML nel Dompdf
|
||||
$dompdf->loadHtml($html);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user