@extends('layouts.contentLayoutMaster')

@section('title','Lihat SKJD')

@section('vendor-styles')
<link rel="stylesheet" type="text/css" href="{{asset('css/plugins/forms/validation/form-validation.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('vendors/css/forms/select/select2.min.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('vendors/css/pickers/pickadate/pickadate.css')}}">
@endsection

@section('page-styles')
<link rel="stylesheet" type="text/css" href="{{asset('css/pages/page-users.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('css/pages/app-invoice.css')}}">
@endsection

@section('content')
    <!-- app invoice View Page -->
<section class="invoice-view-wrapper">
  <div class="row">
    <!-- invoice view page -->
    <div class="col-lg-9 col-12">
      <div class="card invoice-print-area d-none d-sm-block">
        <div class="card-content">
          <div class="card-body pb-0">
            <!-- header section -->
            <!-- logo and title -->
            <div class="row my-2 justify-content-center">
                <div class="col-11" style="border-bottom: 2px solid #000 !important; padding-bottom: 3px">
                  <div class="row" style="border-bottom: 5px solid #000 !important; padding-bottom: 10px">
                      <div class="col-1 text-center mb-2">
                        <img src="{{asset('images/logo/fakfak1.png')}}" alt="logo" width="120">
                      </div>
                      <div class="col-11 text-center" style="color: black !important;  margin-left: -35px;">
                        <h3 style="color: black !important">PEMERINTAH KABUPATEN FAKFAK</h3>
                        <h2 style="color: black !important">DISTRIK PARIWARI</h2>
                        <h1 style="color: black !important">KELURAHAN WAGOM</h1>
                        <span><em>JL. CHRISTINA MARTHA TIAHAHU TLP. 0956 23971</em></span>
                    </div>
                  </div>
              </div>
              <div class="col1 pt-2 pb-0 text-center">
                <span class="h5" style="color: black !important; font-size: 1.4rem; border-bottom: 2px solid black;">SURAT KETERANGAN JANDA / DUDA</span>
                <p style="color: black !important; font-weight: 600; font-size: 1.4rem">NO: 474.4/@if($skjd->no_surat == 0)-@else{{ $skjd->no_surat }}@endif/SKJD/KW/{{ date('Y')}}</p>
              </div>
            </div>
            <div class="row my-2 justify-content-center">
                <div class="col-11 text-justify">
                    <p class="text-justify" style="color: black !important;">(Untuk memperoleh pensiunan janda/duda bayaran pensiunan menurut undang-Undang No.11 Tahun 1969)</p>
                    <p class="text-justify" style="color: black !important;">Yang bertanda tangan dibawah ini :</p>
                    <p class="text-justify" style="color: black !important;">Kepala Kelurahan Wagom Distrik Pariwari dengan ini menerangkan dengan mengingat sumpah jabatan bahwa :</p>
                    <div class="row justify-content-center">
                        <div class="col-11 mt-1 text-left">
                            <div class="table-responsive">
                                <table class="table table-borderless" style="border-spacing: 0px; color:#333">
                                    <tbody>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Nama</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->name}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Tempat, Tanggal Lahir</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->profil->tempat_lahir}}, {{$skjd->user->profil->tanggal_lahir}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Nomor Kartu Keluarga</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->profil->no_kk}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Nomor Induk Penduduk (NIK)</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->nik}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Pekerjaan</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->profil->pekerjaan}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Jumlah Anak</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->jumlah_anak}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Tempat Tinggal</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->profil->alamat}} RT {{$skjd->user->profil->rt}} RW {{$skjd->user->profil->rw}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <p class="text-justify" style="color: black !important;">&emsp;&emsp;Benar-benar adalah masyarakat di <span style="text-transform: capitalize">{{$skjd->user->profil->alamat}} RT {{$skjd->user->profil->rt}} RW {{$skjd->user->profil->rw}}</span> Kelurahan {{ Str::title($villages->name) }}, Distrik {{ Str::title($districts->name) }}, {{ Str::title($cities->name) }}, Provinsi {{ Str::title($provinces->name) }}, dan menurut Kartu Keluarga (KK) yang ada, bahwa :</p>
                    <div class="row justify-content-center">
                        <div class="col-11 text-justify">
                            <div class="table-responsive">
                                <table class="table table-borderless" style="border-spacing: 0px; color:#333">
                                    <tbody>
                                        <tr>
                                            <td style="padding: 5px 10px; font-size: 18px !important; text-transform: none; color: black">a. Ia adalah Suami/Istri Sah dari almarhum/almarhumah <b>{{ $skjd->nama_suami_istri }}</b> yang merupakan ASN Pada Intansi {{ $skjd->instansi }}, yang telah meninggal dunia pada tanggal {{ $skjd->tanggal_meninggal }} di {{ $skjd->tempat_meninggal }}. </td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 5px 10px; font-size: 18px !important; text-transform: none; color: black">b. Tercatat, bersangkutan yang bertanda tangan diatas hingga saat surat ini dikeluarkan belum menikah lagi.</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <p class="text-justify" style="color: black !important;">&emsp;&emsp;Demikian Surat Keterangan Janda/Duda ini dibuat untuk dipergunakan sebagaimana mestinya.</p>

                </div>
            </div>
            <div class="row my-2 justify-content-center">
                <div class="col-11 text-justify">
                    <div class="row justify-content-end">
                        <div class="col-5 mt-1 text-justify">
                            <div class="table-responsive">
                                <table class="table table-borderless text-center" style="border-spacing: 0px; color:#333">
                                    <tbody>
                                        <tr>
                                            <td width="240px" style="padding: 5px 10px; text-align: left">
                                            <a class="text-bold-600">DIBUAT DI : WAGOM</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="240px" style="padding: 5px 10px; text-align: left">
                                            <a class="text-bold-600">PADA TANGGAL : 
                                                @if($skjd->tanggal == NULL)
                                                -
                                                @else
                                                {{ $skjd->tanggal }}
                                                @endif
                                            </a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="240px" style="padding: 5px 10px;"><img src="{{asset('images/qr-code.png')}}" alt="ttd" width="100"></td>
                                        </tr>
                                        <tr>
                                            <td width="240px" style="padding: 5px 10px;">
                                                <a class="text-bold-600" style="border-bottom: 2px solid black;">ABDURRASYID WADJO,SE</a>                                               
                                                <a>NIP.197308262005021004</a>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
          </div>
        </div>
      </div>
      <div class="card invoice-print-area d-print-none d-block d-sm-none">
        <div class="card-content">
          <div class="card-body pb-0">
            <!-- header section -->
            <!-- logo and title -->
            <div class="row my-2 justify-content-center">
                <div class="col-12 col-lg-10" style="border-bottom: 2px solid #000 !important; padding-bottom: 3px">
                  <div class="row" style="border-bottom: 5px solid #000 !important; padding-bottom: 10px">
                      <div class="col-12 col-md-1 text-center mb-2">
                        <img src="{{asset('images/logo/fakfak1.png')}}" alt="logo" width="120">
                      </div>
                      <div class="col-12 col-md-11 text-center" style="color: black !important;">
                        <h3 style="color: black !important">PEMERINTAH KABUPATEN FAKFAK</h3>
                        <h2 style="color: black !important">DISTRIK PARIWARI</h2>
                        <h1 style="color: black !important">KELURAHAN WAGOM</h1>
                        <span><em>JL. CHRISTINA MARTHA TIAHAHU TLP. 0956 23971</em></span>
                    </div>
                  </div>
              </div>
              <div class="col-12 col-md-7 pt-2 pb-0 text-center">
                <span class="h5" style="color: black !important; font-size: 1.4rem; border-bottom: 2px solid black;">SURAT KETERANGAN JANDA / DUDA</span>
                <p style="color: black !important; font-weight: 600; font-size: 1.4rem">NO: 474.4/@if($skjd->no_surat == 0)-@else{{ $skjd->no_surat }}@endif/SKJD/KW/{{ date('Y')}}</p>
              </div>
            </div>
            <div class="row my-2 justify-content-center">
                <div class="col-12 col-lg-10 text-justify">
                    <p class="text-justify" style="color: black !important;">(Untuk memperoleh pensiunan janda/duda bayaran pensiunan menurut undang-Undang No.11 Tahun 1969)</p>
                    <p class="text-justify" style="color: black !important;">Yang bertanda tangan dibawah ini :</p>
                    <p class="text-justify" style="color: black !important;">Kepala Kelurahan Wagom Distrik Pariwari dengan ini menerangkan dengan mengingat sumpah jabatan bahwa :</p>
                    <div class="row justify-content-center">
                        <div class="col-12 col-lg-11 mt-1 text-left">
                            <div class="table-responsive">
                                <table class="table table-borderless" style="border-spacing: 0px; color:#333">
                                    <tbody>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Nama</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->name}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Tempat, Tanggal Lahir</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->profil->tempat_lahir}}, {{$skjd->user->profil->tanggal_lahir}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Nomor Kartu Keluarga</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->profil->no_kk}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Nomor Induk Penduduk (NIK)</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->nik}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Pekerjaan</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->profil->pekerjaan}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Jumlah Anak</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->jumlah_anak}}</td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 0px 10px; font-weight: 600">Tempat Tinggal</td>
                                            <td style="padding: 0px 10px; font-weight: 600">:</td>
                                            <td style="padding: 0px 10px; font-weight: 600">{{$skjd->user->profil->alamat}} RT {{$skjd->user->profil->rt}} RW {{$skjd->user->profil->rw}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <p class="text-justify" style="color: black !important;">&emsp;&emsp;Benar-benar adalah masyarakat di <span style="text-transform: capitalize">{{$skjd->user->profil->alamat}} RT {{$skjd->user->profil->rt}} RW {{$skjd->user->profil->rw}}</span> Kelurahan {{ Str::title($villages->name) }}, Distrik {{ Str::title($districts->name) }}, {{ Str::title($cities->name) }}, Provinsi {{ Str::title($provinces->name) }}, dan menurut Kartu Keluarga (KK) yang ada, bahwa :</p>
                    <div class="row justify-content-center">
                        <div class="col-12 col-lg-11 text-justify">
                            <div class="table-responsive">
                                <table class="table table-borderless" style="border-spacing: 0px; color:#333">
                                    <tbody>
                                        <tr>
                                            <td style="padding: 5px 10px; font-size: 18px !important; text-transform: none; color: black">a. Ia adalah Suami/Istri Sah dari almarhum/almarhumah <b>{{ $skjd->nama_suami_istri }}</b> yang merupakan ASN Pada Intansi {{ $skjd->instansi }}, yang telah meninggal dunia pada tanggal {{ $skjd->tanggal_meninggal }} di {{ $skjd->tempat_meninggal }}. </td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 5px 10px; font-size: 18px !important; text-transform: none; color: black">b. Tercatat, bersangkutan yang bertanda tangan diatas hingga saat surat ini dikeluarkan belum menikah lagi.</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <p class="text-justify" style="color: black !important;">&emsp;&emsp;Demikian Surat Keterangan Janda/Duda ini dibuat untuk dipergunakan sebagaimana mestinya.</p>
                </div>
            </div>
            <div class="row my-2 justify-content-center">
                <div class="col-9 col-lg-10 text-justify">
                    <div class="row justify-content-end">
                        <div class="col-12 col-md-5 mt-1 text-justify">
                            <div class="table-responsive">
                                <table class="table table-borderless text-center" style="border-spacing: 0px; color:#333">
                                    <tbody>
                                        <tr>
                                            <td width="240px" style="padding: 5px 10px; text-align: left">
                                            <a class="text-bold-600">DIBUAT DI : WAGOM</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="240px" style="padding: 5px 10px; text-align: left">
                                            <a class="text-bold-600">PADA TANGGAL : 
                                                @if($skjd->tanggal == NULL)
                                                -
                                                @else
                                                {{ $skjd->tanggal }}
                                                @endif
                                            </a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="240px" style="padding: 5px 10px;"><img src="{{asset('images/qr-code.png')}}" alt="ttd" width="100"></td>
                                        </tr>
                                        <tr>
                                            <td width="240px" style="padding: 5px 10px;">
                                                <a class="text-bold-600" style="border-bottom: 2px solid black;">ABDURRASYID WADJO,SE</a>                                              
                                                <a>NIP.197308262005021004</a>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- invoice action  -->
    <div class="col-lg-3 col-12">
      <div class="card invoice-action-wrapper shadow-none border">
        <div class="card-body">
            @can ('acc cetak surat')
                @if ($skjd->status === 'SUDAH ACC LURAH')
                    <div class="invoice-action-btn mb-1">
                        <a type="button" href="#" name="acccetak" id="{{ $skjd->id }}" class="acccetak btn btn-success btn-block text-white" title="ACC">
                        <i class='bx bx-check-double'></i>
                        <span>Tandai Sudah Dicetak</span>
                        </a>
                    </div>
                @endif
            @endcan
            @can ('acc validasi surat')
                @if ($skjd->status === 'SUDAH ACC STAFF')
                    <div class="invoice-action-btn mb-1">
                        <a type="button" href="#" name="acclurah" id="{{ $skjd->id }}" class="acclurah btn btn-success btn-block text-white" title="ACC">
                        <i class='bx bx-check-double'></i>
                        <span>ACC Surat</span>
                        </a>
                    </div>
                @endif
            @endcan
            @can ('print surat')
                    <div class="invoice-action-btn mb-0">
                        <a class="btn btn-danger btn-block text-white invoice-print">
                            <i class='bx bx-printer'></i>
                        <span>Print</span>
                        </a>
                    </div>
            @endcan
        </div>
      </div>
    </div>
  </div>
</section>
<div id="modalAccLurah" class="modal fade text-left" id="danger" tabindex="-1" role="dialog"
    aria-labelledby="myModalLabel120" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header bg-success">              
                <h5 class="modal-title white">Konfirmasi</h5>
                <button type="button" class="close btn btn-sm" data-dismiss="modal" aria-label="Close">
                    <i class="bx bx-x"></i>
                </button>
            </div>
            <div class="modal-body">
                <h5 align="center" style="margin:0;">Apakah Anda yakin akan <span class="text-success"> ACC </span> data ini?</h5>
            </div>
            <div class="modal-footer">
                <button type="button" name="ok_aktif" id="ok_aktif" class="btn btn-sm btn-success">OK</button>
                <button type="button" class="btn btn-sm btn-light-secondary" data-dismiss="modal">Batal</button>
            </div>
        </div>
    </div>
</div>
<div id="modalAccCetak" class="modal fade text-left" id="danger" tabindex="-1" role="dialog"
    aria-labelledby="myModalLabel120" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header bg-success">              
                <h5 class="modal-title white">Konfirmasi</h5>
                <button type="button" class="close btn btn-sm" data-dismiss="modal" aria-label="Close">
                    <i class="bx bx-x"></i>
                </button>
            </div>
            <div class="modal-body">
                <h5 align="center" style="margin:0;">Apakah Anda yakin akan <span class="text-success"> sudah cetak </span> data ini?</h5>
            </div>
            <div class="modal-footer">
                <button type="button" name="ok_cetak" id="ok_cetak" class="btn btn-sm btn-success">OK</button>
                <button type="button" class="btn btn-sm btn-light-secondary" data-dismiss="modal">Batal</button>
            </div>
        </div>
    </div>
</div>
@endsection

{{-- vendor scripts --}}
@section('vendor-scripts')
<script src="{{asset('vendors/js/forms/select/select2.full.min.js')}}"></script>
<script src="{{asset('vendors/js/forms/validation/jqBootstrapValidation.js')}}"></script>
<script src="{{asset('vendors/js/pickers/pickadate/picker.js')}}"></script>
<script src="{{asset('vendors/js/pickers/pickadate/picker.date.js')}}"></script>
@endsection

{{-- page scripts --}}
@section('page-scripts')
<script src="{{asset('js/scripts/pages/page-users.js')}}"></script>
<script src="{{asset('js/scripts/navs/navs.js')}}"></script>
<script src="{{asset('js/scripts/forms/validation/form-validation.js')}}"></script>
<script src="{{asset('js/scripts/pages/app-invoice.js')}}"></script>
<script>
    $(document).ready(function() {
    var user_id;

    $(document).on('click', '.acclurah', function(){
        user_id = $(this).attr('id');
        $('#modalAccLurah').modal('show');
    });

    $('#ok_aktif').click(function(){
        $.ajax({
        url:"../../skjd/acclurah/"+user_id,
        beforeSend:function(){
        $('#ok_aktif').text('Mengaktifkan data...');
        },
        success:function(data)
        {
            setTimeout(function(){
            $('#modalAccLurah').modal('hide');
            $('#ok_aktif').text('OK');
            Swal.fire('Berhasil','Data berhasil di ACC!', 'success');
            }, 1500);

            setTimeout(function(){
                window.location.href = "{{URL::to('skjd')}}"
            } , 3000);   
        }
        })
    });
    });
</script>
<script>
    $(document).ready(function() {
    var user_id;

    $(document).on('click', '.acccetak', function(){
        user_id = $(this).attr('id');
        $('#modalAccCetak').modal('show');
    });

    $('#ok_cetak').click(function(){
        $.ajax({
        url:"../../skjd/acccetak/"+user_id,
        beforeSend:function(){
        $('#ok_cetak').text('Mengaktifkan data...');
        },
        success:function(data)
        {
            setTimeout(function(){
            $('#modalAccCetak').modal('hide');
            $('#ok_cetak').text('OK');
            Swal.fire('Berhasil','Data berhasil diubah!', 'success');
            }, 1500);

            setTimeout(function(){
                window.location.href = "{{URL::to('skjd')}}"
            } , 3000);   
        }
        })
    });
    });
</script>
@endsection