MIF_E31222641/resources/views/exports/pdf.blade.php

79 lines
1.8 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{ $title }}</title>
<style>
@page {
size: landscape;
margin: 1cm;
}
body {
font-family: "Times New Roman", Times, serif;
font-size: 12pt;
margin: 20px;
}
.header {
text-align: center;
margin-bottom: 20px;
}
.header h1 {
font-size: 14pt;
margin: 0;
}
.header p {
font-size: 12pt;
margin: 5px 0;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-size: 12pt;
}
th, td {
border: 1px solid #000;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
.footer {
text-align: center;
margin-top: 30px;
font-size: 12pt;
}
</style>
</head>
<body>
<div class="header">
<h1>{{ $title }}</h1>
<p>Tahun Angkatan: {{ $tahunAngkatan }}</p>
</div>
<table>
<thead>
<tr>
@foreach($columns as $column)
<th>{{ ucwords(str_replace('_', ' ', $column)) }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach($data as $row)
<tr>
@foreach($columns as $column)
<td>{{ $row[$column] ?? '' }}</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
<p>Dicetak pada: {{ date('d/m/Y H:i:s') }}</p>
</div>
</body>
</html>