@extends('layouts.app') @section('title', $clusters->display_name) @section('permohonan', 'm-menu__item--active') @section(App\Cluster::where('id', $clusters->id)->pluck('name')[0], 'm-menu__item--active') @section('css') @endsection @section('content')

{{ $clusters->display_name }}

Sila klik pada IPR yang anda ingin memohon dan untuk keterangan lanjut

@foreach ($iprs as $ipr)
{{ strtoupper($ipr->display_name) }}

{!! $ipr->description !!}

@if ($ipr->name == 'tunas') @php $list_anak = App\Anak::where('ic_pemohon', '=',Auth::user()->username)->get(); $total_anak=$list_anak->count(); @endphp @if ($total_anak > 1) DAFTAR @endif @if ($total_anak == 1) @foreach ($list_anak as $anak) @php $tunas=App\Tunas::where('anak_mykid','=',$anak->ic_anak)->first(); @endphp @if ($tunas) @if ($tunas->status=="dalam_proses") @php $client = new GuzzleHttp\Client(['http_errors' => false]); $url="http://54.179.245.113/api/tunas/status/".$anak->ic_anak."/".Auth::user()->username; #echo $url; $result = $client->request('GET', $url); $status = json_decode($result->getBody()->getContents()); #echo "
".print_r($status->response,true)."
"; @endphp @if ($status && count($status->response)==0) DITERIMA DAN SEDANG DIHANTAR KE YAWAS @else {{$status->response[0]->status_anak}} @endif @elseif ($tunas->status==NULL) BELUM DIHANTAR TERUSKAN @else DAFTAR @endif @else DAFTAR @endif @endforeach @endif @elseif ($ipr->status == 'Active' && $ipr->api == NULL && $ipr->url == NULL) @if(count(App\Permohonan::where('ic_pemohon', Auth::user()->username)->get()) > 0) @foreach (App\Permohonan::where('ic_pemohon', Auth::user()->username)->get() as $permohonan) @if($permohonan->ipr_id == $ipr->id && $ipr->name == 'sade') @if($permohonan->status == 0) DITERIMA DAN SEDANG DIPROSES @elseif($permohonan->status == 1) DITERIMA DAN SEDANG MENUNGGU SEMAKAN JMB/MC @elseif($permohonan->status == 2) LULUS @else GAGAL @endif @elseif($permohonan->ipr_id == $ipr->id && $ipr->name == 'kiss') {{-- To be continue --}} @elseif($permohonan->ipr_id == $ipr->id && $ipr->name == 'sbap') @if($permohonan->status == 0) DITERIMA DAN SEDANG DIPROSES @elseif($permohonan->status == 1) DITERIMA DAN SEDANG MENUNGGU SEMAKAN JMB/MC @elseif($permohonan->status == 2) LULUS @else GAGAL @endif @else DAFTAR @endif @endforeach @else DAFTAR @endif @elseif($ipr->status == 'Active' && $ipr->api != NULL && $ipr->url == NULL) @if($ipr->name == 'skw' || $ipr->name == 'smue' || $ipr->name == 'tawas' || $ipr->name == 'ipb') @php if(Auth::user()->hasRole('super_admin') && Auth::user()->username == '920205045387') { // data testing switch ($ipr->name) { case 'skw': $ic = \Crypt::encrypt('711119075028'); break; case 'smue': $ic = \Crypt::encrypt('181023105004'); break; case 'tawas': $ic = \Crypt::encrypt('760730105421'); break; case 'ipb': $ic = \Crypt::encrypt('880519565250'); break; } } else { $ic = \Crypt::encrypt(Auth::user()->username); } $client = new GuzzleHttp\Client(['http_errors' => false]); $result = $client->get($ipr->api.'/status/'.$ic); $status = json_decode($result->getBody()->getContents()); @endphp @if($status && $status->pemohon) @else TIADA REKOD @endif @endif @elseif($ipr->status == 'Active' && $ipr->api != NULL && $ipr->url != NULL) @if($ipr->name == 'rsku') @php if(Auth::user()->hasRole('super_admin') && Auth::user()->username == '920205045387') { // data testing switch ($ipr->name) { case 'rsku': $ic = substr_replace(substr_replace('761008105824', '-', 6, 0), '-', 9, 0); break; } } else { $ic = substr_replace(substr_replace(Auth::user()->username, '-', 6, 0), '-', 9, 0); } $client = new GuzzleHttp\Client(['http_errors' => false]); $result = $client->get($ipr->api.$ic); $status = json_decode($result->getBody()->getContents()); @endphp @if($status) @if($status[0]->permohonan_status == 'Tidak Layak') @elseif($status[0]->permohonan_status == 'Layak') @else DALAM PROSES @endif @else DAFTAR @endif @elseif($ipr->name == 'sps') @php if(Auth::user()->hasRole('super_admin') && Auth::user()->username == '920205045387') { // data testing switch ($ipr->name) { case 'sps': $ic = '501225105029'; break; } } else { $ic = Auth::user()->username; } $client = new GuzzleHttp\Client(['http_errors' => false, 'verify' => 'cacert.pem']); $result = $client->get($ipr->api.$ic); $status = json_decode($result->getBody()->getContents()); @endphp @if($status) @if($status->code == 404) DAFTAR @elseif($status->code == 422) DALAM PROSES @elseif($status->code == 200) AKTIF @else TIDAK AKTIF @endif @else DAFTAR @endif @elseif($ipr->name == 'bss') @php if(Auth::user()->hasRole('super_admin') && Auth::user()->username == '920205045387') { // data testing switch ($ipr->name) { case 'bss': $ic = '760229105065'; break; } } else { $ic = Auth::user()->username; } $client = new GuzzleHttp\Client(['http_errors' => false]); $result = $client->post($ipr->api, [ 'form_params' => [ 'ic' => $ic, 'year' => date('Y'), ] ]); $status = json_decode($result->getBody()->getContents()); @endphp @if($status && $status->STATUS == 'NEW') @elseif($status && $status->STATUS == '') DAFTAR @else DAFTAR @endif @endif @else PENDAFTARAN DITUTUP @endif
{{-- ----------------------------------------- --}} {{-- Modal IPR --}} {{-- ----------------------------------------- --}} @if($ipr->name == 'skw' && $status->pemohon) {{-- Modal SKW --}} {{-- End Modal --}} @endif @if($ipr->name == 'smue' && $status->pemohon) {{-- Modal SMUE --}} {{-- End Modal --}} @endif @if($ipr->name == 'tawas' && $status->pemohon) {{-- Modal TAWAS --}} {{-- End Modal --}} @endif @if($ipr->name == 'ipb' && $status->pemohon) {{-- Modal IPB --}} {{-- End Modal --}} @endif @if($ipr->name == 'rsku' && $status) {{-- Modal RSKU --}} {{-- End Modal --}} @endif @if($ipr->name == 'bss' && $status->STATUS) {{-- Modal BSS --}} {{-- End Modal --}} @endif @endforeach
@endsection @section('js') @endsection