<?php 
session_start();
ob_start();
if(isset($_SESSION['post']) && !empty( $_SESSION['post']) && isset($_SESSION['name']) && !empty( $_SESSION['name']) && isset($_SESSION['userid']) && !empty($_SESSION['userid']))
{
$userid=$_SESSION['userid'];
include "../config/database.php";
$conct  = new connectionCreat();
$conct->connectToDB();
$conct->selectDB();
include "../config/function.php";
$take_action1   = new actionDo(); 
?>  
<!DOCTYPE html>
<html lang="en">
<head>
<?php include('common/head.php'); ?>
</head>
<body>
 <?php include('common/header.php'); ?>
<div class="menu">      
<div class="admin">
<div class="image">
        <?php
		$sql=mysql_query("SELECT * FROM `tbl_admin` WHERE id='$userid'");
		$rows=mysql_fetch_array($sql);
	    ?>
               
</div>
<ul class="control">                
                <li><span class="icon-cog"></span> <a href="home.php?page=my_profile">My Profile</a></li>
                <li><span class="icon-share-alt"></span> <a href="home.php?page=logout">Logout</a></li>
            </ul>
            <div class="info">
                <span>Welcom back! Your last visit: <?php echo date("d-m-Y",strtotime($rows['last_visit'])); ?> </span>
            </div>
        </div>
        <?php include('common/side_menu.php'); ?>
       
    </div>
    <div class="content">
        <div class="workplace">
         <div class="row-fluid">
                <?php include('pages/include.php'); ?>
            </div>
            <div class="dr"><span></span></div>
        </div>
    </div>   
</body>
</html>
<link rel="stylesheet" type="text/css" href="date/jquery.datetimepicker.css"/>
<script type='text/javascript' src='date/jquery.datetimepicker.full.js'></script>
<script>
$('.from_date').datetimepicker({ timepicker:false, format:'d-m-Y', minDate: new Date('2017/10/01'),maxDate: new Date("2017/12/31"), scrollInput:false});
$('.to_date').datetimepicker({ timepicker:false, format:'d-m-Y', minDate: new Date('2017/10/01'),maxDate: new Date("2017/12/31"), scrollInput:false});
$('.datetimepicker2').datetimepicker({ timepicker:false, format:'d-m-Y', scrollInput:false});
</script>
<script type="text/javascript">
function logout() {
 var xmlhttp=new XMLHttpRequest();
 xmlhttp.open("GET", "home.php?page=logout", true);
 xmlhttp.send();
}
</script>
<?php }else { header('location:index.php'); } ?>