This commit is contained in:
Dr Masroor Ehsan 2025-01-10 18:50:17 +06:00
parent 70a376634e
commit 34b0d1f84f
3 changed files with 30 additions and 11 deletions

View File

@ -21,6 +21,7 @@ protected function handle(): string
Pdf::loadView('staff.reports.viewer.html-report', $data) Pdf::loadView('staff.reports.viewer.html-report', $data)
->setPaper('a4', 'landscape') ->setPaper('a4', 'landscape')
->setWarnings(false) ->setWarnings(false)
->setOption('defaultFont', 'Courier')
->save(ReportStorage::abspath($filepath)); ->save(ReportStorage::abspath($filepath));
return $filepath; return $filepath;

View File

@ -6,6 +6,7 @@
use App\Services\Export\ExportDocumentBase; use App\Services\Export\ExportDocumentBase;
use App\Services\ReportStorage; use App\Services\ReportStorage;
use CreateDocx; use CreateDocx;
use Illuminate\Support\Facades\Blade;
final class Word2007Export extends ExportDocumentBase final class Word2007Export extends ExportDocumentBase
{ {
@ -17,7 +18,8 @@ protected function handle(): string
return $filepath; return $filepath;
} }
$html = $this->report->getContent(); $title = 'View Report';
$html = Blade::render('staff.reports.viewer.html-report', ['report' => $this->report, 'title' => $title]);
$docx = new CreateDocx; $docx = new CreateDocx;
$docx->embedHTML($html); $docx->embedHTML($html);
$docx->createDocx(ReportStorage::abspath($filepath)); $docx->createDocx(ReportStorage::abspath($filepath));

View File

@ -1,17 +1,33 @@
<table class="table table-sm"> <table class="table table-sm">
@foreach ($reports as $report) @foreach ($reports as $report)
<tr> <tr>
<td>{{ $report->created_at }}</td> <td class="bg-gray-100">{{ $report->created_at }}</td>
<td>{{ $report->report_status->name }}</td> <td>
<a target="_blank" href="{{ $report->viewUrl() }}">
{{ $report->report_status->name }}
<i class="fa-regular fa-square-arrow-up-right ms-1"></i>
</a>
</td>
<td>{{ $report->radiologist?->name }}</td> <td>{{ $report->radiologist?->name }}</td>
<td><a class="btn btn-primary btn-xs" target="_blank" href="{{ $report->viewUrl() }}">VW</a></td> <td class="align-content-end">
<td><a class="btn btn-info btn-xs" target="_blank" href="{{ $report->wordDownloadUrl() }}">doc</a></td> <a class="btn btn-facebook btn-xs me-1 fs-xsmall fw-light" target="_blank"
<td><a class="btn btn-danger btn-xs" target="_blank" href="{{ $report->pdfDownloadUrl() }}">pdf</a></td> href="{{ $report->wordDownloadUrl() }}">
<td><a class="btn btn-warning btn-xs" target="_blank" href="{{ $report->htmlDownloadUrl() }}">htm</a></td> <img class="me-1" src="{{ asset('imgs/docx.png') }}" alt="DOCX download">doc
</a>
<a class="btn btn-dribbble btn-xs me-1 fs-xsmall fw-light" target="_blank"
href="{{ $report->pdfDownloadUrl() }}">
<img class="me-1" src="{{ asset('imgs/pdf.png') }}" alt="PDF download">pdf
</a>
<a class="btn btn-reddit btn-xs me-1 fs-xsmall fw-ligth" target="_blank"
href="{{ $report->htmlDownloadUrl() }}">
<img class="me-1" src="{{ asset('imgs/html.png') }}" alt="HTML download">htm
</a>
</td>
</tr> </tr>
@endforeach @endforeach
<a class="btn btn-secondary btn-xs" href="{{ route('staff.report.create', $study->hash) }}">
Create
</a>
</table> </table>
<a class="btn btn-secondary btn-xs" href="{{ route('staff.report.create', $study->hash) }}">
Create
</a>