<!DOCTYPE html>
<html lang="en">
<?php include("layout/meta.php");?>
	<body class="no-skin">
	<?php include("layout/navbar.php");?>
		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try{ace.settings.loadState('main-container')}catch(e){}
			</script>
			<?php include("layout/sidebar.php");?>
			<div class="main-content">
			  <div class="main-content-inner">
				<div class="col-xs-12">
						</div><!-- /.ace-settings-container -->
						
				  <div class="widget-box">
					<div class="widget-body">
					<?php if(!empty($pesan)){ ?>
					<div class="alert alert-<?php echo $alert;?>" role="alert" style="text-align:center;">
					 <strong><?php echo validation_errors(); echo $pesan ;?></strong>
					</div><?php }?>							
							<div class="alert alert-block alert-success">
									<button type="button" class="close" data-dismiss="alert">
										<i class="ace-icon fa fa-times"></i>
									</button>
									<i class="ace-icon fa fa-check green"></i>
									Selamat datang <strong class="green"> <?php  echo  $this->session->userdata('nama');?></strong>
									, Sistem Informasi Persewaan Gedung Diklat Pemerintahan Kota Madiun

								</div>
						
					</div>
					<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
				<div class="col-xs-8  col-sm-offset-2"  >					
<div class="clearfix center"><h4>Jumlah  Pemakai Gedung Diklat Pemerintah Kota Madiun </h4><h4>Tahun <?php echo date('Y');?></h4></div>
			<canvas id="myChart" width="100px"></canvas>			
			<script>
			var ctx = document.getElementById('myChart').getContext('2d');
			var myChart = new Chart(ctx, {
				type: 'bar',
				data: {
					labels: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'],
					datasets: [{
						label: 'Jumlah Pemakai',
						data: [
						<?php 
						$this->load->model('m_home');
						for ($x = 1; $x <= 12; $x++) {
						$bln=$x;
						$thn=date('Y-m-d');
						echo $tampil = $this->m_home->grafikpemakai($bln, $thn);						  
						?>,
						<?php }?>
						],
						backgroundColor: [
							'rgba(255, 99, 132, 0.2)',
							'rgba(54, 162, 235, 0.2)',
							'rgba(200, 0, 130, 0.2)',
							'rgba(20, 40, 40, 0.2)',
							'rgba(60, 200, 40, 0.2)',
							'rgba(200, 200, 200, 0.2)',
							'rgba(67, 111, 59, 0.2)',
							'rgba(65, 200, 235, 0.2)',
							'rgba(0, 162, 0, 0.2)',
							'rgba(0, 0, 235, 0.2)',
							'rgba(55, 162, 0, 0.2)',
							'rgba(25, 89, 66, 0.2)',

						],
						borderColor: [
							'rgba(255, 99, 132, 1)',
							'rgba(54, 162, 235, 1)',
							'rgba(200, 0, 130, 1)',
							'rgba(20, 40, 40, 1)',
							'rgba(60, 200, 40, 1)',
							'rgba(200, 200, 200, 1)',
							'rgba(67, 111, 59, 1)',
							'rgba(65, 200, 235, 1)',
							'rgba(0, 162, 0, 1)',
							'rgba(0, 0, 235, 1)',
							'rgba(55, 162, 0, 1)',
							'rgba(25, 89, 66, 1)',

						],
						borderWidth: 1
					}]
				},
				options: {
					scales: {
						yAxes: [{
							ticks: {
								beginAtZero: true
							}
						}]
					}
				}
			});
			</script>
		 </div>
				  </div>
				</div>
				<!-- /.span -->
			  </div>
			  <!-- /.main-content -->
			</div>
			<?php include("layout/footer.php");?>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->
			<?php include("layout/sc_footer.php");?>

	</body>
</html>
