Update besar apk finance
This commit is contained in:
@@ -1,261 +1,67 @@
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<?php
|
||||
$CI=&get_instance();
|
||||
$routeClass=strtolower((string)$CI->router->fetch_class());
|
||||
$routeMethod=strtolower((string)$CI->router->fetch_method());
|
||||
if(!isset($active_menu)||$active_menu===''){
|
||||
$routeMenus=array(
|
||||
'attendancmonthly'=>'attendance_monthly',
|
||||
'attendancemonthly'=>'attendance_monthly',
|
||||
'attendancemonitoring'=>'attendance_monitoring',
|
||||
'generateschedule'=>'generate_schedule',
|
||||
'accountingperiods'=>'accounting_periods',
|
||||
'inventoryprofessional'=>$routeMethod==='operations'?'inventory_operations':($routeMethod==='locations'?'inventory_locations':($routeMethod==='reports'?'inventory_reports':'inventory_overview')),
|
||||
'professionalreports'=>'professional_reports',
|
||||
'hrpayroll'=>'hr_payroll',
|
||||
'fixedassets'=>'fixed_assets',
|
||||
'kodebarang'=>'kode_barang',
|
||||
'lokasiasset'=>'lokasiasset',
|
||||
'teknisi'=>'peralatan_teknisi'
|
||||
);
|
||||
$active_menu=isset($routeMenus[$routeClass])?$routeMenus[$routeClass]:$routeClass;
|
||||
if($routeClass==='invoices')$active_menu='sales_invoice';
|
||||
if($routeClass==='items'&&$routeMethod==='draft_items')$active_menu='draft_items';
|
||||
if($routeClass==='items'&&$routeMethod==='item_barcodes_history')$active_menu='item_historys';
|
||||
}
|
||||
$CI->config->load('ui_assets',true);
|
||||
$uiAssets=$CI->config->item('ui_assets');
|
||||
$dataPages=isset($uiAssets['ui_data_pages'])?$uiAssets['ui_data_pages']:array();
|
||||
$selectPages=isset($uiAssets['ui_select_pages'])?$uiAssets['ui_select_pages']:array();
|
||||
?></main></section></div>
|
||||
<nav class="mobile-action-bar d-lg-none" aria-label="Aksi utama"><a href="<?=base_url()?>"><i class="bi bi-house"></i><span>Home</span></a><button data-bs-toggle="modal" data-bs-target="#quickActions"><i class="bi bi-lightning"></i><span>Aksi</span></button><a href="<?=base_url('inventoryprofessional')?>"><i class="bi bi-qr-code-scan"></i><span>Scan</span></a><button data-bs-toggle="offcanvas" data-bs-target="#mobileMenu"><i class="bi bi-grid"></i><span>Menu</span></button></nav>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" onerror="this.onerror=null;this.src='<?=base_url('assets/vendor/bootstrap.bundle.min.js')?>'"></script>
|
||||
<?php if(in_array($active_menu,array('inventory_professional','inventory_overview','item_historys','camera_qr','fixed_assets'),true)):?><script src="https://unpkg.com/html5-qrcode"></script><?php endif?>
|
||||
<script>window.APP_BASE_URL=<?=json_encode(base_url())?>;window.APP_CSRF={name:<?=json_encode($this->security->get_csrf_token_name())?>,value:<?=json_encode($this->security->get_csrf_hash())?>};</script><script src="<?=base_url('assets/js/app-ui.min.js').'?v='.filemtime(FCPATH.'assets/js/app-ui.min.js')?>" defer></script><script src="<?=base_url('assets/js/app-network.js').'?v='.filemtime(FCPATH.'assets/js/app-network.js')?>" defer></script>
|
||||
<script>
|
||||
|
||||
// =====================================================
|
||||
// 🔥 FORMAT NUMBER
|
||||
// contoh:
|
||||
// 1000 => 1,000
|
||||
// 1000.5 => 1,000.5
|
||||
// 1000.55 => 1,000.55
|
||||
// =====================================================
|
||||
|
||||
function formatNumber(value){
|
||||
|
||||
if(value === null || value === undefined){
|
||||
return '';
|
||||
}
|
||||
|
||||
value = value.toString();
|
||||
|
||||
// hanya angka dan titik
|
||||
value = value.replace(/[^0-9.]/g, '');
|
||||
|
||||
// hanya boleh 1 titik
|
||||
let parts = value.split('.');
|
||||
|
||||
let integerPart = parts[0] || '';
|
||||
let decimalPart = parts[1] || '';
|
||||
|
||||
// format ribuan pakai koma
|
||||
integerPart = integerPart.replace(/,/g, '');
|
||||
integerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
|
||||
// max 2 digit decimal
|
||||
decimalPart = decimalPart.substring(0,2);
|
||||
|
||||
// kalau ada desimal
|
||||
if(parts.length > 1 || value.endsWith('.')){
|
||||
return integerPart + '.' + decimalPart;
|
||||
}
|
||||
|
||||
return integerPart;
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// 🔥 CLEAN NUMBER
|
||||
// hasil:
|
||||
// 1,000.25 => 1000.25
|
||||
// =====================================================
|
||||
|
||||
function cleanNumber(value){
|
||||
|
||||
if(!value) return '';
|
||||
|
||||
return value.toString().replace(/,/g, '');
|
||||
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// 🔥 AUTO FORMAT INPUT
|
||||
// =====================================================
|
||||
|
||||
$(document).on('input', '.format-rupiah', function(){
|
||||
|
||||
let cursorPos = this.selectionStart;
|
||||
|
||||
let beforeLength = $(this).val().length;
|
||||
|
||||
let formatted = formatNumber($(this).val());
|
||||
|
||||
$(this).val(formatted);
|
||||
|
||||
let afterLength = formatted.length;
|
||||
|
||||
cursorPos = cursorPos + (afterLength - beforeLength);
|
||||
|
||||
this.setSelectionRange(cursorPos, cursorPos);
|
||||
|
||||
});
|
||||
|
||||
// =====================================================
|
||||
// 🔥 FORMAT SAAT BLUR
|
||||
// =====================================================
|
||||
|
||||
$(document).on('blur', '.format-rupiah', function(){
|
||||
|
||||
$(this).val(
|
||||
formatNumber($(this).val())
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
// =====================================================
|
||||
// 🔥 AUTO CLEAN SAAT SUBMIT
|
||||
// =====================================================
|
||||
|
||||
$(document).on('submit', 'form', function(){
|
||||
|
||||
$(this).find('.format-rupiah').each(function(){
|
||||
|
||||
$(this).val(
|
||||
cleanNumber($(this).val())
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// =====================================================
|
||||
// 🔥 AUTO FORMAT VALUE AWAL
|
||||
// =====================================================
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$('.format-rupiah').each(function(){
|
||||
|
||||
let val = $(this).val();
|
||||
|
||||
if(val !== ''){
|
||||
|
||||
$(this).val(
|
||||
formatNumber(val)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// =====================================================
|
||||
// 🔥 OVERRIDE jQuery .val()
|
||||
// =====================================================
|
||||
|
||||
(function($){
|
||||
|
||||
const originalVal = $.fn.val;
|
||||
|
||||
$.fn.val = function(value){
|
||||
|
||||
// setter
|
||||
if(typeof value !== 'undefined'){
|
||||
|
||||
if(this.hasClass('format-rupiah')){
|
||||
|
||||
return originalVal.call(
|
||||
this,
|
||||
formatNumber(value)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
return originalVal.apply(this, arguments);
|
||||
}
|
||||
|
||||
// getter
|
||||
if(this.hasClass('format-rupiah')){
|
||||
|
||||
return cleanNumber(
|
||||
originalVal.call(this)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
return originalVal.call(this);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
(function(){
|
||||
if(!window.Swal)return;
|
||||
var nativeFire=Swal.fire.bind(Swal);
|
||||
window.AppAlert={
|
||||
toast:function(message,icon){return nativeFire({toast:true,position:'top-end',showConfirmButton:false,timer:3200,timerProgressBar:true,icon:icon||'success',title:message});},
|
||||
confirm:function(options){return nativeFire(Object.assign({icon:'warning',position:'center',showCancelButton:true,confirmButtonText:'Ya, lanjutkan',cancelButtonText:'Batal',reverseButtons:true,focusCancel:true},options||{}));},
|
||||
prompt:function(options){return nativeFire(Object.assign({position:'center',showCancelButton:true,confirmButtonText:'Simpan',cancelButtonText:'Batal'},options||{}));}
|
||||
};
|
||||
// Menyeragamkan pemanggilan Swal lama: pesan biasa menjadi toast kanan atas,
|
||||
// sedangkan konfirmasi dan form input tetap berupa dialog di tengah.
|
||||
Swal.fire=function(first,text,icon){
|
||||
var options=typeof first==='object'?Object.assign({},first):{title:first,text:text,icon:icon};
|
||||
var requiresInteraction=!!(options.showCancelButton||options.showDenyButton||options.input||options.preConfirm||options.inputValidator);
|
||||
if(requiresInteraction){options.position='center';return nativeFire(options);}
|
||||
return nativeFire(Object.assign(options,{toast:true,position:'top-end',showConfirmButton:false,timer:options.timer||3200,timerProgressBar:options.timerProgressBar!==false}));
|
||||
};
|
||||
document.querySelectorAll('.modal-dialog').forEach(function(dialog){dialog.classList.add('modal-dialog-centered');});
|
||||
document.querySelectorAll('[data-app-toast]').forEach(function(el){AppAlert.toast(el.dataset.message||'',el.dataset.icon||'success');});
|
||||
var focusId=new URLSearchParams(location.search).get('focus');
|
||||
if(focusId){
|
||||
var focusDocument=function(){var escaped=window.CSS&&CSS.escape?CSS.escape(focusId):focusId.replace(/[^0-9]/g,'');var candidates=document.querySelectorAll('[data-id="'+escaped+'"],a[href$="/'+escaped+'"],form[action$="/'+escaped+'"]');for(var i=0;i<candidates.length;i++){var row=candidates[i].closest('tr,.card');if(row&&row.offsetParent!==null&&!row.classList.contains('approval-focus')){row.classList.add('approval-focus');row.scrollIntoView({behavior:'smooth',block:'center'});return true;}}return false;};
|
||||
if(!focusDocument()){var observer=new MutationObserver(function(){if(focusDocument())observer.disconnect();});observer.observe(document.body,{childList:true,subtree:true});setTimeout(function(){observer.disconnect();},8000);}
|
||||
}
|
||||
document.addEventListener('submit',function(event){
|
||||
var form=event.target.closest('form.js-confirm');if(!form||form.dataset.confirmed==='1')return;
|
||||
event.preventDefault();
|
||||
AppAlert.confirm({title:form.dataset.confirmTitle||'Konfirmasi tindakan',text:form.dataset.confirmText||'Apakah Anda yakin?',confirmButtonText:form.dataset.confirmButton||'Ya, lanjutkan'}).then(function(result){if(result.isConfirmed){form.dataset.confirmed='1';form.requestSubmit();}});
|
||||
},true);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function formatRupiah(num){
|
||||
return 'Rp ' + new Intl.NumberFormat('id-ID').format(num || 0);
|
||||
}
|
||||
|
||||
function formatTglIndo(dateString){
|
||||
|
||||
if(!dateString) return '-';
|
||||
|
||||
let date = new Date(dateString);
|
||||
|
||||
const bulan = [
|
||||
"Januari","Februari","Maret","April","Mei","Juni",
|
||||
"Juli","Agustus","September","Oktober","November","Desember"
|
||||
];
|
||||
|
||||
let tgl = date.getDate();
|
||||
let bln = bulan[date.getMonth()];
|
||||
let thn = date.getFullYear();
|
||||
|
||||
return `${tgl} ${bln} ${thn}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$(function(){
|
||||
|
||||
function initSelectSearch(scope = document){
|
||||
|
||||
if (typeof $.fn.select2 === 'undefined') {
|
||||
console.error('Select2 belum ke-load!');
|
||||
return;
|
||||
}
|
||||
|
||||
$(scope).find('select.select-search').each(function(){
|
||||
|
||||
let $this = $(this);
|
||||
|
||||
if ($this.hasClass("select2-hidden-accessible")) return;
|
||||
|
||||
let parent = $this.closest('.modal');
|
||||
parent = parent.length ? parent : $(document.body);
|
||||
|
||||
$this.select2({
|
||||
width: '100%',
|
||||
placeholder: $this.attr('placeholder') || '-- Pilih --',
|
||||
allowClear: true,
|
||||
dropdownParent: parent
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// ✅ INIT AWAL
|
||||
initSelectSearch();
|
||||
|
||||
// $(window).on('load', function(){
|
||||
// setTimeout(() => {
|
||||
// initSelectSearch();
|
||||
// }, 100);
|
||||
// });
|
||||
|
||||
// ✅ AUTO INIT untuk dynamic content (modal, ajax, dll)
|
||||
const observer = new MutationObserver(function(mutations){
|
||||
|
||||
mutations.forEach(function(mutation){
|
||||
|
||||
mutation.addedNodes.forEach(function(node){
|
||||
|
||||
if (node.nodeType === 1){ // element
|
||||
initSelectSearch(node);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<?php if(in_array($active_menu,$selectPages,true)):?><script>$(function(){$('select.select-search').each(function(){if(!$(this).hasClass('select2-hidden-accessible'))$(this).select2({width:'100%',dropdownParent:$(this).closest('.modal').length?$(this).closest('.modal'):$(document.body)});});});</script><?php endif?>
|
||||
</body></html>
|
||||
|
||||
@@ -1,415 +1,44 @@
|
||||
<?php $role = $this->session->userdata('role'); ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Accounting</title>
|
||||
<link rel="icon" href="<?= base_url('assets/img/accounting-color.png') ?>" type="image/png">
|
||||
|
||||
<!-- Bootstrap 5 -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Bootstrap Icons -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
|
||||
|
||||
<!-- Google Font -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link href="<?= base_url('assets/css/style-custom.css'); ?>" rel="stylesheet">
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap5.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.4.1/css/responsive.bootstrap5.min.css">
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/responsive/2.4.1/js/dataTables.responsive.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://unpkg.com/html5-qrcode" type="text/javascript"></script>
|
||||
|
||||
|
||||
<!-- Daterange Picker -->
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
|
||||
|
||||
<!-- Select2 STABLE -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css" rel="stylesheet" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>
|
||||
|
||||
<!-- Camera Scanner -->
|
||||
<script src="https://unpkg.com/html5-qrcode"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- ───────────────────────── NAVBAR ───────────────────────── -->
|
||||
<nav class="navbar navbar-expand-lg fixed-top">
|
||||
<div class="container">
|
||||
|
||||
<!-- Mobile menu button -->
|
||||
<button class="btn text-white d-lg-none me-2" data-bs-toggle="offcanvas" data-bs-target="#mobileMenu">
|
||||
<i class="bi bi-list fs-3"></i>
|
||||
</button>
|
||||
|
||||
<img src="<?= base_url('assets/img/accounting-white.png'); ?>" width="50px">
|
||||
|
||||
<div class="collapse navbar-collapse d-none d-lg-flex">
|
||||
<ul class="navbar-nav ms-4">
|
||||
|
||||
<!-- DASHBOARD -->
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?= ($active_menu == 'dashboard') ? 'active' : ''?>" href="<?= base_url(); ?>">
|
||||
<i class="bi bi-speedometer2"></i> Dashboard
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?= ($active_menu == 'jurnal') ? 'active' : ''?>" href="<?= base_url('jurnal'); ?>">
|
||||
<i class="bi bi-journal-plus"></i> Jurnal Umum
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if($role == 'Admin'): ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?= ($active_menu == 'buku_besar') ? 'active' : ''?>" href="<?= base_url('bukubesar'); ?>">
|
||||
<i class="bi bi-book"></i> Buku Besar
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle <?= in_array($active_menu, ['laba_rugi','neraca','neraca_saldo']) ? 'active' : '' ?>" href="#" data-bs-toggle="dropdown">
|
||||
<i class="bi bi-graph-up"></i> Laporan
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item <?= ($active_menu == 'laba_rugi') ? 'active' : '' ?>" href="<?= base_url('labarugi'); ?>">
|
||||
<i class="bi bi-graph-up-arrow me-2"></i> Laba Rugi</a>
|
||||
</li>
|
||||
<li><a class="dropdown-item <?= ($active_menu == 'neraca') ? 'active' : '' ?>" href="<?= base_url('neraca'); ?>">
|
||||
<i class="bi bi-bar-chart-line me-2"></i> Neraca</a>
|
||||
</li>
|
||||
<li><a class="dropdown-item <?= ($active_menu == 'neraca_saldo') ? 'active' : '' ?>" href="<?= base_url('neracasaldo'); ?>">
|
||||
<i class="bi bi-clipboard-data me-2"></i> Laporan Harian</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle <?= in_array($active_menu, ['accounts','basejurnal']) ? 'active' : '' ?>" href="#" data-bs-toggle="dropdown">
|
||||
<i class="bi bi-list-nested"></i> Daftar Akun
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
<?php if($role == 'Admin'): ?>
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'accounts') ? 'active' : '' ?>"
|
||||
href="<?= base_url('accounts'); ?>">
|
||||
<i class="bi bi-list-nested"></i> Base Akun
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'basejurnal') ? 'active' : '' ?>"
|
||||
href="<?= base_url('basejurnal'); ?>">
|
||||
<i class="bi bi-arrow-left-right"></i> Base Jurnal
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!--<li class="nav-item">-->
|
||||
<!-- <a class="nav-link <?= ($active_menu == 'asset') ? 'active' : ''?>" href="<?= base_url('asset'); ?>">-->
|
||||
<!-- <i class="bi bi-book"></i> Asset-->
|
||||
<!-- </a>-->
|
||||
<!--</li>-->
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle <?= in_array($active_menu, ['asset','lokasiasset']) ? 'active' : '' ?>"
|
||||
href="#" data-bs-toggle="dropdown">
|
||||
<i class="bi bi-archive"></i> Asset
|
||||
</a>
|
||||
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
<!-- Daftar Asset -->
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'asset') ? 'active' : '' ?>"
|
||||
href="<?= base_url('asset'); ?>">
|
||||
<i class="bi bi-archive me-2"></i> Daftar Asset
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
|
||||
<!-- Lokasi Asset -->
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'lokasiasset') ? 'active' : '' ?>"
|
||||
href="<?= base_url('lokasiasset'); ?>">
|
||||
<i class="bi bi-geo-alt me-2"></i> Lokasi Asset
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle <?= in_array($active_menu, ['warehouses','items', 'kode_barang', 'draft_items', 'peralatan_teknisi']) ? 'active' : '' ?>" href="#" data-bs-toggle="dropdown">
|
||||
<i class="bi bi-box-seam"></i> Gudang
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'warehouses') ? 'active' : '' ?>"
|
||||
href="<?= base_url('warehouses'); ?>">
|
||||
<i class="bi bi-building me-2"></i> Daftar Gudang
|
||||
</a>
|
||||
</li><hr class="dropdown-divider">
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'draft_items') ? 'active' : '' ?>"
|
||||
href="<?= base_url('items/draft_items'); ?>">
|
||||
<i class="bi bi-truck me-2"></i> Daftar Pending
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'items') ? 'active' : '' ?>"
|
||||
href="<?= base_url('items'); ?>">
|
||||
<i class="bi bi-box me-2"></i> Daftar Barang
|
||||
</a>
|
||||
</li><hr class="dropdown-divider">
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'item_historys') ? 'active' : '' ?>"
|
||||
href="<?= base_url('items/item_barcodes_history'); ?>">
|
||||
<i class="bi bi-clock me-2"></i> History Barang
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'kode_barang') ? 'active' : '' ?>"
|
||||
href="<?= base_url('kodebarang'); ?>">
|
||||
<i class="bi bi-code me-2"></i> Daftar Kode Barang
|
||||
</a>
|
||||
</li><hr class="dropdown-divider">
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'peralatan_teknisi') ? 'active' : '' ?>"
|
||||
href="<?= base_url('teknisi'); ?>">
|
||||
<i class="bi bi-tools me-2"></i> Peralatan Teknisi
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle <?= in_array($active_menu, ['customers','invoice_unpaid','invoice_paid','payments','invoice_draft']) ? 'active' : '' ?>" href="#" data-bs-toggle="dropdown">
|
||||
<i class="bi bi-receipt"></i> Invoice
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- Customers -->
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'customers') ? 'active' : '' ?>" href="<?= base_url('customers'); ?>">
|
||||
<i class="bi bi-people me-2"></i> Customers
|
||||
</a>
|
||||
</li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<!-- Draft -->
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'invoice_draft') ? 'active' : '' ?>" href="<?= base_url('invoices/draft'); ?>">
|
||||
<i class="bi bi-pencil-square me-2"></i> Draft Invoice
|
||||
</a>
|
||||
</li>
|
||||
<!-- Riwayat Invoice -->
|
||||
<li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'invoice_paid') ? 'active' : '' ?>" href="<?= base_url('invoices/paid'); ?>">
|
||||
<i class="bi bi-check-circle me-2"></i> Riwayat Invoice
|
||||
</a>
|
||||
</li>
|
||||
<!-- Pembayaran -->
|
||||
<!-- <li>
|
||||
<a class="dropdown-item <?= ($active_menu == 'payments') ? 'active' : '' ?>" href="<?= base_url('payments'); ?>">
|
||||
<i class="bi bi-cash-stack me-2"></i> Pembayaran
|
||||
</a>
|
||||
</li> -->
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
|
||||
<a class="nav-link dropdown-toggle <?= in_array($active_menu, ['employees','shift','holidays','attendance_monitoring','leave_requests','generate_schedule']) ? 'active' : '' ?>"
|
||||
href="#"
|
||||
data-bs-toggle="dropdown">
|
||||
|
||||
<i class="bi bi-people-fill me-1"></i>
|
||||
Kepegawaian
|
||||
|
||||
</a>
|
||||
|
||||
<ul class="dropdown-menu shadow border-0 rounded-4 p-2">
|
||||
|
||||
<li>
|
||||
|
||||
<a class="dropdown-item rounded-3 <?= ($active_menu == 'employees') ? 'active' : '' ?>"
|
||||
href="<?= base_url('employees'); ?>">
|
||||
|
||||
<i class="bi bi-person-vcard-fill me-2"></i>
|
||||
Data Karyawan
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<a class="dropdown-item rounded-3 <?= ($active_menu == 'generate_schedule') ? 'active' : '' ?>"
|
||||
href="<?= base_url('generateschedule'); ?>">
|
||||
|
||||
<i class="bi bi-calendar3-week-fill me-2"></i>
|
||||
Jadwal Kerja
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="dropdown-item rounded-3 <?= ($active_menu == 'attendance_monitoring') ? 'active' : '' ?>"
|
||||
href="<?= base_url('attendancemonitoring'); ?>">
|
||||
|
||||
<i class="bi bi-fingerprint me-2"></i>
|
||||
Monitoring Absensi
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="dropdown-item rounded-3 <?= ($active_menu == 'attendance_monthly') ? 'active' : '' ?>"
|
||||
href="<?= base_url('attendancemonthly'); ?>">
|
||||
|
||||
<i class="bi bi-calendar2-date me-2"></i>
|
||||
Absensi Bulanan
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<hr class="dropdown-divider">
|
||||
<li>
|
||||
|
||||
<a class="dropdown-item rounded-3 <?= ($active_menu == 'shift') ? 'active' : '' ?>"
|
||||
href="<?= base_url('shifts'); ?>">
|
||||
|
||||
<i class="bi bi-alarm-fill me-2"></i>
|
||||
Data Shift
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<a class="dropdown-item rounded-3 <?= ($active_menu == 'holidays') ? 'active' : '' ?>"
|
||||
href="<?= base_url('holidays'); ?>">
|
||||
|
||||
<i class="bi bi-calendar2-heart-fill me-2"></i>
|
||||
Hari Libur
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<a class="dropdown-item rounded-3 <?= ($active_menu == 'leave_requests') ? 'active' : '' ?>"
|
||||
href="<?= base_url('leaverequests'); ?>">
|
||||
|
||||
<i class="bi bi-calendar-check-fill me-2"></i>
|
||||
Cuti & Izin
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<hr class="dropdown-divider">
|
||||
<li>
|
||||
|
||||
<a class="dropdown-item rounded-3 <?= ($active_menu == 'payroll') ? 'active' : '' ?>"
|
||||
href="<?= base_url('payroll'); ?>">
|
||||
|
||||
<i class="bi bi-cash-stack me-2"></i>
|
||||
Penggajihan
|
||||
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<?php if($role == 'Admin'): ?>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle <?= in_array($active_menu, ['umum','users']) ? 'active' : '' ?>" href="#" data-bs-toggle="dropdown">
|
||||
<i class="bi bi-gear"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item <?= ($active_menu == 'umum') ? 'active' : '' ?>" href="<?= base_url('umum'); ?>">
|
||||
<i class="bi bi-sliders me-2"></i> Umum</a>
|
||||
</li>
|
||||
<li><a class="dropdown-item <?= ($active_menu == 'users') ? 'active' : '' ?>" href="<?= base_url('users'); ?>">
|
||||
<i class="bi bi-person-gear me-2"></i> Users</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="btn btn-premium dropdown-toggle" href="#" data-bs-toggle="dropdown">
|
||||
<i class="bi bi-person-circle me-1"></i> <?= $this->session->username; ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a class="dropdown-item <?= ($active_menu == 'profile') ? 'active' : '' ?>" href="<?= base_url('profile'); ?>">
|
||||
<i class="bi bi-person me-2"></i> Profile</a></li>
|
||||
<li><a class="dropdown-item" href="<?= base_url('auth/logout'); ?>">
|
||||
<i class="bi bi-box-arrow-right me-2"></i> Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div style="height: 70px;"></div>
|
||||
|
||||
|
||||
<!-- ───────────────────────── SIDEBAR MOBILE ───────────────────────── -->
|
||||
<div class="offcanvas offcanvas-start" tabindex="-1" id="mobileMenu">
|
||||
<div class="offcanvas-header">
|
||||
<span class="brand-mobile">🌿 Sekolah Islami</span>
|
||||
<button class="btn-close" data-bs-dismiss="offcanvas"></button>
|
||||
</div>
|
||||
|
||||
<div class="offcanvas-body">
|
||||
<ul class="nav flex-column">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?= ($active_menu == 'dashboard') ? 'active' : ''?>" href="<?= base_url(); ?>">
|
||||
<span class="menu-wrap"><i class="bi bi-speedometer2"></i> Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="sidebar-divider"></div>
|
||||
|
||||
<a href="<?= base_url('logout'); ?>" class="btn btn-logout">
|
||||
<i class="bi bi-box-arrow-right me-2"></i> Logout
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$active_menu=isset($active_menu)?$active_menu:'dashboard';
|
||||
$CI=&get_instance();
|
||||
$CI->load->library('NavigationService');
|
||||
$menu_items=$CI->navigationservice->items();
|
||||
$breadcrumbs=$CI->navigationservice->breadcrumb($active_menu);
|
||||
$quick_actions=$CI->navigationservice->quickActions();
|
||||
$page_title=end($breadcrumbs);
|
||||
$CI->config->load('ui_assets',true);
|
||||
$uiAssets=$CI->config->item('ui_assets');
|
||||
$dataPages=isset($uiAssets['ui_data_pages'])?$uiAssets['ui_data_pages']:array();
|
||||
$selectPages=isset($uiAssets['ui_select_pages'])?$uiAssets['ui_select_pages']:array();
|
||||
$userName=$this->session->userdata('nama')?:$this->session->userdata('username')?:'Pengguna';
|
||||
$userRole=$this->session->userdata('role')?:'User';
|
||||
?><!doctype html><html lang="id"><head>
|
||||
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="theme-color" content="#ee7800">
|
||||
<meta name="csrf-name" content="<?=$this->security->get_csrf_token_name()?>"><meta name="csrf-token" content="<?=$this->security->get_csrf_hash()?>">
|
||||
<title><?=html_escape($page_title)?> · Accounting</title>
|
||||
<link rel="manifest" href="<?=base_url('manifest.webmanifest')?>"><link rel="icon" href="<?=base_url('assets/img/pwa-192.png')?>"><link rel="apple-touch-icon" href="<?=base_url('assets/img/pwa-192.png')?>">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" onerror="this.onerror=null;this.href='<?=base_url('assets/vendor/bootstrap.min.css')?>'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
|
||||
<?php if(in_array($active_menu,$dataPages,true)):?><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/datatables.net-bs5@1.13.8/css/dataTables.bootstrap5.min.css"><?php endif?>
|
||||
<?php if(in_array($active_menu,$selectPages,true)):?><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css"><?php endif?>
|
||||
<link rel="stylesheet" href="<?=base_url('assets/css/style-custom.css').'?v='.filemtime(FCPATH.'assets/css/style-custom.css')?>"><link rel="stylesheet" href="<?=base_url('assets/css/app-final.css').'?v='.filemtime(FCPATH.'assets/css/app-final.css')?>">
|
||||
<script src="<?=base_url('assets/vendor/jquery.min.js')?>"></script>
|
||||
<?php if(in_array($active_menu,$dataPages,true)):?><script src="https://cdn.jsdelivr.net/npm/datatables.net@1.13.8/js/jquery.dataTables.min.js"></script><script src="https://cdn.jsdelivr.net/npm/datatables.net-bs5@1.13.8/js/dataTables.bootstrap5.min.js"></script><script src="https://cdn.jsdelivr.net/npm/datatables.net-responsive@2.5.0/js/dataTables.responsive.min.js"></script><?php endif?>
|
||||
<?php if(in_array($active_menu,$selectPages,true)):?><script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script><?php endif?>
|
||||
</head><body class="app-v2" data-page="<?=html_escape($active_menu)?>">
|
||||
<a class="visually-hidden-focusable skip-link" href="#mainContent">Lewati ke konten</a>
|
||||
<div class="app-shell">
|
||||
<aside class="app-sidebar d-none d-lg-flex">
|
||||
<a class="sidebar-brand" href="<?=base_url()?>"><span class="brand-mark"><img src="<?=base_url('assets/img/accounting-white.png')?>" alt=""></span><span><strong>Accounting</strong><small>Business Suite</small></span></a>
|
||||
<div class="sidebar-search"><i class="bi bi-search"></i><input class="menu-filter" type="search" placeholder="Cari menu..." aria-label="Cari menu"></div>
|
||||
<nav class="sidebar-nav" aria-label="Navigasi utama"><?php $this->load->view('partials/navigation_items',compact('menu_items','active_menu'))?></nav>
|
||||
<div class="sidebar-user"><span class="user-avatar"><?=html_escape(strtoupper(substr($userName,0,1)))?></span><span class="user-copy"><strong><?=html_escape($userName)?></strong><small><?=html_escape($userRole)?></small></span><a href="<?=base_url('auth/logout')?>" title="Keluar"><i class="bi bi-box-arrow-right"></i></a></div>
|
||||
</aside>
|
||||
<section class="app-workspace">
|
||||
<header class="app-topbar">
|
||||
<div class="topbar-leading"><button class="icon-button d-lg-none" data-bs-toggle="offcanvas" data-bs-target="#mobileMenu" aria-label="Buka menu"><i class="bi bi-list"></i></button><div><span class="topbar-kicker">Accounting Workspace</span><h1><?=html_escape($page_title)?></h1></div></div>
|
||||
<div class="topbar-actions"><button class="icon-button" data-bs-toggle="modal" data-bs-target="#menuSearchModal" aria-label="Cari menu"><i class="bi bi-search"></i></button><button class="icon-button quick-button" data-bs-toggle="modal" data-bs-target="#quickActions" aria-label="Aksi cepat"><i class="bi bi-lightning-charge"></i></button><a class="icon-button d-lg-none" href="<?=base_url('auth/logout')?>" aria-label="Keluar"><i class="bi bi-box-arrow-right"></i></a></div>
|
||||
</header>
|
||||
<div class="offcanvas offcanvas-start app-mobile-drawer" id="mobileMenu" tabindex="-1"><div class="offcanvas-header"><a class="drawer-brand" href="<?=base_url()?>"><span class="brand-mark"><img src="<?=base_url('assets/img/accounting-white.png')?>" alt=""></span><span><strong>Accounting</strong><small>Business Suite</small></span></a><button class="btn-close" data-bs-dismiss="offcanvas" aria-label="Tutup"></button></div><div class="offcanvas-body"><div class="sidebar-search"><i class="bi bi-search"></i><input class="menu-filter" type="search" placeholder="Cari menu..."></div><nav class="sidebar-nav mobile-nav"><?php $this->load->view('partials/navigation_items',compact('menu_items','active_menu'))?></nav></div></div>
|
||||
<div class="modal fade" id="menuSearchModal" tabindex="-1"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><div><small class="text-muted">NAVIGASI</small><h5 class="modal-title">Cari menu</h5></div><button class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body"><div class="command-search"><i class="bi bi-search"></i><input class="form-control form-control-lg menu-filter" type="search" placeholder="Ketik nama menu..." autofocus></div><div class="search-menu-results mt-3"></div></div></div></div></div>
|
||||
<div class="modal fade" id="quickActions" tabindex="-1"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><div><small class="text-muted">SHORTCUT</small><h5 class="modal-title">Aksi cepat</h5></div><button class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body quick-grid"><?php foreach($quick_actions as$q):?><a class="quick-action" href="<?=base_url($q['url'])?>"><i class="bi <?=$q['icon']?>"></i><span><?=html_escape($q['label'])?></span></a><?php endforeach?></div></div></div></div>
|
||||
<main id="mainContent" class="app-content"><div class="app-breadcrumb"><nav aria-label="breadcrumb"><ol class="breadcrumb mb-0"><li class="breadcrumb-item"><a href="<?=base_url()?>"><i class="bi bi-house-door"></i></a></li><?php foreach($breadcrumbs as$i=>$crumb):?><li class="breadcrumb-item <?=$i===count($breadcrumbs)-1?'active':''?>"><?=html_escape($crumb)?></li><?php endforeach?></ol></nav></div><div id="globalLoading" class="global-loading" hidden><div class="loading-card"><div class="spinner-border"></div><span>Memproses data…</span></div></div>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php foreach($menu_items as$item):
|
||||
$children=isset($item['children'])?$item['children']:array();
|
||||
$active=$active_menu===$item['key'];
|
||||
foreach($children as$child)$active=$active||$active_menu===$child['key'];
|
||||
$searchLabel=strtolower($item['label'].' '.implode(' ',array_column($children,'label')));
|
||||
?>
|
||||
<?php if($children):?>
|
||||
<details class="app-menu-item nav-group <?=$active?'is-active':''?>" data-menu-label="<?=html_escape($searchLabel)?>" <?=$active?'open':''?>>
|
||||
<summary class="nav-entry"><span class="nav-entry-icon"><i class="bi <?=$item['icon']?>"></i></span><span class="nav-entry-label"><?=html_escape($item['label'])?></span><?php if(!empty($item['badge'])):?><span class="nav-badge <?=html_escape($item['badge_class']??'')?>" title="<?=html_escape($item['badge_title']??'')?>"><?=(int)$item['badge']?></span><?php endif?><i class="bi bi-chevron-down nav-chevron"></i></summary>
|
||||
<div class="nav-children"><?php foreach($children as$child):?><a class="nav-child <?=$active_menu===$child['key']?'active':''?>" href="<?=base_url($child['url'])?>"><span></span><?=html_escape($child['label'])?><?php if(!empty($child['badge'])):?><span class="nav-badge <?=html_escape($child['badge_class']??'')?> ms-auto" title="<?=html_escape($child['badge_title']??'')?>"><?=(int)$child['badge']?></span><?php endif?></a><?php endforeach?></div>
|
||||
</details>
|
||||
<?php else:?>
|
||||
<div class="app-menu-item" data-menu-label="<?=html_escape($searchLabel)?>"><a class="nav-entry <?=$active?'active':''?>" href="<?=base_url($item['url'])?>"><span class="nav-entry-icon"><i class="bi <?=$item['icon']?>"></i></span><span class="nav-entry-label"><?=html_escape($item['label'])?></span><?php if(!empty($item['badge'])):?><span class="nav-badge <?=html_escape($item['badge_class']??'')?>" title="<?=html_escape($item['badge_title']??'')?>"><?=(int)$item['badge']?></span><?php endif?></a></div>
|
||||
<?php endif;endforeach?>
|
||||
Reference in New Issue
Block a user