| return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-toggle="tooltip" data-placement="top" title="'.$attach['file_title'].'.'.$attach['file_ext'].'" data-fancybox data-type="iframe" data-src="/downlaod/?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-file-picture"></span> '.$this->truncate($attachTitle, $titleLength).'</a>'.$wrapEnd; | return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-toggle="tooltip" data-placement="top" title="'.$attach['file_title'].'.'.$attach['file_ext'].'" data-fancybox data-type="iframe" data-src="/downlaod/?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-file-picture"></span> '.$this->truncate($attachTitle, $titleLength).'</a>'.$wrapEnd; | ||||
| break; | break; | ||||
| case 'dicom': | |||||
| return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-fancybox data-type="iframe" data-src="/dicom/index.php?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-file-picture"></span> '.$attachTitle.'</a>'.$wrapEnd; | |||||
| break; | |||||
| default: | default: | ||||
| return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-toggle="tooltip" data-placement="top" title="'.$attach['file_title'].'.'.$attach['file_ext'].'" data-fancybox data-type="iframe" data-src="/downlaod/?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-download3"></span> '.$this->truncate($attachTitle, $titleLength).'</a>'.$wrapEnd; | return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-toggle="tooltip" data-placement="top" title="'.$attach['file_title'].'.'.$attach['file_ext'].'" data-fancybox data-type="iframe" data-src="/downlaod/?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-download3"></span> '.$this->truncate($attachTitle, $titleLength).'</a>'.$wrapEnd; | ||||
| } | } |
| $dicomFilePath = ATTACH_DIR . $file_name; | $dicomFilePath = ATTACH_DIR . $file_name; | ||||
| echo $dicomFilePath; | |||||
| /* | |||||
| // Verifica che il file DICOM esista | // Verifica che il file DICOM esista | ||||
| if (file_exists($dicomFilePath)) { | if (file_exists($dicomFilePath)) { | ||||
| // Imposta l'intestazione Content-Type per il file DICOM | // Imposta l'intestazione Content-Type per il file DICOM | ||||
| // Restituisci un errore 404 se il file non viene trovato | // Restituisci un errore 404 se il file non viene trovato | ||||
| http_response_code(404); | http_response_code(404); | ||||
| echo "File non trovato."; | echo "File non trovato."; | ||||
| }*/ | |||||
| } | |||||
| ?> | ?> |
| //exit(0); | //exit(0); | ||||
| } | } | ||||
| $attach = $db->where('id', $attachId)->getOne('requests_attachments'); | |||||
| $file_name = $attach['file_name']; | |||||
| ?> | ?> | ||||
| <!DOCTYPE html> | <!DOCTYPE html> | ||||
| <html lang="it"> | <html lang="it"> | ||||
| <title>Dicom</title> | <title>Dicom</title> | ||||
| <style> | <style> | ||||
| html, body {width: 100%; height:100%; background-color: black; display:flex; justify-content:center;} | |||||
| #dicomImage { | #dicomImage { | ||||
| width: 100%; | |||||
| height: 100%; | |||||
| width: 600px; | |||||
| height: 600px; | |||||
| position: relative; | position: relative; | ||||
| } | } | ||||
| </style> | </style> | ||||
| cornerstone.enable(element); | cornerstone.enable(element); | ||||
| // Carica l'immagine DICOM da un URL | // Carica l'immagine DICOM da un URL | ||||
| const dicomUrl = '/dicom-files/sample.dcm'; // Aggiorna questo con il tuo percorso | |||||
| const dicomUrl = '/dicom/dicom.php?attach_id=<?php echo $attachId ?>'; // Aggiorna questo con il tuo percorso | |||||
| const imageId = 'wadouri:' + dicomUrl; | const imageId = 'wadouri:' + dicomUrl; | ||||
| // Carica e visualizza l'immagine | // Carica e visualizza l'immagine |