mutu-rsab/resources/views/layouts/template_admin.blade.php
2025-12-01 13:22:55 +07:00

242 lines
9.9 KiB
PHP

<!DOCTYPE html>
<html lang="en" class="layout-navbar-fixed layout-menu-fixed " dir="ltr" data-skin="default" data-bs-theme="light"
data-assets-path="{{ asset('vuexy/assets/') }}" data-template="vertical-menu-template-starter">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@yield('title', 'Mutu RSAB Harapan Kita')</title>
<!-- Favicon -->
<link rel="icon" type="image/png" href="{{ asset('vuexy/assets/img/favicon/favicon.png') }}" />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet">
<!-- Icons. Uncomment required icon fonts -->
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/fonts/iconify-icons.css') }}" />
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/fonts/fontawesome.css') }}" />
<!-- Core CSS -->
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/css/core.css') }}" class="template-customizer-core-css" />
<link rel="stylesheet" href="{{ asset('vuexy/assets/css/demo.css') }}" />
<!-- Vendors CSS -->
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/libs/node-waves/node-waves.css') }}" />
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') }}" />
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.css') }}" />
<link rel="stylesheet"
href="{{ asset('vuexy/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.css') }}" />
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/libs/sweetalert2/sweetalert2.css') }}" />
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/libs/select2/select2.css') }} " />
<link rel="stylesheet" href="{{ asset('vuexy/assets/vendor/libs/spinkit/spinkit.css') }}" />
<!-- Helpers -->
<script src="{{ asset('vuexy/assets/vendor/js/helpers.js') }}"></script>
<!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
<!--? Template customizer: To hide customizer set displayCustomizer value false in config.js. -->
<!--? Config: Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file. -->
<script src="{{ asset('vuexy/assets/js/config.js') }}"></script>
<style>
.list-materi-hover:hover,
.list-materi-selected {
background-color: #e9ecef;
/* abu abu */
border-radius: .375rem;
cursor: pointer;
}
.sidebar-scroll {
max-height: 100vh;
/* penuh 1 layar */
overflow-y: auto;
/* aktifin scroll vertical */
}
</style>
@yield('custom_css')
</head>
<body>
<nav class="navbar navbar-expand-lg bg-primary fw-bold">
<div class="container-fluid">
<a class="navbar-brand" href="{{ url('/') }}">
<img src="{{ asset('assets/img/logo-fullname-negatif.png') }}" alt="Logo" height="40"
class="d-inline-block align-text-top">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon" style="filter: invert(1);"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="navbar-nav me-auto">
</div>
<div class="dropdown-center">
<button type="button" class="btn btn-primary d-flex gap-3" data-bs-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
<span id="name_account"></span>
<i class="fa fa-user"></i>
</button>
<ul class="dropdown-menu">
<li id="btn_logout">
<div class="dropdown-item">Logout</div>
</li>
</ul>
</div>
</div>
</div>
</nav>
<nav class="navbar d-md-none">
<button class="btn btn-primary" type="button" data-bs-toggle="offcanvas" data-bs-target="#mobileSidebar">
<i class="fa fa-list fs-4"></i>
</button>
</nav>
<div class="row pe-5">
<!-- Sidebar desktop -->
<aside class="col-md-4 col-lg-3 d-none d-md-block sidebar vh-100">
<div class="card rounded-0 h-100">
<div class="card-body px-0">
<div class="text-center mb-5">
<img src="{{ asset('assets/img/logo-fullname.png') }}" alt="Logo" class="w-50">
</div>
<nav class="nav flex-column sidebar-scroll list-materi bg-white px-5 gap-2">
<a href="{{ url('/admin') }}" class="nav-link px-0 list-materi-hover px-3 d-flex justify-content-between align-items-center fs-5">
<div class="d-flex gap-2 align-items-center">
<i class="fa-solid fa-gauge-high"></i> Dashboard
</div>
<i class="fa-solid fa-chevron-right"></i>
</a>
<a href="{{ url('/admin/dashboard_jawaban') }}" class="nav-link px-0 list-materi-hover px-3 d-flex justify-content-between align-items-center fs-5">
<div class="d-flex gap-2 align-items-center">
<i class="fa-solid fa-gauge-high"></i> Dashboard Analisis
</div>
<i class="fa-solid fa-chevron-right"></i>
</a>
</nav>
</div>
</div>
</aside>
<!-- Sidebar mobile (offcanvas) -->
<div class="offcanvas offcanvas-start d-md-none" tabindex="-1" id="mobileSidebar">
<div class="offcanvas-header">
<div class="text-center mb-5">
<img src="{{ asset('assets/img/logo-fullname.png') }}" alt="Logo" class="w-75">
</div>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas"></button>
</div>
<div class="offcanvas-body p-0">
<div class="sidebar">
<div class="px-3">
<nav class="nav flex-column list-materi">
<a href="{{ url('/admin') }}" class="nav-link px-0 list-materi-hover px-3 d-flex justify-content-between align-items-center fs-5">
<div class="d-flex gap-2 align-items-center">
<i class="fa-solid fa-gauge-high"></i> Dashboard
</div>
<i class="fa-solid fa-chevron-right"></i>
</a>
<a href="{{ url('/admin/dashboard_jawaban') }}" class="nav-link px-0 list-materi-hover px-3 d-flex justify-content-between align-items-center fs-5">
<div class="d-flex gap-2 align-items-center">
<i class="fa-solid fa-gauge-high"></i> Dashboard
</div>
<i class="fa-solid fa-chevron-right"></i>
</a>
</nav>
</div>
</div>
</div>
</div>
<!-- Konten utama -->
<main class="col-md-8 col-lg-9 content">
@yield('content')
</main>
</div>
<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="{{ asset('vuexy/assets/vendor/libs/jquery/jquery.js') }}"></script>
<script src="{{ asset('vuexy/assets/vendor/libs/popper/popper.js') }}"></script>
<script src="{{ asset('vuexy/assets/vendor/js/bootstrap.js') }}"></script>
<script src="{{ asset('vuexy/assets/vendor/libs/node-waves/node-waves.js') }}"></script>
<script src="{{ asset('vuexy/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') }}"></script>
<script src="{{ asset('vuexy/assets/vendor/libs/hammer/hammer.js') }}"></script>
<script src="{{ asset('vuexy/assets/vendor/js/menu.js') }}"></script>
<!-- endbuild -->
<!-- Main JS -->
<script src="{{ asset('vuexy/assets/js/main.js') }}"></script>
<script src="{{ asset('vuexy/assets/vendor/libs/sweetalert2/sweetalert2.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="{{ asset('vuexy/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js') }}"></script>
<script src="{{ asset('vuexy/assets/vendor/libs/select2/select2.js') }}"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script>
const token = $.cookie('token');
const headers = {
Authorization: `bearer ${token}`,
"x-klien": 1
};
$(document).ready(function(){
setNameAccount();
$('#btn_logout').click(function(){
Swal.fire({
title: 'Apakah anda yakin?',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Iya',
customClass: {
confirmButton: 'btn btn-primary me-1',
cancelButton: 'btn btn-label-secondary'
},
buttonsStyling: false
}).then(function(result) {
if (result.value) {
$.removeCookie('token');
window.location.href = "/logout";
}
});
})
})
function parseJwt () {
const token = $.cookie('token');
try {
const base64Url = token.split('.')[1]; // ambil payload
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
const jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
return JSON.parse(jsonPayload);
} catch(e) {
console.error("Invalid JWT:", e);
return null;
}
}
function setNameAccount() {
const decode = parseJwt();
if(decode){
$('#name_account').html(decode.nama_pegawai);
}
}
</script>
@yield('custom_js')
</body>
</html>