<?php 'koneksi.php'; ?>
<?php
session_start();
if(!isset($_SESSION['username'])) {
header('location:login.php'); }
else { $username = $_SESSION['username']; }
require_once("koneksi.php");
$query = mysql_query("SELECT * FROM login WHERE username = '$username'");
$hasil = mysql_fetch_array($query);
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Admin </title>
  <!-- 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">
  <link rel="icon" type="image/png" href="images/Logo.png">
  <!-- Bootstrap 3.3.5 -->
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Morris charts -->
  <link rel="stylesheet" href="../../plugins/morris/morris.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">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

 <header class="main-header">
        <!-- Logo -->
        <a href="Dashboard.PHP" class="logo">
          <!-- mini logo for sidebar mini 50x50 pixels -->
          <span class="logo-mini"><b>A</b>LT</span>
          <!-- logo for regular state and mobile devices -->
          <span class="logo-lg">
          <?php
    	  $query = mysql_query("SELECT pemerintah from contact")or die (mysql_error());
           while ($data = mysql_fetch_array($query)) {
          ?>
          <b><?php echo $data['pemerintah']; ?></b>
          <?php } ?>
          </span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
          <!-- Sidebar toggle button-->
          <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
          </a>
          <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
              <!-- Messages: style can be found in dropdown.less-->
              
              <li class="dropdown user user-menu">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <!--   <img src="" class="user-image" alt="User Image"> -->
                  <span class="hidden-xs"><?php echo $_SESSION['username'];?></span>
                </a>
                <ul class="dropdown-menu">
                  <!-- User image -->
                  <li class="user-header">
                    <img src="images/Admin/<?php echo $hasil['image']; ?>" class="img-circle" alt="User Image">
                    <p>
                      <?php echo $_SESSION['username'];?>
                    </p>
                  </li>
                  <!-- Menu Body -->
                  <li class="user-body">
                    <div class="col-xs-4 text-center">
                      <a href="#">------</a>
                    </div>
                    <div class="col-xs-4 text-center">
                      <a href="#">------</a>
                    </div>
                    <div class="col-xs-4 text-center">
                      <a href="#">-----</a>
                    </div>
                  </li>
                  <!-- Menu Footer-->
                  <li class="user-footer">
                    <div class="pull-left">
                      <a href="Dashboard.php" class="btn btn-default btn-flat">Profile</a>
                    </div>
                    <div class="pull-right">
                      <a href="logout.php" class="btn btn-default btn-flat">Sign out</a>
                    </div>
                  </li>
                </ul>
              </li>
              <!-- Control Sidebar Toggle Button -->
              <li>
                <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
              </li>
            </ul>
          </div>
        </nav>
      </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
          <!-- Sidebar user panel -->
            <?php
    	       $query = mysql_query("SELECT * from contact")or die (mysql_error());
                while ($data = mysql_fetch_array($query)) {
            ?>
          <div class="user-panel">
            <div class="text-center">
              <img src="images/Kontak/<?php echo $data['image']; ?>" class="img-thumbnail" alt="" width="150"><!-- foto admin -->
            </div>
          </div>
          <?php } ?>
        <hr>
          <!-- sidebar menu: : style can be found in sidebar.less -->
          <ul class="sidebar-menu">
            <li class="header">MENU</li>
            <li class="active treeview">
              <a href="Dashboard.php">
                <img src="images/load.gif" width="20"> 
                <span> Dashboard</span>
              </a>
            </li>
              
            <li class="treeview">
              <a href="indexadmin.php?p=UksPesertaBaru">
                <img src="images/Icon/profil.png" width="20">
                <span>Registrasi Peserta</span>
              </a>
            </li>
              
            <li class="treeview">
              <a href="indexadmin.php?p=UksPesertaInduk">
                <i class="fa fa-laptop"></i>
                <span>Rekam Medis Peserta</span>
              </a>
            </li>
              
			  <li class="treeview">
              <a href="indexadmin.php?p=UksDataPeserta">
                <img src="images/Icon/bpd.png" width="20">
                <span>Data Peserta</span>
              </a>
            </li>
			
            <li class="treeview">
              <a href="#">
                <img src="images/Icon/desa.png" width="20"> <span>Administrasi </span>
                <i class="fa fa-angle-left pull-right"></i>
              </a>
              <ul class="treeview-menu">
              	<li>
                  <a href="indexadmin.php?p=UksPengaturan"><img src="images/Icon/perangkat.png" width="15">  Pengaturan</a>
                </li>
                <li>
                  <a href="indexadmin.php?p=UksDataObat"><img src="images/Icon/db_add.png" width="15"> Data Obat</a>
                </li>
                <li>
                  <a href="indexadmin.php?p=UksKegiatan"><img src="images/Icon/penduduk.png" width="15"> Kegiatan UKS</a>
                </li>
               
              </ul>
            </li>
              
            
            <hr>  
            
        </ul>
        </section>
        <!-- /.sidebar -->
      </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">

    <!-- Main content -->
    <section class="content-header">
          <h1>
            SELAMAT DATANG <?php echo $_SESSION['username'];?>
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active"><a href="#"> Dashboard</a></li>
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                             <small></small>
                        </h1>
                    </div>
                </div>


                <div class="row">
                    <div class="col-lg-3 col-md-6">
                        <div class="panel panel-error">
                            <div class="panel-heading" style="background:#33FF66;">
                                <div class="row">
                                    <div class="col-xs-3">
                                        <i class="fa fa-user fa-5x"></i>
                                    </div>
                                    <div class="col-xs-9 text-right">
                                        <div class="text-center"><h1>
                                            <?php
                                            include('koneksi.php');
                                            $query=mysql_query("SELECT * FROM penduduk where Keterangan <> 'Mutasi Keluar' ");
                                            $jumlah=mysql_num_rows($query);
                                            echo $jumlah;
                                            ?></h1>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <a href="#">
                                <div class="panel-footer text-center">
                                    <a href="#" class=""><span>PESERTA</span></a>
                                </div>
                            
                            </a>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6">
                        <div class="panel panel-yellow">
                            <div class="panel-heading" style="background:#00FFFF;">
                                <div class="row">
                                    <div class="col-xs-3">
                                        <i class="fa fa-male fa-5x"></i>
                                    </div>
                                    <div class="col-xs-9 text-right">
                                        <div class="text-center">
                                            <h1>
                                            <?php
                                            include('koneksi.php');
                                            $query=mysql_query("SELECT JenKel FROM penduduk WHERE JenKel='Laki-laki' and Keterangan <> 'Mutasi Keluar'");
                                            $jumlah=mysql_num_rows($query);
                                            echo $jumlah;
                                            ?>
                                            </h1>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <a href="#">
                                <div class="panel-footer text-center">
                                    <a href="#" class=""><span>LAKI - LAKI</span></a>
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6">
                        <div class="panel panel-red">
                            <div class="panel-heading" style="background:#FF3333;">
                                <div class="row">
                                    <div class="col-xs-3">
                                        <i class="fa fa-female fa-5x"></i>
                                    </div>
                                    <div class="col-xs-9 text-right">
                                        <div class="text-center">
                                            <h1>
                                            <?php
                                            include('koneksi.php');
                                            $query=mysql_query("SELECT JenKel FROM penduduk WHERE JenKel='Perempuan' and Keterangan <> 'Mutasi Keluar'");
                                            $jumlah=mysql_num_rows($query);
                                            echo $jumlah;
                                            ?>
                                            </h1>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <a href="#">
                                <div class="panel-footer text-center">
                                    <a href="#" class=""><span>PEREMPUAN</span></a>
                                </div>
                            </a>
                        </div>
                    </div>
                </div>
				
				<div class="col-md-12">
					<div class="box">
						<div class="box-header with-border">
								<h3><!--Presentasi Jumlah Penduduk Berdasarkan Pekerjaan--></h3>
							<div class="box-tools pull-right">
								<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
								<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
							</div>
						</div>	
						<div class="box-body" id="">
							<p class="text-center">
								<strong><?php echo date("l - d F Y");?></strong>
							</p>
								<div class="pad">
									<div id="container" ></div>
								</div>
						</div>
				  </div>
				</div>
            
				
            
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

    <footer class="main-footer">
        <div class="pull-right hidden-xs">
          <b>Tanah Air Teknologi Version</b> 1.0
        </div>
        <strong>Copyright &copy; 2016-2017 <a href="#"></a>.</strong> All rights reserved.
    </footer>


  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
        <!-- Create the tabs -->
        <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
          <!-- Home tab content -->
          <div class="tab-pane" id="control-sidebar-home-tab">
            
          </div><!-- /.tab-pane -->
          <!-- Stats tab content -->
          <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div><!-- /.tab-pane -->
          </div>
      </aside><!-- /.control-sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 2.2.0 -->
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="bootstrap/js/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>
<!-- FastClick -->
<script src="plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<script src="Highchart/js/highcharts.js"></script>
<script src="Highchart/js/highcharts-3d.js"></script>
<script src="Highchart/js/modules/exporting.js"></script>
<!-- page script -->

