kop Surat Peringatan disamakan dengan format resmi (logo lambang Jatim bersih + 6 baris + garis tebal, nama sekolah satu baris via nowrap) + refactor schoolSettings()
This commit is contained in:
@@ -25,13 +25,7 @@ class SpLetterController extends Controller
|
||||
abort_unless(auth()->user()->canViewStudent($spLetter->student_id), 403);
|
||||
|
||||
$spLetter->load(['student', 'spThreshold', 'generator']);
|
||||
$school = [
|
||||
'name' => Setting::getValue('school_name', 'SMK'),
|
||||
'address' => Setting::getValue('school_address', ''),
|
||||
'phone' => Setting::getValue('school_phone', ''),
|
||||
'kepala_sekolah' => Setting::getValue('kepala_sekolah_name', ''),
|
||||
'kepala_sekolah_nip' => Setting::getValue('kepala_sekolah_nip', ''),
|
||||
];
|
||||
$school = $this->schoolSettings();
|
||||
|
||||
return view('sp-letters.show', compact('spLetter', 'school'));
|
||||
}
|
||||
@@ -41,17 +35,33 @@ class SpLetterController extends Controller
|
||||
abort_unless(auth()->user()->canViewStudent($spLetter->student_id), 403);
|
||||
|
||||
$spLetter->load(['student', 'spThreshold', 'generator']);
|
||||
$school = [
|
||||
'name' => Setting::getValue('school_name', 'SMK'),
|
||||
'address' => Setting::getValue('school_address', ''),
|
||||
'phone' => Setting::getValue('school_phone', ''),
|
||||
'kepala_sekolah' => Setting::getValue('kepala_sekolah_name', ''),
|
||||
'kepala_sekolah_nip' => Setting::getValue('kepala_sekolah_nip', ''),
|
||||
];
|
||||
$school = $this->schoolSettings();
|
||||
|
||||
$spLetter->update(['printed_at' => now(), 'status' => 'printed']);
|
||||
|
||||
// For now, return an HTML print view
|
||||
return view('sp-letters.print', compact('spLetter', 'school'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Data sekolah untuk kop surat (format resmi).
|
||||
*/
|
||||
protected function schoolSettings(): array
|
||||
{
|
||||
return [
|
||||
'name' => Setting::getValue('school_name', 'SMK'),
|
||||
'address' => Setting::getValue('school_address', ''),
|
||||
'phone' => Setting::getValue('school_phone', ''),
|
||||
'logo' => Setting::getValue('school_logo', ''),
|
||||
'kop_logo' => Setting::getValue('kop_logo', ''),
|
||||
'government' => Setting::getValue('school_government', 'PEMERINTAH PROVINSI JAWA TIMUR'),
|
||||
'agency' => Setting::getValue('school_agency', 'DINAS PENDIDIKAN'),
|
||||
'full_name' => Setting::getValue('school_full_name', Setting::getValue('school_name', 'SMK')),
|
||||
'address_detail' => Setting::getValue('school_address_detail', ''),
|
||||
'website_email' => Setting::getValue('school_website_email', ''),
|
||||
'postal' => Setting::getValue('school_postal', ''),
|
||||
'kepala_sekolah' => Setting::getValue('kepala_sekolah_name', ''),
|
||||
'kepala_sekolah_nip' => Setting::getValue('kepala_sekolah_nip', ''),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user