Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menambah fungsi format NIP dan menengahkan bagian tanda tangan kepala sekolah pada catatan rapor. #119

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion app/Helpers/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,4 +530,26 @@ function get_string_between($string, $start, $end){
$ini += strlen($start);
$len = strpos($string, $end, $ini) - $ini;
return substr($string, $ini, $len);
}
}
function nip_format($nip, $glue = " ") {
$nip = trim($nip," ");
$countChar = strlen($nip);
$subChar = [(empty($nip)?'-':$nip)];
switch ($countChar) {
case 18:
$subChar[0] = substr($nip, 0, 8); // tanggal lahir
$subChar[1] = substr($nip, 8, 6); // tanggal pengangkatan
$subChar[2] = substr($nip, 14, 1); // jenis kelamin
$subChar[3] = substr($nip, 15, 3); // nomor urut
break;
case 15:
$subChar[0] = substr($nip, 0, 8); // tanggal lahir
$subChar[1] = substr($nip, 8, 6); // tanggal pengangkatan
$subChar[2] = substr($nip, 14, 1); // jenis kelamin
break;
case 9:
$subChar = str_split($nip, 3);
break;
}
return implode($glue, $subChar);
}
Binary file added public/images/transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions resources/views/cetak/identitas_peserta_didik.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<td style="width: 50%;padding:5px;">&nbsp;</td>
</tr>
<tr>
<td style="width: 50%;padding:5px;">{{($get_siswa->peserta_didik->sekolah->kasek) ? $get_siswa->peserta_didik->sekolah->kasek->nama_lengkap : $get_siswa->peserta_didik->sekolah->kepala_sekolah->nama_lengkap}}<br />NIP. {{($get_siswa->peserta_didik->sekolah->kasek) ? $get_siswa->peserta_didik->sekolah->kasek->nip : $get_siswa->peserta_didik->sekolah->kepala_sekolah->nip}}</td>
<td style="width: 50%;padding:5px;">{{($get_siswa->peserta_didik->sekolah->kasek) ? $get_siswa->peserta_didik->sekolah->kasek->nama_lengkap : $get_siswa->peserta_didik->sekolah->kepala_sekolah->nama_lengkap}}<br />NIP. {{nip_format(($get_siswa->peserta_didik->sekolah->kasek) ? $get_siswa->peserta_didik->sekolah->kasek->nip : $get_siswa->peserta_didik->sekolah->kepala_sekolah->nip)}}</td>
</tr>
</table>
@endsection
@endsection
42 changes: 24 additions & 18 deletions resources/views/cetak/rapor_catatan.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
<p>...................................................................</p>
</td>
<td style="width:5%"></td>
<td style="width:55%; text-align: right;">
<td style="width:60%; text-align: right;">
<table width="auto">
<tr><td style="text-align: left;">
<p>{{str_replace('Kab. ','',$get_siswa->peserta_didik->sekolah->kabupaten)}},
Expand All @@ -234,7 +234,7 @@
<br>
<p>
<strong><u>{{$get_siswa->rombongan_belajar->wali_kelas->nama_lengkap}}</u></strong><br />
NIP. {{$get_siswa->rombongan_belajar->wali_kelas->nip}}</p>
NIP. {{nip_format($get_siswa->rombongan_belajar->wali_kelas->nip)}}</p>
</td></tr>
</table>
</td>
Expand All @@ -247,19 +247,19 @@
$extend = str_replace('Kepala Sekolah', '', $ks);
$extend = str_replace(' ', '', $extend);
?>
<table width="100%" style="margin-top:10px;">
<table width="100%" style="margin-top:10px;" class="catatan">
<tr>
<td style="width:40%;padding-right:0px;" class="text-right">
<p><br>{{ $extend }}</p>
<td style="width:15%;padding-right:0px;" class="text-right">
<p><br></p>
<br>
<br>
<br>
<br>
<br>
<p>&nbsp;</p>
</td>
<td style="width:60%;">
<p>Mengetahui,<br>{{ $jabatan }}</p>
<td style="width:70%;" class="text-center">
<p>Mengetahui,<br>{{ $extend }} {{ $jabatan }}</p>
<br>
<br>
<br>
Expand All @@ -273,18 +273,24 @@
{{$get_siswa->peserta_didik->sekolah->kepala_sekolah->nama_lengkap}}
@endif
</u></strong></p>
<p class="nip">
NIP.
@if ($get_siswa->peserta_didik->sekolah->kasek)
{{nip_format($get_siswa->peserta_didik->sekolah->kasek->nip)}}
@elseif($get_siswa->peserta_didik->sekolah->kepala_sekolah)
{{nip_format($get_siswa->peserta_didik->sekolah->kepala_sekolah->nip)}}
@endif
</p>
</td>
</tr>
<tr>
<td style="width:40%;"></td>
<td style="width:60%;" class="nip">
NIP.
@if ($get_siswa->peserta_didik->sekolah->kasek)
{{$get_siswa->peserta_didik->sekolah->kasek->nip}}
@elseif($get_siswa->peserta_didik->sekolah->kepala_sekolah)
{{$get_siswa->peserta_didik->sekolah->kepala_sekolah->nip}}
@endif
<td style="width:15%;" class="text-left">
<p><br></p>
<br>
<br>
<br>
<br>
<br>
<p>&nbsp;</p>
</td>
</tr>
</table>
@endsection
@endsection
14 changes: 4 additions & 10 deletions resources/views/cetak/rapor_top.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
<div class="text-center" id="cover_utama">
<br>
<br>
<br>
<img src="{{($get_siswa->rombongan_belajar->sekolah && $get_siswa->rombongan_belajar->sekolah->logo_sekolah) ? public_path('./storage'.config('erapor.storage').'/images/'.$get_siswa->rombongan_belajar->sekolah->logo_sekolah) : public_path('./images/tutwuri.png')}}" style="max-height: 200px" />
<br>
<br>
<br>
<br>
<img src="{{public_path('./images/tutwuri.png')}}" style="max-height: 200px" />
<br>
<br>
<h3>RAPOR PESERTA DIDIK</h3>
<h3>SEKOLAH MENENGAH KEJURUAN</h3>
<h3>(SMK)</h3><br>
<br>
<br>
<h3>(SMK)</h3>
<br>
<img src="{{($get_siswa->rombongan_belajar->sekolah && $get_siswa->rombongan_belajar->sekolah->logo_sekolah) ? public_path('./storage'.config('erapor.storage').'/images/'.$get_siswa->rombongan_belajar->sekolah->logo_sekolah) : public_path('./images/transparent.png')}}" style="max-height: 180px" />
<br>
<br>
{{--dd($get_siswa)--}}
Expand All @@ -41,4 +35,4 @@
<h3>KEMENTERIAN PENDIDIKAN, KEBUDAYAAN, RISET DAN TEKNOLOGI<br>REPUBLIK INDONESIA</h3>
</div>
</div>
@endsection
@endsection