<?php include("_config/dbconfig.php");
include("_includes/head.php");?>
<title>User Session Logs</title>
<style>
.lisitng_table tr td:first-child, .lisitng_table tr th:first-child{
        //width: 30px !important;
}

.boxscroll {
	height: 500px;
	border: 0px solid #000;
	overflow: auto;
    }
</style>
<?php include("_includes/header.php"); 

if(isset($_SESSION['user_session'])){
$agent_id = $_SESSION['user_session'];
}else {
$agent_id = 0;	
}
            
$tasks_all = $obj_jobs_class->getLogs();
       
?>
<div class="col-sm-12 right_form">
        <div class="title">
            <div class="row">
                <div class="col-md-10 col-sm-12">
                    <h1>User Session Logs</h1>
                </div>
            </div>
        </div>
    
    <div class="col-sm-12">
      <ol class="breadcrumb white">
        <li><a href="dashboard.php">Dashboard</a></li> 
        <li class="active">User Session Logs</li>   
    </ol>
    </div>
      
    
</div> 

<?php 
/*        echo "<pre>";
        print_r($_SESSION);
        echo '</pre>';
   */     
?>
  	<div class="col-sm-8 form_inner">
			<div class="col-md-12 table_inner" style="padding:0;">
                <div class="table-responsive boxscroll" style="min-height: 300px;">
                    <table id="  " class="display nowrap lisitng_table table table-bordered " cellspacing="0" width="100%">
                        <thead>
                            <tr>
                            	<th>Sr. </th>
                                <th width="10%">Username </th>
                                <th>Login Date</th>
                                <th>Logout Date</th>
                        </thead>
                        <tbody>
                        <?php $i=1; foreach($tasks_all as $task){  ?>    
                                <tr>
                                <td><?php echo $i++;?></td>
                                <td>   <?php echo $task['name']?> </td>
                                <td><?php echo $task['date'];?></td>
                                <td><?php echo $task['logout_date'];?></td>
                                </tr>
                        <?php  } ?> 
                        </tbody>
                    </table>
                </div>
            </div>
		</div>
 


<?php include("_includes/footer.php"); ?>
<script>
$(document).ready(function() {
    
      $("#start_date1").datepicker({
            dateFormat: 'yy-mm-dd',
            numberOfMonths: 1,
            onSelect: function(selected) {
              $("#end_date1").datepicker("option","minDate", selected)
            }
        });
        $("#end_date1").datepicker({
            dateFormat: 'yy-mm-dd',
            numberOfMonths: 1,
            onSelect: function(selected) {
               // $("#start_date1").datepicker("option","maxDate", selected)
            }
        });   
        
        
    
    $('.dropdown-toggle').dropdown()
    
    
    $('#example').DataTable( {
        responsive: {
            details: {
                type: 'column',
                target: -1
            }
        },
        columnDefs: [ {
            className: 'control',
            orderable: false,
            targets:   -1
        }]
    });
});




    function goEvent(){
        vv = $("#exi_id").val();
        if(vv!=''){
            window.location = 'event_tasks.php?event='+vv+'&1=1';        
        }else{
            window.location = 'event_tasks.php';        
        }
    } 
    
    
</script>