<?php
	// start session
	session_start();
	
	// set time for session timeout
	$currentTime = time() + 25200;
	$expired = 3600;
	
	// if session not set go to login page
	if(!isset($_SESSION['user'])){
		header("location:index.php");
	}
	
	// if current time is more than session timeout back to login page
	if($currentTime > $_SESSION['timeout']){
		session_destroy();
		header("location:index.php");
	}
	
	// destroy previous session timeout and create new one
	unset($_SESSION['timeout']);
	$_SESSION['timeout'] = $currentTime + $expired;
	
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
        <head>
    	<?php include('header.php'); ?>

    </head>
 <body class="skin-black">
<?php include("mainheader.php"); ?>
    	<div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Left side column. contains the logo and sidebar -->
        
    	    		<?php //include('public/menubar.php'); ?>
    	    		          <!--  <aside class="right-side"> -->
    	    		            	    		<?php include('public/std_table.php'); ?>

<!-- </aside> -->
 </div><!-- ./wrapper -->
    	<?php include('footerjs.php'); ?>

       </body>
       
<script>
//$(document).ready(function() {

//$('#action1').change(function() {
	$(document).ready(function() {
		$('#action1').on('ifChecked', function(event){
    $.ajax({
        type: "GET",
        url: "setotp.php?otp=1",
        async: true,
        data: {
        },
        success: function (msg) {
           location.reload();

        }
    });

});
$('#action1').on('ifUnchecked', function(event){
   $.ajax({
        type: "GET",
        url: "setotp.php?otp=0",
        async: true,
        data: {
        },
        success: function (msg) {
            location.reload();

        }
    });

});
});

</script>
</html>