<?php
if($this->session->userdata('admin_level') ==1) {
	$level ='Administrator';
}elseif($this->session->userdata('admin_level') ==2) {
	$level ='Anda Login Sebagai Ketua SAPM';
}elseif($this->session->userdata('admin_level') ==3) {
	$level ='Anda Login Sebagai Sekretaris SAPM';
}elseif($this->session->userdata('admin_level') ==4) {
	$level ='Anda Login Sebagai Penanggungjawab SAPM';
}elseif($this->session->userdata('admin_level') ==5) {
	$level ='Anda Login Sebagai Tim Assesor SAPM Satker';
}elseif($this->session->userdata('admin_level') ==6) {
	$level ='Anda Login Sebagai Staf Penanggungjawab SAPM';
}elseif($this->session->userdata('admin_level') ==7) {
	$level ='Tamu / Tim Luar';
}else {
	$level ='Anda Login Sebagai Hackers';
}
?>
<?php echo $this->session->flashdata("k");
$record_instansis	= $this->db->query("SELECT * FROM identitas LIMIT 1")->row();
$namasatker_ = $record_instansis->nama_satker;
$record_poin	= $this->db->query("select SUM(nilai) AS jumlah FROM tb_arsip_sapm")->row();
$record_jumlah	= $this->db->query("select COUNT(nilai) AS jumlah_record FROM tb_arsip_sapm")->row();
$jumlah_poin = $record_poin->jumlah;
$jumlah_dokumen = $record_jumlah->jumlah_record;
if (empty($jumlah_poin)){
	$persen = 0;
}else{ $persen = ($jumlah_poin / $jumlah_dokumen) * 10; }
if($persen >=80){
	$warna ='btn btn-info';
}else if ($persen < 50){
	$warna ='btn btn-danger';
}else { $warna ='btn btn-warning';}

$defFoto= "asset/pas_photo/users.gif";
//$filename = $this->session->userdata('pengguna_id');
$filename = $this->session->userdata('nip');
$namasatker	= gval_sn("identitas", "nama_satker");
?>
<div class="row">
<?php echo "<img src='" . base_url() . 'photo_pegawai/'. $this->session->userdata('photo'). "' style='display: inline; float: left; margin-right: 20px; width: 100px; height: 100px'>";?>
          <div class="" style="padding: 15px 15px 0 15px;">
			<div class="well well-sm">
			<div class="panel-heading alert alert-info">Total Nilai :<b> <?php echo $jumlah_poin.' Poin dari '.$jumlah_dokumen.' Dokumen '; ?>&nbsp</b><font><button type="submit" class="<?php echo $warna;?>"><i class="icon-eye-open icon-white "> </i><?php echo '[ '.$persen.' % ]'.' '.$namasatker; ?></button> </font>
					 <button type="button" class="close pull-right" data-dismiss="alert">
						<span aria-hidden="true">&times;</span>
					</button>
				</div>
			<div class="container">
				Selamat datang <strong>
				<?php 
				
				 
					echo $this->session->userdata('admin_nama')." - ".$level ;
					//echo download_foto(198207052009121002);
					// echo '<br>'.$defFoto;
				
					echo "<br>&nbsp".$record_instansi['sambutan']; 
			
				?></strong>
				
			</div>			
		</div>
   </div>
  </div>
<div class="navbar navbar-inverse">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand" href="<?php echo base_URL(); ?>mahasiswa/list_data">Statistik Pengunjung</a>
			</div>
		<div class="navbar-collapse collapse navbar-inverse-collapse" style="margin-right: -20px">
		
			<ul class="nav navbar-nav">
				<li><a href="<?php echo base_URL(); ?>#" class="btn-info"><i class="icon-user icon-white"> </i> Pengunjung Hari ini :<?php echo $hari_ini;?></a></li>
			</ul>
			<ul class="nav navbar-nav">
				<li><a href="<?php echo base_URL(); ?>#" class="btn-info"><i class="icon-lock icon-white"> </i> Total Pengunjung : :<?php echo $total;?></a></li>
			</ul>
			<ul class="nav navbar-nav">
				<li><a href="<?php echo base_URL(); ?>#" class="btn-info"><i class="icon-globe icon-white"> </i> Pengunjung Online : : :<?php echo $online;?></a></li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<form class="navbar-form navbar-left" method="post" action="<?php echo base_URL(); ?>#">
					
					<button type="submit" class="btn btn-danger"><i class="icon-search icon-white"> </i> <?php echo $hostname;?></button>
				</form>
			</ul>
		</div><!-- /.nav-collapse -->
		</div><!-- /.container -->
	</div><!-- /.navbar -->
		
   
		
