navbar.blade.php 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <ul class="breadcrumbs">
  2. <?php $segments = ''; ?>
  3. @foreach(Request::segments() as $segment)
  4. <?php $segments .= '/'.$segment; ?>
  5. <li style="text-transform: uppercase;">
  6. <a class="text-info" href="#">{{ substr($segment,0, 30) }}</a>
  7. </li>
  8. @endforeach
  9. </ul>
  10. <?php
  11. $tahunProgramAktif = \App\Model\TahunProgram::where('status',1)->first();
  12. if(!empty($tahunProgramAktif)){
  13. $user = Auth::user();
  14. $read = \App\Model\MetadataProgramNotificationRead::where('id_user',$user->id)->pluck('id_metadata_program_notification');
  15. $getStatus = \App\Model\Privillage\Role::where('id',Auth::user()->role_id)->value('akses');
  16. if($getStatus == 'administrator'){
  17. $metadataProgramNotification = \App\Model\MetadataProgramNotification::where('id_tahun_program',$tahunProgramAktif->id)
  18. ->where('readable_admin',1)
  19. ->whereNotIn('id',$read)
  20. ->get();
  21. }else{
  22. $metadataProgramNotification = \App\Model\MetadataProgramNotification::where('id_tahun_program',$tahunProgramAktif->id)
  23. ->where('readable',1)
  24. ->where('id_upt',$user->upt)
  25. ->whereNotIn('id',$read)
  26. ->get();
  27. }
  28. }
  29. ?>
  30. <!-- User -->
  31. <ul class="navbar-nav align-items-center d-none d-md-flex user-inf">
  32. @if(!empty($tahunProgramAktif))
  33. <li class="nav-item dropdown" style="border-bottom: 0 none;">
  34. <a href="#" class="mailBx" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  35. <div class="notifed" id="notificationCount">{{$metadataProgramNotification->count()}}</div>
  36. <i class="ni ni-bell-55 text-info"></i>
  37. </a>
  38. <div class="dropdown-menu dropdown-menu-arrow dropdown-menu-right" style="top: 20px; height: 330px; overflow-y: scroll;">
  39. @foreach($tahunProgramAktif->tahunProgramDetail as $detail)
  40. <button class="dropdown-item btn btn-block btnNotification" id="btnNotification" title="{{!empty($detail->templateProgramDetail)?$detail->templateProgramDetail->nama:'-'}}" data-toggle="modal"
  41. data-target="#notificationModal"
  42. data-id-tahun-program-detail="{{$detail->id}}"
  43. style="position: relative;">
  44. @if(!empty($detail->templateProgramDetail))
  45. {{(strlen($detail->templateProgramDetail->nama)<=40)?$detail->templateProgramDetail->nama:substr($detail->templateProgramDetail->nama,0,40).' ...'}}
  46. @else
  47. -
  48. @endif
  49. <div id="notificationDetailCount{{$detail->id}}" class="notifed" style="right: 5px; top: 10px;">{{$metadataProgramNotification->where('id_tahun_program',$tahunProgramAktif->id)->where('id_template_program_detail',$detail->id_template_program_detail)->count()}}</div></button>
  50. @endforeach
  51. </div>
  52. </li>
  53. @endif
  54. <li class="nav-item dropdown" style="border-bottom: 0 none;">
  55. <a class="nav-link pr-0" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  56. <div class="media align-items-center">
  57. <span class="avatar avatar-sm rounded-circle">
  58. <img alt="Image placeholder" src="{{url('images/user/'.Auth::user()->profile_photo)}}">
  59. </span>
  60. <div class="media-body ml-2 d-none d-lg-block">
  61. <span class="mb-0 text-sm font-weight-bold text-adm">{{Auth::user()->name}}</span>
  62. </div>
  63. </div>
  64. </a>
  65. <div class="dropdown-menu dropdown-menu-arrow dropdown-menu-right">
  66. <div class=" dropdown-header noti-title">
  67. <?php $getInformation = \App\Model\Setting\UPT::where('office_id',Auth::user()->upt)->distinct()->value('office_name'); ?>
  68. <h6 class="text-overflow m-0">
  69. @if($getInformation)
  70. {{$getInformation}}
  71. @else
  72. Administrator
  73. @endif
  74. </h6>
  75. </div>
  76. <div class="dropdown-divider"></div>
  77. <a href="{{ route('ubahPassword') }}" class="dropdown-item">
  78. <i class="fas fa-key"></i>
  79. <span>Ubah Kata Sandi</span>
  80. </a>
  81. <a href="{{ url('logout') }}"
  82. onclick="event.preventDefault();
  83. document.getElementById('logout-form').submit();" class="dropdown-item">
  84. <i class="ni ni-button-power"></i>
  85. <span>Keluar</span>
  86. </a>
  87. <form id="logout-form" action="{{ url('logout') }}" method="POST" style="display: none;">
  88. @csrf
  89. </form>
  90. </div>
  91. </li>
  92. </ul>