<?php
session_start();
if(!isset($_SESSION['media_cms_user']) OR $_SESSION['super_admin'] == 0) {
header("location:login.php");
}
error_reporting(E_ERROR);
include("../include/config.php");
include("../include/connect.php");
include("include/functions.php");
include("include/general.class.php");
include("include/upload.class.php");
include("include/pagination.php");
include("include/nocsrf.php");
$general = new General;
$general->set_connection($mysqli);
$options = $general->get_all_options();
$parts = Explode('/', $_SERVER["PHP_SELF"]);
$currenttab = $parts[count($parts) - 1];
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">	
    <title>MediaCloud | Dashboard</title>
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="assets/css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="assets/css/font-awesome.min.css">
	<link rel="stylesheet" href="assets/css/jasny-bootstrap.min.css">
	<link href="assets/js/plugins/morris/morris.css" rel="stylesheet">
	<link rel="stylesheet" href="assets/css/bootstrap-tagsinput.css">
    <link rel="stylesheet" href="assets/css/style.css">
	
	<script src="assets/js/jquery.min.js"></script>
	<script src="assets/js/jquery-ui.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
	<script src="assets/js/ajax_ops.min.js"></script>
	<script src="assets/js/ajax_ops-modals.min.js"></script>
	<script src="assets/js/jasny-bootstrap.min.js"></script>
	<script src="assets/js/bootstrap-tagsinput.min.js"></script>
	<script src="assets/js/jquery_checkall.js"></script>
	<script src="assets/js/plugins/morris/raphael.min.js"></script>
	<script src="assets/js/plugins/morris/morris.min.js"></script>
	<script src="assets/js/plugins/tinymce/tinymce.min.js"></script>
	<script src="assets/js/plugins/tinymce/tinymce-function.js"></script>

	
	<script src="assets/js/functions.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="./"><span class="fa fa-cloud"></span> <span class="mini-brand">Media</span>Cloud</a>
            </div>

            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li <?php if ($currenttab == 'index.php') { ?>class="active"<?php } ?>><a href="index.php"><span class="fa fa-dashboard"></span> Dashboard</a></li>
					<li class="dropdown">
					  <a href="javascript:void();" class="dropdown-toggle" data-toggle="dropdown"><span class="fa fa-cogs"></span> Setting <b class="caret"></b></a>
					  <ul class="dropdown-menu">
						<li><a href="setting.php?case=general">General Setting</a></li>
						<li><a href="setting.php?case=users">Users Setting</a></li>
						<li><a href="setting.php?case=theme">Theme Setting</a></li>
						<li><a href="setting.php?case=social">Social Setting</a></li>
						<li><a href="setting.php?case=comments">Comments Setting</a></li>
						<li><a href="setting.php?case=apis">Api's Setting</a></li>
						<li><a href="setting.php?case=mail">Mail Setting</a></li>
						<li class="divider"></li>
						<li><a href="setting.php?case=clear_cache">Clear Cache</a></li>
						<li><a href="setting.php?case=optimize_database">Optimize Database</a></li>
						<li><a href="setting.php?case=bulk_remove">Bulk Remove</a></li>
					  </ul>
					</li>
                     <li <?php if ($currenttab == 'ads.php') { ?>class="active"<?php } ?>><a href="ads.php"><span class="fa fa-picture-o"></span> Ads</a></li>
                     <li <?php if ($currenttab == 'ga_code.php') { ?>class="active"<?php } ?>><a href="ga_code.php"><span class="fa fa-bar-chart"></span> Google Analyics Code</a></li>
				</ul>
				<ul class="nav navbar-nav navbar-right">
					<li <?php if ($currenttab == 'admin_info.php') { ?>class="active"<?php } ?>><a href="admin_info.php"><span class="fa fa-lock"></span> Admin Info</a></li>
					<li><a href="../" target="_NEW"><span class="fa fa-desktop"></span> Front-End</a></li>
					<li><a href="javascript:ConfirmLogOut();"><span class="fa fa-power-off"></span> Logout</a></li>
                </ul>
            </div><!--.nav-collapse -->
        </div>
    </nav>
<div class="container-fluid">
<div class="row">
<div class="col-md-2">
<div class="list-group">
  <a href="index.php" class="list-group-item <?php if ($currenttab == 'index.php') {echo 'active';} ?>"><span class="fa fa-dashboard"></span>Dashboard</a>
  <a href="categories.php" class="list-group-item <?php if ($currenttab == 'categories.php') {echo 'active';} ?>"><span class="fa fa-folder"></span>Categories</a>
  <a href="channels.php" class="list-group-item <?php if ($currenttab == 'channels.php') {echo 'active';} ?>"><span class="fa fa-th-large"></span>Channels</a>
  <a href="media.php" class="list-group-item <?php if ($currenttab == 'media.php') {echo 'active';} ?>"><span class="fa fa-youtube-play"></span>Media</a>
  <a href="facebook.php" class="list-group-item <?php if ($currenttab == 'facebook.php') {echo 'active';} ?>"><span class="fa fa-facebook-square"></span>Facebook Videos</a>
  <a href="users.php" class="list-group-item <?php if ($currenttab == 'users.php') {echo 'active';} ?>"><span class="fa fa-user"></span>Users</a>
  <a href="lists.php" class="list-group-item <?php if ($currenttab == 'lists.php') {echo 'active';} ?>"><span class="fa fa-list"></span>Lists</a>
  <a href="pages.php" class="list-group-item <?php if ($currenttab == 'pages.php') {echo 'active';} ?>"><span class="fa fa-file"></span>Pages</a>
  <a href="sitemaps.php" class="list-group-item <?php if ($currenttab == 'sitemaps.php') {echo 'active';} ?>"><span class="fa fa-sitemap"></span>Sitemaps</a>
</div>
</div>
<div class="col-md-10">
<?php
if (!isset($options['api_youtube_apikey']) OR empty($options['api_youtube_apikey'])) {
echo notification('warning','<i class="fa fa-key"></i> You Have to Set Your <a href="setting.php?case=apis" class="alert-link">YouTube API Key</a> in Order to Import or Allow to Users Import Media From YouTube.');
}

if (!isset($options['api_recaptcha_public']) OR empty($options['api_recaptcha_public'])) {
echo notification('warning','<i class="fa fa-key"></i> You Have to Set Your <a href="setting.php?case=apis" class="alert-link">Recaptcha Public & Private Keys</a> in Order to Import or Allow to Visitors to Register.');
}

if ($general->awaiting_review_media_number() > 0) {
echo notification('warning','<i class="fa fa-youtube-play"></i> There are <b>'.$general->awaiting_review_media_number().' Media Items</b> awaiting your review. <a href="media.php?case=awaiting_review" class="alert-link">Review Media Items</a>.');
}
