<?php
session_start();
error_reporting(0);
include "config/koneksi.php";
include "config/library.php";
include "config/fungsi_indotgl.php";
include "config/excel_reader.php";
include "config/fungsi_seo.php";
include "config/fungsi_thumb.php";
if (isset($_SESSION[id])) {
        if ($_SESSION[level] == 'kepsek') {
        }
        $iden = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM users where username='$_SESSION[id]'"));
        $nama =  $iden[nama_lengkap];
        $level = 'Kepala Sekolah';
        $foto = 'gambar/' . $iden[fotoUser];

        $idt = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM identitas"));

        $ta = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM tahun_ajaran where aktif='Y'"));
?>
        <!DOCTYPE html>
        <html>

        <head>
                <meta charset="utf-8">
                <meta http-equiv="X-UA-Compatible" content="IE=edge">
                <title>Simpodik (Sistem Informasi Manajemen Pokok Pendidikan)</title>

                <link rel="shortcut icon" href="simpo.png">
                <!-- Tell the browser to be responsive to screen width -->
                <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
                <!-- Bootstrap 3.3.5 -->
                <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
                <link rel="stylesheet" href="./assets/style.css">
                <!-- Font Awesome -->
                <link rel="stylesheet" href="./assets/font-awesome-4.6.3/css/font-awesome.min.css">
                <!-- Ionicons -->
                <link rel="stylesheet" href="./assets/ionicons/css/ionicons.min.css">
                <!-- DataTables -->
                <link rel="stylesheet" href="plugins/datatables/dataTables.bootstrap.css">
                <!-- Theme style -->
                <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
                <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
                <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
                <!-- iCheck -->
                <link rel="stylesheet" href="plugins/iCheck/flat/blue.css">
                <!-- Morris chart -->
                <link rel="stylesheet" href="plugins/morris.js/morris.css">
                <!-- jvectormap -->
                <link rel="stylesheet" href="plugins/jvectormap/jquery-jvectormap-1.2.2.css">
                <!-- Date Picker -->
                <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
                <link rel="stylesheet" href="plugins/datetimepicker/bootstrap-datetimepicker.css">
                <!-- Daterange picker -->
                <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker-bs3.css">
                <!-- Bootstrap Select -->
                <!-- Full Calendar-->

                <link rel="stylesheet" href="assets/bootstrap-select/css/bootstrap-select.min.css" />
                <!-- bootstrap wysihtml5 - text editor -->
                <link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
                <style type="text/css">
                        .files {
                                position: absolute;
                                z-index: 2;
                                top: 0;
                                left: 0;
                                filter: alpha(opacity=0);
                                -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
                                opacity: 0;
                                background-color: transparent;
                                color: transparent;
                        }
                </style>
                <script type="text/javascript" src="plugins/jQuery/jquery-1.12.3.min.js"></script>
                <script language="javascript" type="text/javascript">
                        var maxAmount = 160;

                        function textCounter(textField, showCountField) {
                                if (textField.value.length > maxAmount) {
                                        textField.value = textField.value.substring(0, maxAmount);
                                } else {
                                        showCountField.value = maxAmount - textField.value.length;
                                }
                        }
                </script>
                <script type="text/javascript" src="getDataCombo.js"></script>

        </head>

        <body class="hold-transition skin-yellow sidebar-mini">
                <div class="wrapper">
                        <header class="main-header">
                                <?php include "main-headerk.php"; ?>
                        </header>

                        <aside class="main-sidebar">
                                <?php
                                include "menu-kepsek.php";
                                ?>
                        </aside>

                        <div class="content-wrapper">
                                <!-- Content Header (Page header) -->
                                <section class="content-header">
                                        <h1>
                                                <?php echo $judul; ?>
                                        </h1>
                                </section>

                                <section class="content">
                                        <?php if ($_GET[view] == 'homes') {
                                                echo "<div class='row'>";
                                                include "kepsek/home_admin_row.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'admin') {

                                                echo "<div class='row'>";
                                                include "kepsek/master_admin.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'jenis_pengeluaran') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_jenis_pengeluaran.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'pengaturan') {

                                                echo "<div class='row'>";
                                                include "kepsek/pengaturan_identitas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'guru') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/master_guru.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'lappembayaranhari') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_kondisi_keuangan_perhari.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'bkguru') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/bk-guru.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'bk') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/bk.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'absensiswa') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/absensi_siswa.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'rekapabsensiswa') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/absensi_siswa_rekap.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'journalkbm') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/journal_semua.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'jurnalguru') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/journal_guru.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'jadwalpelajaran') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/master_jadwalpelajaran.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'jadwalpelajaranguru') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/master_jadwalpelajaran_guru.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'matapelajaran') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_sease/master_matapelajaran.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'setor') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_transaksi/setoran.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'lapkas') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_laporan/laporan-kas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'kasmas') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_kas/masuk.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'kaskel') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_kas/keluar.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'tagihan1') {
                                                echo "<div class='row'>";
                                                include "kepsek/tagihan.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'calendar') {
                                                echo "<div class='row'>";
                                                include "kepsek/calendar.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'admin') {

                                                echo "<div class='row'>";
                                                include "kepsek/master_admin.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'tahun') {

                                                echo "<div class='row'>";
                                                include "kepsek/master_tahun.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'kelas') {

                                                echo "<div class='row'>";
                                                include "kepsek/master_kelas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'siswa') {

                                                echo "<div class='row'>";
                                                include "kepsek/master_siswa.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'kelulusan') {

                                                echo "<div class='row'>";
                                                include "kepsek/master_kelulusan.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'kenaikankelas') {

                                                echo "<div class='row'>";
                                                include "kepsek/master_kenaikankelas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'hutangtoko') {

                                                echo "<div class='row'>";
                                                include "kepsek/hutangtoko.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'detailtoko') {

                                                echo "<div class='row'>";
                                                include "kepsek/detailtoko.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'posbayar') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_posbayar.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'jenisbayar') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_jenisbayar.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'tarif' && $_GET[tipe] == 'bulanan') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_tarif_bulanan.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'tarif' && $_GET[tipe] == 'bebas') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_tarif_bebas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'pembayaran') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_pembayaran.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'angsuran') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_pembayaran_bebas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'bayarbulanan') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_pembayaran_bulanan.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'jurnalumum') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_jurnalumum.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'jurnal') {

                                                echo "<div class='row'>";
                                                include "kepsek/keuangan_jurnal.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'lapsiswa') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_siswa.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'lappembayaran') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_pembayaran_perkelas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'lappembayaranperbulan') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_pembayaran_perbulan.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'lappembayaranperposbayar') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_pembayaran_perposbayar.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'laptagihansiswa') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_tagihan_siswa.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'rekapitulasi') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_rekapitulasi.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'rekappengeluaran') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_rekappengeluaran.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'rekapkondisikeuangan') {

                                                echo "<div class='row'>";
                                                include "kepsek/laporan_kondisi_keuangan.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'backup') {

                                                echo "<div class='row'>";
                                                include "kepsek/backup-datas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'restore') {

                                                echo "<div class='row'>";
                                                include "kepsek/restore.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'kelasnya') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_kelas/kelas.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'nasabah') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_nasabah/nasabah.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'transaksi') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_transaksi/transaksi.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'laporan-transaksi') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_laporan/laporan-transaksi.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'pengaturant') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_pengaturan/pengaturan.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'laptransaksinasabah') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_laporan/laporan-nasabah.php";
                                                echo "</div>";
                                        } elseif ($_GET[view] == 'laptransaksi') {

                                                echo "<div class='row'>";
                                                include "kepsek/com_laporan/laporan-transaksi.php";
                                                echo "</div>";
                                        }

                                        ?>
                                </section>
                        </div><!-- /.content-wrapper -->
                        <footer class="main-footer">
                                <?php include "footer.php"; ?>
                        </footer>
                        <nav id="menu-bottom" class="nav">
                                <a href="index-kepsek.php?view=home" class="nav__link">
                                        <i class="fas fa-home"></i>
                                        <span class="nav__text">Home</span>
                                </a>
                                <a href="index-kepsek.php?view=laptanggungan" class="nav__link nav__link">
                                        <i class="fas fa-money-bill-wave"></i>
                                        <span class="nav__text">Bayar</span>
                                </a>
                                <a href="index-kepsek.php?view=bahantugas" class="nav__link">
                                        <i class="fas fa-graduation-cap"></i>
                                        <span class="nav__text">Tugas</span>
                                </a>
                                <a href="index-kepsek.php?view=soal&act=detailsiswa&tahun=<?php echo $ta; ?>" class="nav__link">
                                        <i class="fas fa-book"></i>
                                        <span class="nav__text">Quiz/Ujian </span>
                                </a>
                                <a href="index-kepsek.php?view=siswa&act=edit&id=<?php echo $_SESSION['idsa']; ?>" class="nav__link">
                                        <i class="fas fa-user-lock"></i>
                                        <span class="nav__text">Profile</span>
                                </a>

                        </nav>
                </div><!-- ./wrapper -->
                <!-- jQuery 2.1.4 -->
                <script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
                <!-- jQuery UI 1.11.4 -->
                <script src="plugins/jQueryUI/jquery-ui.min.js"></script>
                <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
                <script>
                        $.widget.bridge('uibutton', $.ui.button);
                </script>
                <script src="plugins/highcharts/js/highcharts.js"></script>
                <script src="plugins/highcharts/js/modules/data.js"></script>
                <script src="plugins/highcharts/js/modules/exporting.js"></script>
                <!-- Bootstrap 3.3.5 -->
                <script src="bootstrap/js/bootstrap.min.js"></script>
                <!-- DataTables -->
                <script src="plugins/datatables/jquery.dataTables.min.js"></script>
                <script src="plugins/datatables/dataTables.bootstrap.min.js"></script>
                <!-- Morris.js charts -->
                <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
                <script src="plugins/morris/morris.min.js"></script>
                <!-- Sparkline -->
                <script src="plugins/sparkline/jquery.sparkline.min.js"></script>
                <!-- jvectormap -->
                <script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
                <script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
                <!-- jQuery Knob Chart -->
                <script src="plugins/knob/jquery.knob.js"></script>
                <!-- daterangepicker -->
                <script src="plugins/moment/moment.min.js"></script>
                <script src="plugins/daterangepicker/daterangepicker.js"></script>
                <script src="plugins/datetimepicker/bootstrap-datetimepicker.js"></script>
                <!-- datepicker -->
                <script src="plugins/datepicker/bootstrap-datepicker.js"></script>
                <!-- Bootstrap WYSIHTML5 -->
                <script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
                <!-- Slimscroll -->
                <script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
                <!-- FastClick -->
                <script src="plugins/fastclick/fastclick.min.js"></script>
                <!-- AdminLTE App -->
                <script src="dist/js/app.min.js"></script>
                <script src="plugins/fullcalendar/dist/fullcalendar.min.js"></script>
                <script src="assets/js/script.js"></script>
                <script src="assets/app.js"></script>

                <script src="assets/bootstrap-select/js/bootstrap-select.min.js"></script>

                <script>
                        $('.textarea').wysihtml5();

                        $(function() {
                                // calendar
                                $('#calendar').datepicker();
                                // datepicker plugin
                                $('.date-picker').datepicker({
                                        autoclose: true,
                                        todayHighlight: true,
                                        format: 'yyyy-mm-dd'
                                });

                                $("#example1").DataTable();
                                $('#example2').DataTable({
                                        "paging": true,
                                        "lengthChange": false,
                                        "searching": false,
                                        "ordering": true,
                                        "info": true,
                                        "autoWidth": false
                                });

                                $('#example3').DataTable({
                                        "paging": true,
                                        "lengthChange": false,
                                        "searching": false,
                                        "ordering": false,
                                        "info": false,
                                        "autoWidth": false,
                                        "pageLength": 200
                                });

                                $('#mastersiswa').DataTable({
                                        "paging": false,
                                        "lengthChange": false,
                                        "searching": true,
                                        "ordering": false,
                                        "info": false,
                                        "autoWidth": false,
                                        "pageLength": 200
                                });

                                $('#example5').DataTable({
                                        "paging": true,
                                        "lengthChange": false,
                                        "searching": false,
                                        "info": false,
                                        "autoWidth": false,
                                        "pageLength": 200,
                                        "order": [
                                                [5, "desc"]
                                        ]
                                });
                        });

                        //$('.datepicker').datepicker();

                        $('.datepicker').datepicker({
                                format: 'yyyy-mm-dd',
                        });

                        $('.datetimepicker').datetimepicker({
                                format: 'yyyy-mm-dd hh:ii:ss',
                                weekStart: 1,
                                todayBtn: 1,
                                autoclose: 1
                        });

                        $(".harusAngka").keypress(function(e) {
                                //if the letter is not digit then display error and don't type anything
                                if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
                                        return false;
                                }
                        });

                        $("#parent").click(function() {
                                $(".child").prop("checked", this.checked);
                        });

                        $('.child').click(function() {
                                if ($('.child:checked').length == $('.child').length) {
                                        $('#parent').prop('checked', true);
                                } else {
                                        $('#parent').prop('checked', false);
                                }
                        });

                        //hitung
                        /*
                        $('#hitungBayaran').keyup(function(){
                        	if ($(this).val() > $("#sisa").val()){
                        		alert('Anda memasukkan nilai melebihi total tagihan!');
                        		$(this).val($("#sisa").val());
                        	}
                        });
                        */

                        $("#allTarif").keypress(function(e) {
                                var allTarif = $("#allTarif").val();
                                if (e.which == 13) {
                                        $("#n1").val(allTarif);
                                        $("#n2").val(allTarif);
                                        $("#n3").val(allTarif);
                                        $("#n4").val(allTarif);
                                        $("#n5").val(allTarif);
                                        $("#n6").val(allTarif);
                                        $("#n7").val(allTarif);
                                        $("#n8").val(allTarif);
                                        $("#n9").val(allTarif);
                                        $("#n10").val(allTarif);
                                        $("#n11").val(allTarif);
                                        $("#n12").val(allTarif);
                                }
                        });
                        $("#allTarifBebas").keypress(function(e) {
                                var allTarif = $("#allTarifBebas").val();
                                if (e.which == 13) {
                                        $(".nTagihan").val(allTarif);
                                }
                        });
                </script>

                <script type="text/javascript">
                        $(document).ready(function() {
                                myGrafikMasukKeluar("<?= $ta['idTahunAjaran'] ?>");
                        });
                        $('#comboGrafik').change(function() {
                                var idTahunAjaran = $('#comboGrafik').val();
                                myGrafikMasukKeluar(idTahunAjaran);
                        });

                        function myGrafikMasukKeluar(idTahunAjaran) {
                                document.getElementById("bar-chart").innerHTML = '&nbsp;';
                                $.post("admin/grafik/data-pemasukan-pengeluaran.php?thnAjaran=" + idTahunAjaran,
                                        function(dataVal) {
                                                //BAR CHART
                                                var bar = new Morris.Bar({
                                                        element: 'bar-chart',
                                                        resize: true,
                                                        data: dataVal,
                                                        barColors: ['#00a65a', '#f56954'],
                                                        xkey: 'y',
                                                        ykeys: ['a', 'b'],
                                                        labels: ['Pemasukan', 'Pengeluaran'],
                                                        hideHover: 'auto'
                                                });
                                        });
                        }
                </script>

                <script>
                        $(function() {
                                "use strict";

                                //BAR CHART
                                var bar = new Morris.Bar({
                                        element: 'bar-chart',
                                        resize: true,
                                        data: [
                                                <?php
                                                $sqlBulan = mysqli_query($conn, "SELECT * FROM bulan ORDER BY urutan ASC");
                                                while ($bln = mysqli_fetch_array($sqlBulan)) :
                                                        $bulan = $bln['idBulan'];

                                                        $ta_pisah = explode("/", $ta['nmTahunAjaran']);
                                                        if ($bln['urutan'] <= 6) {
                                                                $tahun = $ta_pisah[0];
                                                        } else {
                                                                $tahun = $ta_pisah[1];
                                                        }

                                                        // Hitung Pemasukan
                                                        $totalMasuk = 0;
                                                        $dBulananMasuk = mysqli_fetch_array(mysqli_query($conn, "SELECT SUM(jumlahBayar) AS totalMasuk FROM tagihan_bulanan 
                                                              WHERE statusBayar='1' AND month(tglBayar) = '$bulan' AND year(tglBayar)='$tahun'"));
                                                        $totalMasuk += $dBulananMasuk['totalMasuk'];
                                                        $dBebasMasuk = mysqli_fetch_array(mysqli_query($conn, "SELECT SUM(jumlahBayar) AS totalMasuk FROM tagihan_bebas_bayar 
                                                          WHERE month(tglBayar) = '$bulan' AND year(tglBayar)='$tahun'"));
                                                        $totalMasuk += $dBebasMasuk['totalMasuk'];


                                                        // Hitung Pengeluaran
                                                        $totalKeluar = 0;
                                                        $dJurnalKeluar = mysqli_fetch_array(mysqli_query($conn, "SELECT SUM(pengeluaran) AS totalKeluar FROM jurnal_umum WHERE month(tgl)='$bulan' AND year(tgl)='$tahun'"));
                                                        $totalKeluar += $dJurnalKeluar['totalKeluar'];

                                                ?>

                                                        {
                                                                y: '<?= getBulan($bln[idBulan]) . ' ' . $tahun ?>',
                                                                a: <?= $totalMasuk ?>,
                                                                b: <?= $totalKeluar ?>
                                                        },

                                                <?php
                                                endwhile;
                                                ?>
                                        ],
                                        barColors: ['#00a65a', '#f56954'],
                                        xkey: 'y',
                                        ykeys: ['a', 'b'],
                                        labels: ['Pemasukan', 'Pengeluaran'],
                                        hideHover: 'auto'
                                });
                        });
                </script>



                < /body>

                        < /html>

                        <?php
                } else {
                        include "login-kepsek.php";
                }
                        ?>