<?php
	//$id = $this->session->userdata('id');
	$set = $this->db->query("SELECT * FROM pengaturan WHERE id='2' ")->row();
?>
<!DOCTYPE html>
<html lang="en">
	
	<head>
		
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">
		
		<title><?=$set->title;?> |
			<?=$set->deskripsi_singkat;?>
		</title>
		<link rel="shortcut icon" href="<?php echo base_url('sb/img/favicon.png'); ?>">
		<!-- Custom fonts for this template-->
		<link href="<?php echo base_url('sb'); ?>/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
		<!-- link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet" -->
		
		<!-- Custom styles for this template-->
		<link href="<?php echo base_url('sb'); ?>/css/style.css" rel="stylesheet">
		<link href="<?php echo base_url('sb'); ?>/css/sb-admin-2.min.css" rel="stylesheet">
		
		<!-- Custom styles for this page -->
		<link href="<?php echo base_url('sb'); ?>/vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
		<link href="<?php echo base_url('sb'); ?>/vendor/select2/css/select2.min.css" rel="stylesheet">
		<link rel="stylesheet" href="<?php echo base_url('sb'); ?>/css/AdminLTE.min.css">
		<link rel="stylesheet" href="<?php echo base_url('sb'); ?>/datepicker/datepicker3.css">
		<link href="<?=base_url('one');?>/assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
		<style type="text/css">
			body {
			margin-top: 0px;
			}
		</style>
	</head>
	
	<body id="page-top---2">
		<div class="preloader">
			<div class="loading">
				<img src="<?php echo base_url('sb/img/loading.gif'); ?>" width="400">
				<br />
				<center>
					<p>Harap Tunggu...</p>
				</center>
			</div>
		</div>
		<!-- Page Wrapper -->
		<div id="wrapper">
			
			<!-- Sidebar -->
			<?php $this->load->view('template/menu_sidebar'); ?>
			<!-- End of Sidebar -->
			
			<!-- Content Wrapper -->
			<div id="content-wrapper" class="d-flex flex-column background-batik">
				<!-- Main Content -->
				<div id="content">
					
					<!-- Topbar -->
					<?php $this->load->view('template/menu_top'); ?>
					<!-- End of Topbar -->
					<div style="padding:10px;"></div>
					
					<!-- Begin Page Content -->
					<div class="container-fluid">
						
						<div class="row">
							<!-- Area Chart -->
							<div class="col-xl-12 col-lg-12">
								<div class="card shadow mb-4">
									<!-- Card Header - Dropdown -->
									<div
									class="card-header bg-primary py-3 d-flex flex-row align-items-center justify-content-between">
										<h6 class="m-0 font-weight-bold text-white"><?php echo $judul_halaman; ?></h6>
									</div>
									<!-- Card Body -->
									<div class="card-body" style="font-size:13px;">
										<?php echo $contents; ?>
									</div>
								</div>
							</div>
						</div>
						<!-- Content Row -->
					</div>
					<!-- /.container-fluid -->
				</div>
				<!-- End of Main Content -->
				
				<!-- Footer -->
				<footer class="sticky-footer bg-white">
					<div class="container my-auto">
						<div class="copyright text-center my-auto">
							<span><?=$set->nama_satker;?> - Copyright &copy;
								<?php if(date('Y')<='2022'){echo '2022';}else{echo '2022 - '.date('Y');}?>
								Direktorat Jenderal Badan Peradilan Agama - Dev. By <a href="https://dewady.com"
							target="_blank">D.A.C</a></span>
						</div>
					</div>
				</footer>
				<!-- End of Footer -->
				
			</div>
			<!-- End of Content Wrapper -->
			
		</div>
		<!-- End of Page Wrapper -->
		
		<!-- Scroll to Top Button-->
		<a class="scroll-to-top rounded" href="#page-top">
			<i class="fas fa-angle-up"></i>
		</a>
		<!-- Logout Modal-->
		
		<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title" id="exampleModalLabel">Anda yakin Ingin Keluar Sistem?</h5>
						<button class="close" type="button" data-dismiss="modal" aria-label="Close">
							<span aria-hidden="true">×</span>
						</button>
					</div>
					<div class="modal-body">Silahkan Klik "Keluar" untuk mengakhir session login Anda !</div>
					<div class="modal-footer">
						<a class="btn btn-danger" href="<?php echo base_url('logout_all'); ?>" style="float:left;">Keluar
						dari Semua Browser</a>
						<button class="btn btn-secondary" type="button" data-dismiss="modal">Batalkan</button>
						<a class="btn btn-primary" href="<?php echo base_url('logout'); ?>">Keluar</a>
					</div>
				</div>
			</div>
		</div>
		
		<!-- Bootstrap core JavaScript-->
		<!-- script src="<?php echo base_url('sb'); ?>/vendor/select2/js/select2.min.js"></script -->
		<script src="<?php echo base_url('sb'); ?>/vendor/jquery/jquery.min.js"></script>
		<script src="<?php echo base_url('sb'); ?>/vendor/select2/js/select2.min.js"></script>
		<script src="<?php echo base_url('sb'); ?>/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
		
		<!-- Core plugin JavaScript-->
		<script src="<?php echo base_url('sb'); ?>/vendor/jquery-easing/jquery.easing.min.js"></script>
		
		<!-- Custom scripts for all pages-->
		<script src="<?php echo base_url('sb'); ?>/js/sb-admin-2.min.js"></script>
		
		<!-- Page level plugins -->
		<script src="<?php echo base_url('sb'); ?>/vendor/datatables/jquery.dataTables.min.js"></script>
		<script src="<?php echo base_url('sb'); ?>/vendor/datatables/dataTables.bootstrap4.min.js"></script>
		
		<!-- Page level plugins -->
		<script src="<?php echo base_url('sb'); ?>/vendor/chart.js/Chart.min.js"></script>
		
		<!-- Page level custom scripts -->
		<!-- script src="<?php echo base_url('sb'); ?>/js/demo/chart-area-demo.js"></script -->
		
		<script src="<?php echo base_url('sb'); ?>/js/demo/chart-pie-demo.js"></script>
		
		<script src="<?php echo base_url('sb'); ?>/datepicker/bootstrap-datepicker.js"></script>
		<script src="<?php echo base_url('sb'); ?>/datepicker/locales/bootstrap-datepicker.id.js"></script>
		
		<script type="text/javascript">
			$(document).ready(function() {
				$('.select2').select2();
				$('#list_user').DataTable({
					'ordering': true,
				});
			});
			// Call the dataTables jQuery plugin
			$(document).ready(function() {
				$('#dataTable').DataTable();
			});
			
			$(function() {
				//$('.datepicker').datepicker();
				$('.datepicker').datepicker({
					language: 'id',
					weekStart: 1,
					todayBtn: 1,
					autoclose: 1,
					todayHighlight: 1,
					startView: 3,
					minView: 2,
					forceParse: 0,
					format: 'dd-mm-yyyy',
					//startDate: '-3d'
				});
			});
			
		</script>
		
		<!-- script src="http://code.jquery.com/jquery-2.2.1.min.js"></script -->
		<script>
			$(document).ready(function() {
				$(".preloader").fadeOut();
			})
		</script>
		
		<script>
			$(function() {
				$('[data-toggle="tooltip"]').tooltip()
			})
		</script>
		
		<?php if ($this->uri->segment('1') == 'home') { ?>
			<script type="text/javascript">
				// Set new default font family and font color to mimic Bootstrap's default styling
				Chart.defaults.global.defaultFontFamily = 'Nunito',
				'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
				Chart.defaults.global.defaultFontColor = '#858796';
				
				function number_format(number, decimals, dec_point, thousands_sep) {
					// *     example: number_format(1234.56, 2, ',', ' ');
					// *     return: '1 234,56'
					number = (number + '').replace(',', '').replace(' ', '');
					var n = !isFinite(+number) ? 0 : +number,
					prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
					sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
					dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
					s = '',
					toFixedFix = function(n, prec) {
						var k = Math.pow(10, prec);
						return '' + Math.round(n * k) / k;
					};
					// Fix for IE parseFloat(0.55).toFixed(0) = 0;
					s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
					if (s[0].length > 3) {
						s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
					}
					if ((s[1] || '').length < prec) {
						s[1] = s[1] || '';
						s[1] += new Array(prec - s[1].length + 1).join('0');
					}
					return s.join(dec);
				}
				
				// Area Chart Example
				var ctx = document.getElementById("myAreaChart");
				var myLineChart = new Chart(ctx, {
					type: 'line',
					data: {
						labels: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "Septemper",
						"Oktober", "November", "Desember"
						],
						//labels: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
						datasets: [{
							label: "Total",
							lineTension: 0.3,
							backgroundColor: "rgba(78, 115, 223, 0.05)",
							borderColor: "rgba(78, 115, 223, 1)",
							pointRadius: 3,
							pointBackgroundColor: "rgba(78, 115, 223, 1)",
							pointBorderColor: "rgba(78, 115, 223, 1)",
							pointHoverRadius: 3,
							pointHoverBackgroundColor: "rgba(78, 115, 223, 1)",
							pointHoverBorderColor: "rgba(78, 115, 223, 1)",
							pointHitRadius: 10,
							pointBorderWidth: 2,
							data: [<?= $b1 ?>, <?= $b2 ?>, <?= $b3 ?>, <?= $b4 ?>, <?= $b5 ?>, <?= $b6 ?>,
							<?= $b7 ?>, <?= $b8 ?>, <?= $b9 ?>, <?= $b10 ?>, <?= $b11 ?>, <?= $b12 ?>
							],
						}],
					},
					options: {
						maintainAspectRatio: false,
						layout: {
							padding: {
								left: 10,
								right: 25,
								top: 25,
								bottom: 0
							}
						},
						scales: {
							xAxes: [{
								time: {
									unit: 'date'
								},
								gridLines: {
									display: false,
									drawBorder: false
								},
								ticks: {
									maxTicksLimit: 7
								}
							}],
							yAxes: [{
								ticks: {
									maxTicksLimit: 5,
									padding: 10,
									// Include a dollar sign in the ticks
									callback: function(value, index, values) {
										return '' + number_format(value);
									}
								},
								gridLines: {
									color: "rgb(234, 236, 244)",
									zeroLineColor: "rgb(234, 236, 244)",
									drawBorder: false,
									borderDash: [2],
									zeroLineBorderDash: [2]
								}
							}],
						},
						legend: {
							display: false
						},
						tooltips: {
							backgroundColor: "rgb(255,255,255)",
							bodyFontColor: "#858796",
							titleMarginBottom: 10,
							titleFontColor: '#6e707e',
							titleFontSize: 14,
							borderColor: '#dddfeb',
							borderWidth: 1,
							xPadding: 15,
							yPadding: 15,
							displayColors: false,
							intersect: false,
							mode: 'index',
							caretPadding: 10,
							callbacks: {
								label: function(tooltipItem, chart) {
									var datasetLabel = chart.datasets[tooltipItem.datasetIndex].label || '';
									return datasetLabel + ': ' + number_format(tooltipItem.yLabel);
								}
							}
						}
					}
				});
			</script>
		<?php } ?>
		
		
	</body>
	
</html>		