<?php

session_start();
require_once("../../_config/connect.php");
$userlog=$_SESSION['login'];
$user_id=$_SESSION["user_id"];
$type=$_SESSION["type"];
if($page=="logout"){
  session_destroy();
  ?>
  <script type="text/javascript">
        window.location.href="../";
    </script>
    <?php   
}else if($userlog!="OK"){
  ?>
  <script type="text/javascript">
        window.location.href="../index.php";
    </script>
    <?php
}?>
<!doctype html>
<html lang="en"><head>
    <meta charset="utf-8">
    <title>Welcome to <?php echo $_SESSION['name'];?></title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="../lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../lib/font-awesome/css/font-awesome.css">
    <link href="../lib/bootstrap/css/dataTables.bootstrap.css" rel="stylesheet">
    <link href="../lib/bootstrap/css/datepicker.min.css" rel="stylesheet">
    
	<script src="../lib/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="../lib/jQuery-Knob/js/jquery.knob.js" type="text/javascript"></script>
    <script src="../lib/bootstrap/js/ck/ckeditor.js"></script>
    <link rel="stylesheet" type="text/css" href="../stylesheets/theme.css">
    
    <link href="css/uploadifive.css" rel="stylesheet">
	<script src="js/jquery.uploadifive.min.js"></script>

</head>
<body class=" theme-blue">
    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .navbar-default .navbar-brand, .navbar-default .navbar-brand:hover { 
            color: #fff;
        }
    </style>

    <script type="text/javascript">
        $(function() {
            var uls = $('.sidebar-nav > ul > *').clone();
            uls.addClass('visible-xs');
            $('#main-menu').append(uls.clone());
        });
    </script>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../../assets/ico/apple-touch-icon-57-precomposed.png">
  

    <div class="navbar navbar-default" role="navigation">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">MENU</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a href="index.php"><span class="navbar-brand">EURO ASIA CAMBODIA</span></a>
        </div>

        <div class="navbar-collapse collapse" style="height: 1px;">
          <ul id="main-menu" class="nav navbar-nav navbar-right">
            <li><a><i class="fa fa-clock-o fa-fw"></i>&nbsp;<?php echo date("d / F / Y" ,time()); ?></a></li>
            <li class="dropdown hidden-xs">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <span class="glyphicon glyphicon-user padding-right-small" style="position:relative;top: 3px;"></span> <?php echo $_SESSION['name'];?>
                    <i class="fa fa-caret-down"></i>
                </a>

              <ul class="dropdown-menu">
                <li class="divider"></li>
                <li><a tabindex="-1" href="?page=logout">Logout</a></li>
              </ul>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <?php include('include/nav_left.php'); ?>

    <div class="content">
        <?php
          if($page=='') 
            include('include/category/category.php');
			
          // user --------------------------------------
		  else if($page=='user')
            include('include/user/user.php');
		  else if($page=='addnewuser')
            include('include/user/addnewuser.php');
		  else if($page=='edituser')
            include('include/user/edit_user.php');
		  else if($page=="resetpassword")
			include('include/user/reset_password.php');
		  
		  // category ------------------------------------ 
 			else if($page=='category')
				include('include/category/category.php');
			else if($page=='addnewcategory')
				include('include/category/addnew_category.php');
			else if($page=='editcategory')
				include('include/category/edit_category.php'); 
		// product -----------------------------------------------
			else if($page=='product')
				include('include/product/product.php');
			
			else if($page=='addnewphone')
				include('include/product/addnew_phone.php');
			else if($page=='editphone')
				include('include/product/edit_phone.php');	
				
			else if($page=='addnewsparephone')
				include('include/product/addnew_sparephone.php');
			else if($page=='editsparephone')
				include('include/product/edit_sparephone.php');
					
			else if($page=='addnewaccessory')
				include('include/product/addnew_accessory.php');
			else if($page=='editaccessory')
				include('include/product/edit_accessory.php');
					
			else if($page=='addnewcamera')
				include('include/product/addnew_camera.php');
			else if($page=='editcamera')
				include('include/product/edit_camera.php');
				
			else if ($page=='addgallery')
				include('include/gallery/add_gallery.php');
				
		    // Banner --------------------------------------------------
			else if($page=='addbanner')
				include('include/banner/addnew_banner.php');
			else if($page=='editbanner')
				include('include/banner/edit_banner.php');     
			// Ads --------------------------------------------------
			else if($page=='addads')
				include('include/ads/addnew_ads.php');
			else if($page=='editads')
				include('include/ads/edit_ads.php');
				
			// Ads --------------------------------------------------
			else if($page=='addservices')
				include('include/services/addnew_services.php');
			else if($page=='editservices')
				include('include/services/edit_services.php');           
        ?>

    </div>
    <script src="../lib/bootstrap/js/bootstrap.js"></script>
    <script src="../lib/bootstrap/js/jquery.dataTables.js"></script>
    <script src="../lib/bootstrap/js/dataTables.bootstrap.js"></script>
    <script src="../lib/bootstrap/js/bootstrap-datepicker.js"></script>
    <script>
        $(document).ready(function() {
            $('#dataTables-example').dataTable();

        });
    </script>
   
 
</body></html>
