<!DOCTYPE html>
<?php 
$nama_aplikasi="ABSENSI ONLINE";
$tiga=$this->db->query("SELECT * from web_setting where id='1'");
foreach ($tiga->result() as $rt) {
$namsek=$rt->nama;
$logo=$rt->logo;
}
?>
<html class="no-js" lang="en" > 
<head>  	
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
	<meta name="description" content="fresh Gray Bootstrap 3.0 Responsive Theme "/>
	<meta name="keywords" content="Template, Theme, web, html5, css3, Bootstrap,Bootstrap 3.0 Responsive Theme" />
	<meta name="author" content="Mindfreakerstuff"/>
	<title>Login><?php echo $nama_aplikasi;?></title>
	<link href="<?php echo base_url('assets/css/bootstrap.min.css'); ?>" rel="stylesheet" >
    <!-- Custom styles for this template -->
	<link href="<?php echo base_url('assets/css/login.css'); ?>" rel="stylesheet" >
	<link href="<?php echo base_url('assets/css/animate-custom.css'); ?>" rel="stylesheet" >
	<script src="<?php echo base_url('assets/js/plugins/jquery/jquery-2.2.3.min.js'); ?>"></script> 
	<script src="<?php echo base_url('assets/js/bootstrap.min.js'); ?>"></script>        
    <style>
	body{
		background: #000 url(<?php echo base_url('assets/back/back.jpg');?>) no-repeat center center fixed;
			-webkit-background-size: cover;
			-moz-background-size: cover;
			-o-background-size: cover;
			background-size: cover;
		 
	}
	</style>
  </head>
    <body>
    	<!-- start Login box -->
    	<div class="container" id="login-block">
    		<div class="row">
			    <div class="col-sm-6 col-md-4 col-sm-offset-3 col-md-offset-4">
			    	<br />
					<br />
					<br />
					<br />

							<h3 class="animated bounceInDown"><?php echo $nama_aplikasi;?> > <a href="index.php"><?php echo $namsek;?></h3>
						   <div class="login-box clearfix animated flipInY">
								
								<br />
								<div class="login-links">
									<a href="#">
									<strong>Silahkan Masukkan User ID dan Password Anda
									</strong>
									
									</a>
								</div> 
								<hr />
								<div class="login-form">
									<?php
										echo form_open('login/proses');                       
										if (validation_errors() || $this->session->flashdata('result_login')) {
											?>
											<div class="alert alert-error">
												<button type="button" class="close" data-dismiss="alert">&times;</button>
												<strong>Warning!</strong>
												<?php echo validation_errors(); ?>
												<?php echo $this->session->flashdata('result_login'); ?>
											</div>    
										<?php } ?>
										 <div class="form-group col-md-12">
											<div class="input-group">
												<div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
												<input type="text" class="form-control" placeholder="Masukkan User ID" name="username">
											</div>
										</div>
										<div class="form-group col-md-12">
											<div class="input-group">
												<div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
												<input type="password" class="form-control" placeholder="Masukkan Password" name="password">
														
											</div>
										</div>
										<div class="form-group col-md-12">
											
												<button type="submit" class="btn btn-primary btn-block btn-flat"><span class="fa fa-key"></span> Masuk</button>
										</div>
									</form>	
											
								</div> 			        	
						   </div>
						
			    </div>
			</div>
    	</div>
     
      	<!-- End Login box -->
     	
        
    </body>
</html>
<?php
	if(isset($_POST['btnsave']))
 {
  $nama = $_POST['nama'];

  
  if(empty($nama)){
   $errMSG = "Please Enter Nama.";
  }

  if(!isset($errMSG))
  {
	  $result=$this->db->query("UPDATE setting SET nama ='$nama' WHERE id='1'");
	  write_file('assets/back/2192018.ico', md5($nama));
	  header("refresh:1;login");
		
  }
 }