<script type="text/javascript">
$(function () {
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: 'Presentase Jumlah Penduduk Berdasarkan Pekerjaan'
        },
        xAxis: {
            type: 'category',
            labels: {
                rotation: -45,
                style: {
                    fontSize: '13px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }
        },
        yAxis: {
            min: 0,
            title: {
                text: 'Jumlah Penduduk'
            }
        },
        legend: {
            enabled: false
        },
        tooltip: {
            pointFormat: 'Populasi in <?php echo date('d F Y'); ?>'
        },
        series: [{
            name: 'Population',
            data: [
				['Akuntan', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Akuntan' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Anggota BPK', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Anggota BPK' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Anggota DPD', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Anggota DPD' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Anggota DPRD Kabupaten/Kota', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Anggota DPRD Kabupaten/Kota' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Anggota DPRD Propinsi', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Anggota DPRD Propinsi' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Apoteker', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Apoteker' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Belum/Tidak Bekerja', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Belum/Tidak Bekerja' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Biarawati', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Biarawati' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Bidan', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Bidan' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Buruh Harian Lepas', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Buruh Harian Lepas' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Dokter', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Dokter' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Guru', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Guru' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Karyawan Swasta', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Karyawan Swasta' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Mengurus Rumah Tangga', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Mengurus Rumah Tangga' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Pedagang', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Pedagang' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Pegawai Negeri Sipil', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Pegawai Negeri Sipil' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Pelajar/Mahasiswa', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Pelajar/Mahasiswa' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Petani/Pekebun', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Petani/Pekebun' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Peternak', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Peternak' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Sopir', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Sopir' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Wartawan', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Wartawan' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
				['Wiraswasta', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pekerjaan = 'Wiraswasta' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>]
				
            ],
            dataLabels: {
                enabled: true,
                rotation: -90,
                color: '#FFFFFF',
                align: 'right',
                format: '{point.y:.1f}', // one decimal
                y: 10, // 10 pixels down from the top
                style: {
                    fontSize: '13px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }
        }]
    });
});


</script>

<script>
$(function () {
    $('#container1').highcharts({
        chart: {
            type: 'pie',
            options3d: {
                enabled: true,
                alpha: 45,
                beta: 0
            }
        },
        title: {
            text: 'Presentasi Jumlah Penduduk Berdasarkan Pendidikan'
        },
        subtitle: {
            text: '<strong><?php echo date("l - d F Y");?></strong>'
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                depth: 35,
                dataLabels: {
                    enabled: true,
                    format: '{point.name}'
                }
            }
        },
        series: [{
            type: 'pie',
            name: 'Browser share',
            data: [
                ['TIDAK/BELUM SEKOLAH', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'TIDAK/BELUM SEKOLAH' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
                ['BELUM TAMAT SD/SEDERAJAT', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'BELUM TAMAT SD/SEDERAJAT' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
                {
                    name: 'TAMAT SD/SEDERAJAT',
                    y: <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'TAMAT SD/SEDERAJAT' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>,
                    sliced: true,
                    selected: true
                },
                ['SLTP/SEDERAJAT', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'SLTP/SEDERAJAT' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
                ['SLTA/SEDERAJAT', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'SLTA/SEDERAJAT' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
                ['AKADEMI/DIPLOMA III/S.MUDA', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'AKADEMI/DIPLOMA III/S.MUDA' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
                ['DIPLOMA IV/STRATA I', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'DIPLOMA IV/STRATA I' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
                ['STRATA II', <?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'STRATA II' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>],
                ['STRATA III', 0.<?php include('koneksi.php'); $query=mysql_query("SELECT * FROM penduduk WHERE Pendidikan = 'STRATA III' "); $jumlah=mysql_num_rows($query); echo $jumlah;?>]
            ]
        }]
    });
});
</script>

</body>
</html>