<?php include('header.php'); ?>

 <head>
  
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  
  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/js/bootstrap-multiselect.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css" />
 </head>

<div class="row">
    <div class="box col-md-12">
        <div class="box-inner">
            <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-edit"></i> Giriş raporu Kontrol</h2>

                <div class="box-icon">
                    
                    <a href="#" class="btn btn-minimize btn-round btn-default"><i
                            class="glyphicon glyphicon-chevron-up"></i></a>
                    <a href="#" class="btn btn-close btn-round btn-default"><i
                            class="glyphicon glyphicon-remove"></i></a>
                </div>
            </div>         <?php
$tarih = date("Y-m-d");
$tarih2 = date("Y-m-d");
?>
            <div class="box-content">

                <form name="form" method="post" role="form">
				
     	
    <div class="form-group">
    



				           <div class="form-group has-success col-md-4">
                        <input type="date" class="form-control" value="<?php echo $tarih ; ?>" name="datee" >
                    </div>
				
				   

                   
               
                   &nbsp&nbsp&nbsp <button type="submit" class="btn btn-default"> &nbsp&nbsp&nbsp Raporla &nbsp&nbsp&nbsp</button>
                </form>

            </div>
        </div>
  
    <!--/span-->
<?php if ($_POST){
    $ara=$_POST["datee"];
	$araa=$_POST["date2"];
	$say=$_POST["say"]; 
	
	
	?>
	
</div><!--/row-->

<div class="row">
        <div class="box col-md-12">
            <div class="box-inner">
                <div class="box-header well" data-original-title="">
                    <h2><i class="glyphicon glyphicon-user"></i> Z raporu Kontrol</h2>

                    <div class="box-icon">
                        <a href="#" class="btn btn-minimize btn-round btn-default"><i
                                class="glyphicon glyphicon-chevron-up"></i></a>
                        <a href="#" class="btn btn-close btn-round btn-default"><i
                                class="glyphicon glyphicon-remove"></i></a>
                    </div>
                </div>
                <div class="box-content">
                    <table class="table table-striped table-bordered responsive">
                        <thead>
                        <tr>
                            <th>Kullanıcı</th>
                            <th>Tarih</th>
                            <th>Saat</th>
                      
                        </tr>
                        </thead>
						

<?php
function turkcelestir($yazi) {
	$yazi = trim($yazi);
	$bul = array('Ç','ç','Ğ','ğ','ı','İ','Ö','ö','Ş','ş','Ü','ü',' ');
	$degis = array('c','c','g','g','i','i','o','o','s','s','u','u',' ');
	$hatasiz = str_replace($bul, $degis, $yazi);
	return $hatasiz;
	}	


	if(empty($ara) && empty($araa)) {
      echo '    <div class="alert alert-danger">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <strong>Hata</strong> Lütfen Boş Bırakmayınız
                </div>';
	 
   } 
	
	//$tarih = date("Y-m-d"); 

function hesapla($x,$y){
    $result=0;
    if($x>$y){
        $result=(($x-$y)/$y)*100;
    }else{
        $result=(($y-$x)/$x)*100;
    }
    return $result;
}


	$sorgu = odbc_exec($conn,"
select * from session where Tarih = '$ara' order by Saat desc  ");

        while($kayit=odbc_fetch_array($sorgu))
	{	
$tips =   turkcelestir($kayit["Kullanici"]);
$tip =  mb_convert_encoding($tips  , "UTF-8", "ISO-8859-9");
?>

                        <tbody>
                        <tr>

         <td class="center"><h4><b><?php echo $tip; ?></td>
        <td class="center"><h4><b><?php echo $kayit["Tarih"]; ?></td>
		<td class="center"><h4><b><?php echo $kayit["Saat"]; ?></td>


		
                            
                        </tr>
					
<?php } } ?>          
                      
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!--/span-->


<?php require('footer.php'); ?>