feat: implement internship journal entry system with printable reports and approval workflow
This commit is contained in:
@@ -187,6 +187,66 @@ class InternApplicationResource extends Resource
|
||||
->columnSpanFull()
|
||||
]),
|
||||
|
||||
Tab::make('Staj Defteri & Onay')
|
||||
->icon('heroicon-o-book-open')
|
||||
->schema([
|
||||
\Filament\Forms\Components\Placeholder::make('notebook_view')
|
||||
->label('Doldurulan Staj Defteri')
|
||||
->content(function ($record) {
|
||||
if (!$record) return 'Henüz başvuru bulunmamaktadır.';
|
||||
$days = \App\Http\Controllers\CareerController::getInternshipDates($record->internship_start_date, $record->internship_total_days);
|
||||
if (empty($days)) return 'Staj başlangıç tarihi veya süresi girilmemiş.';
|
||||
|
||||
$saved = $record->journalEntries()->get()->keyBy('day_number');
|
||||
|
||||
$html = '<div class="space-y-4" style="max-height: 400px; overflow-y: auto; padding-right: 10px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 15px;">';
|
||||
foreach ($days as $d) {
|
||||
$dayNum = $d['day_number'];
|
||||
$dateF = $d['formatted_date'];
|
||||
$content = isset($saved[$dayNum]) ? $saved[$dayNum]->content : '';
|
||||
|
||||
$html .= '<div style="margin-bottom: 12px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc;">';
|
||||
$html .= ' <div style="display:flex; justify-content:between; font-size:11px; font-weight:700; color:#475569; border-bottom:1px solid #e2e8f0; padding-bottom:6px; margin-bottom:8px;">';
|
||||
$html .= ' <span style="font-weight: 800; color: #2563eb;">' . $dayNum . '. Gün Raporu</span>';
|
||||
$html .= ' <span style="margin-left: auto;">' . $dateF . '</span>';
|
||||
$html .= ' </div>';
|
||||
$html .= ' <div style="font-size:12px; color:#1e293b; white-space:pre-wrap; line-height:1.5;">' . ($content ? e($content) : '<em style="color:#94a3b8;">Rapor yazılmamış</em>') . '</div>';
|
||||
$html .= '</div>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
// Add preview buttons
|
||||
$html .= '<div style="margin-top: 15px; display: flex; gap: 10px;">';
|
||||
$html .= ' <a href="' . route('intern.print-journal') . '?size=a4&intern_id=' . $record->id . '" target="_blank" style="display:inline-flex; align-items:center; justify-content:center; padding: 8px 16px; background:#2563eb; color:white; border-radius:8px; font-weight:bold; font-size:12px; text-decoration:none; box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);">A4 Defteri Önizle / Yazdır</a>';
|
||||
$html .= ' <a href="' . route('intern.print-journal') . '?size=a5&intern_id=' . $record->id . '" target="_blank" style="display:inline-flex; align-items:center; justify-content:center; padding: 8px 16px; background:#4b5563; color:white; border-radius:8px; font-weight:bold; font-size:12px; text-decoration:none; box-shadow: 0 1px 3px rgba(75, 85, 99, 0.2);">A5 Defteri Önizle / Yazdır</a>';
|
||||
$html .= '</div>';
|
||||
|
||||
return new \Illuminate\Support\HtmlString($html);
|
||||
})
|
||||
->columnSpanFull(),
|
||||
|
||||
\Filament\Forms\Components\Section::make('Onay ve İmza Bilgileri')
|
||||
->schema([
|
||||
\Filament\Forms\Components\Toggle::make('notebook_supervisor_signed')
|
||||
->label('Staj Sorumlusu İmzala / Onayla')
|
||||
->live(),
|
||||
TextInput::make('notebook_supervisor_name')
|
||||
->label('Staj Sorumlusu Adı / Ünvanı')
|
||||
->placeholder('Örn: Alperen Trunç')
|
||||
->default('Alperen Trunç'),
|
||||
\Filament\Forms\Components\Toggle::make('notebook_unit_signed')
|
||||
->label('İlgili Birim Yetkilisi İmzala / Onayla')
|
||||
->live(),
|
||||
TextInput::make('notebook_unit_name')
|
||||
->label('Birim Yetkilisi Adı / Ünvanı')
|
||||
->placeholder('Örn: Yetkili Birim Amiri')
|
||||
->default('Yetkili Birim Amiri'),
|
||||
\Filament\Forms\Components\Toggle::make('notebook_approved')
|
||||
->label('Staj Defterini Genel Olarak Onayla')
|
||||
->columnSpanFull(),
|
||||
])->columns(2),
|
||||
]),
|
||||
|
||||
Tab::make('Sertifika & Transkript')
|
||||
->icon('heroicon-o-academic-cap')
|
||||
->schema([
|
||||
|
||||
Reference in New Issue
Block a user