275 lines
9.8 KiB
PHP
275 lines
9.8 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
<title>Fiche Agent - {{ $agent->first_name }} {{ $agent->last_name }}</title>
|
|
<style>
|
|
@page {
|
|
margin: 0cm 0cm;
|
|
}
|
|
body {
|
|
font-family: 'Helvetica', 'Arial', sans-serif;
|
|
margin-top: 3cm;
|
|
margin-left: 2cm;
|
|
margin-right: 2cm;
|
|
margin-bottom: 2cm;
|
|
color: #333;
|
|
line-height: 1.5;
|
|
}
|
|
header {
|
|
position: fixed;
|
|
top: 0cm;
|
|
left: 0cm;
|
|
right: 0cm;
|
|
height: 2.5cm;
|
|
background-color: #f3f4f6; /* gray-100 */
|
|
border-bottom: 2px solid #dc2626; /* red-600 */
|
|
color: #1f2937;
|
|
padding: 0.5cm 2cm;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.header-content {
|
|
width: 100%;
|
|
}
|
|
.logo-text {
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
color: #1f2937;
|
|
text-transform: uppercase;
|
|
}
|
|
.logo-subtext {
|
|
color: #dc2626; /* red */
|
|
}
|
|
.document-title {
|
|
text-align: right;
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
color: #1f2937;
|
|
position: absolute;
|
|
top: 0.8cm;
|
|
right: 2cm;
|
|
}
|
|
.section-title {
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
color: #fff;
|
|
background-color: #dc2626; /* red-600 */
|
|
padding: 5px 10px;
|
|
margin-top: 20px;
|
|
margin-bottom: 10px;
|
|
border-radius: 4px;
|
|
}
|
|
.info-grid {
|
|
width: 100%;
|
|
margin-bottom: 20px;
|
|
}
|
|
.info-row {
|
|
margin-bottom: 8px;
|
|
}
|
|
.label {
|
|
font-weight: bold;
|
|
color: #4b5563; /* gray-600 */
|
|
width: 30%;
|
|
display: inline-block;
|
|
}
|
|
.value {
|
|
color: #111827; /* gray-900 */
|
|
font-weight: normal;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-top: 10px;
|
|
font-size: 14px;
|
|
}
|
|
th {
|
|
background-color: #f3f4f6;
|
|
color: #374151;
|
|
font-weight: bold;
|
|
text-align: left;
|
|
padding: 8px;
|
|
border-bottom: 2px solid #e5e7eb;
|
|
}
|
|
td {
|
|
padding: 8px;
|
|
border-bottom: 1px solid #e5e7eb;
|
|
vertical-align: top;
|
|
}
|
|
.service-section {
|
|
margin-top: 15px;
|
|
page-break-inside: avoid;
|
|
}
|
|
.service-header {
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
color: #2563eb; /* blue-600 */
|
|
border-bottom: 1px solid #bfdbfe;
|
|
padding-bottom: 4px;
|
|
margin-bottom: 8px;
|
|
}
|
|
.checkbox {
|
|
display: inline-block;
|
|
width: 12px;
|
|
height: 12px;
|
|
border: 1px solid #9ca3af;
|
|
margin-right: 6px;
|
|
vertical-align: middle;
|
|
}
|
|
.checkbox.checked {
|
|
background-color: #10b981; /* green-500 */
|
|
border-color: #10b981;
|
|
}
|
|
footer {
|
|
position: fixed;
|
|
bottom: 0cm;
|
|
left: 0cm;
|
|
right: 0cm;
|
|
height: 1.5cm;
|
|
background-color: #f3f4f6;
|
|
color: #6b7280;
|
|
text-align: center;
|
|
line-height: 1.5cm;
|
|
font-size: 10px;
|
|
border-top: 1px solid #e5e7eb;
|
|
}
|
|
.status-badge {
|
|
display: inline-block;
|
|
padding: 2px 8px;
|
|
border-radius: 12px;
|
|
font-size: 10px;
|
|
font-weight: bold;
|
|
text-transform: uppercase;
|
|
color: #fff;
|
|
}
|
|
.status-completed { background-color: #10b981; }
|
|
.status-pending { background-color: #fbbf24; color: #78350f; }
|
|
.status-processing { background-color: #3b82f6; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="header-content">
|
|
<img src="{{ public_path('images/logo_agglo.png') }}" alt="Logo Agglomération Béziers Méditerranée" style="height: 2cm;">
|
|
<div class="document-title">FICHE AGENT</div>
|
|
</div>
|
|
</header>
|
|
|
|
<footer>
|
|
Document généré le {{ $date }} - Confidentiel RH
|
|
</footer>
|
|
|
|
<!-- Agent Information -->
|
|
<div class="section-title">IDENTITÉ DE L'AGENT</div>
|
|
<div class="info-grid">
|
|
<div class="info-row">
|
|
<span class="label">Nom complet :</span>
|
|
<span class="value" style="font-size: 16px; font-weight: bold; text-transform: uppercase;">{{ $agent->last_name }} {{ $agent->first_name }}</span>
|
|
</div>
|
|
<div class="info-row">
|
|
<span class="label">Poste :</span>
|
|
<span class="value">{{ $agent->position }}</span>
|
|
</div>
|
|
<div class="info-row">
|
|
<span class="label">Service/Direction :</span>
|
|
<span class="value">{{ $agent->department }}</span>
|
|
</div>
|
|
<div class="info-row">
|
|
<span class="label">Date d'arrivée :</span>
|
|
<span class="value">{{ \Carbon\Carbon::parse($agent->arrival_date)->format('d/m/Y') }}</span>
|
|
</div>
|
|
<div class="info-row">
|
|
<span class="label">Email :</span>
|
|
<span class="value">{{ $agent->email }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Integration Details -->
|
|
<div class="section-title">DÉTAILS DE L'INTÉGRATION</div>
|
|
<div class="info-grid">
|
|
<div class="info-row">
|
|
<span class="label">Type de demande :</span>
|
|
<span class="value">{{ $integration->type === 'onboarding' ? 'Arrivée (Onboarding)' : 'Départ (Offboarding)' }}</span>
|
|
</div>
|
|
<div class="info-row">
|
|
<span class="label">Modèle utilisé :</span>
|
|
<span class="value">{{ $integration->template ? $integration->template->name : 'Aucun (Standard)' }}</span>
|
|
</div>
|
|
<div class="info-row">
|
|
<span class="label">État global :</span>
|
|
<span class="value">
|
|
@if($integration->status === \App\Enums\IntegrationStatus::Completed)
|
|
<span class="status-badge status-completed">Terminé</span>
|
|
@elseif($integration->status === \App\Enums\IntegrationStatus::Draft)
|
|
<span class="status-badge status-pending">Brouillon</span>
|
|
@else
|
|
<span class="status-badge status-processing">En Cours</span>
|
|
@endif
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tasks List -->
|
|
<div class="section-title">SUIVI DES TÂCHES PAR SERVICE</div>
|
|
|
|
@foreach($integration->serviceTasks as $task)
|
|
<div class="service-section">
|
|
<div class="service-header">{{ $task->service->name }}</div>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th width="70%">Tâche / Équipement</th>
|
|
<th width="30%">État</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($task->taskItems as $item)
|
|
@php
|
|
// If integration is completed, skip non-mandatory items that were not completed
|
|
$isIntegrationCompleted = $integration->status === \App\Enums\IntegrationStatus::Completed;
|
|
if ($isIntegrationCompleted && !$item->is_mandatory && !$item->is_completed) {
|
|
continue;
|
|
}
|
|
@endphp
|
|
<tr>
|
|
<td>
|
|
<div class="checkbox {{ $item->is_completed ? 'checked' : '' }}"></div>
|
|
{{ $item->label }}
|
|
@if($item->data && is_array($item->data) && count($item->data) > 0)
|
|
<div style="margin-left: 20px; margin-top: 4px; font-size: 12px; color: #4b5563;">
|
|
@foreach($item->data as $key => $value)
|
|
<div><strong>{{ ucfirst($key) }} :</strong> {{ $value }}</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if($item->is_completed)
|
|
<div>Fait</div>
|
|
@if($item->completedBy)
|
|
<div style="font-size: 10px; color: #6b7280; margin-top: 2px;">
|
|
par {{ $item->completedBy->name }}
|
|
</div>
|
|
@endif
|
|
@else
|
|
<span style="color: #6b7280;">À faire</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
@if($task->taskItems->isEmpty())
|
|
<tr>
|
|
<td colspan="2" style="font-style: italic; color: #888;">Aucune tâche spécifique listée.</td>
|
|
</tr>
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@endforeach
|
|
|
|
<div style="margin-top: 30px; font-size: 12px; color: #666; border-top: 1px solid #ddd; padding-top: 10px;">
|
|
<p>Ce document récapitule l'ensemble des actions et équipements prévus pour l'agent. Il peut servir de feuille de route pour les services concernés.</p>
|
|
</div>
|
|
</body>
|
|
</html>
|