Файл: Source/admin/common.php
Строк: 218
<?php
/*
* Script name: Points4Prize
* Author: Soft Projects
* Date created: 15/07/2015
*/
// Turn off error reporting
error_reporting(0);
ini_set('error_reporting', E_ALL);
session_start();
$cofig_file = include("../auth/config.php");
include("../site_settings.php");
$DB_CONNECT = mysql_connect($cofig_file['db']['host'], $cofig_file['db']['username'], $cofig_file['db']['password']);
mysql_select_db($cofig_file['db']['dbname'], $DB_CONNECT) or die(mysql_error());
mysql_query("SET NAMES utf8");
if (isset($_SESSION['logged']) == FALSE) {
die("
<script type='text/javascript'>
window.location = 'index.php'</script>
");
}
function head() {
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>
<?php echo $GLOBALS['site_name'];?> - Admin panel
</title>
<!-- BOOTSTRAP -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<!-- LANCENG CSS -->
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/style-responsive.css" rel="stylesheet">
<!-- VENDOR -->
<link href="assets/css/animate.css" rel="stylesheet">
<link href="assets/third/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="assets/third/weather-icon/css/weather-icons.min.css" rel="stylesheet">
<link href="assets/third/morris/morris.css" rel="stylesheet">
<link href="assets/third/nifty-modal/css/component.css" rel="stylesheet">
<link href="assets/third/sortable/sortable-theme-bootstrap.css" rel="stylesheet">
<link href="assets/third/icheck/skins/minimal/grey.css" rel="stylesheet">
<link href="assets/third/select/bootstrap-select.min.css" rel="stylesheet">
<link href="assets/third/summernote/summernote.css" rel="stylesheet">
<link href="assets/third/magnific-popup/magnific-popup.css" rel="stylesheet">
<link href="assets/third/datepicker/css/datepicker.css" rel="stylesheet">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<style>
.admin-logo{
font-size:26px;
color:#121515;
padding:2px;
background: #8B91A0;
border-radius: 4px;
}
</style>
</head>
<!-- BODY -->
<body class="tooltips">
<!-- BEGIN PAGE -->
<div class="container">
<!-- Your logo goes here -->
<div class="logo-brand header sidebar rows">
<div class="logo">
<h1>
<a href="index.php">
<?php echo $GLOBALS['site_name'];?> - Admin
</a>
</h1>
</div>
</div><!-- End div .header .sidebar .rows -->
<!-- BEGIN SIDEBAR -->
<div class="left side-menu">
<div class="body rows scroll-y">
<!-- Scrolling sidebar -->
<div class="sidebar-inner slimscroller">
<?php
$id = (int) $_SESSION['userinfo']['id'];
$use = mysql_query("SELECT * FROM `admin` WHERE id='$id'");
$user = mysql_fetch_array($use);
?>
<!-- User Session -->
<div class="media">
<a class="pull-left" href="#fakelink">
<img class="media-object img-circle" src="<?php echo $user['avatar']; ?>" alt="Avatar">
</a>
<div class="media-body">
Welcome back,
<h4 class="media-heading"><strong><?php echo $user['name']; ?></strong></h4>
<a class="md-trigger" href="logout.php" data-modal="logout-modal-alt">Logout</a>
</div><!-- End div .media-body -->
</div><!-- End div .media -->
<!-- Search form -->
<div id="search">
<form role="search" action="search.php" method="GET">
<input type="text" name="keywords" class="form-control search" placeholder="Search user...">
<i class="fa fa-search"></i>
</form>
</div><!-- End div #search -->
<!-- Sidebar menu -->
<div id="sidebar-menu">
<ul>
<?php
$active = 'class="selected"';
$page = basename($_SERVER["SCRIPT_FILENAME"], '.php');
?>
<li <?php
if ($page === "dashboard") {
echo $active;
}
?> ><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li>
<li <?php
if ($page === "users") {
echo $active;
}
?>><a href="users.php"><i class="fa fa-users"></i>Users</a></li>
<li <?php
if ($page === "prizes") {
echo $active;
}
?> ><a href="prizes.php"><i class="fa fa-gift"></i> Prizes</a></li>
<li <?php
if ($page === "requested_prizes") {
echo $active;
}
?> ><a href="requested_prizes.php"><i class="fa fa-paper-plane"></i>Requested prizes</a></li>
<li <?php
if ($page === "faq") {
echo $active;
}
?> ><a href="faq.php"><i class="fa fa-question-circle"></i> FAQ</a></li>
<li <?php
if ($page === "pages") {
echo $active;
}
?> ><a href="pages.php"><i class="fa fa-file-text"></i> Pages</a></li>
<li <?php
if ($page === "ads") {
echo $active;
}
?> ><a href="ads.php"><i class="fa fa-bullhorn"></i> Ads</a></li>
<li <?php
if ($page === "social_login") {
echo $active;
}
?> ><a href="social_login.php"><i class="fa fa-facebook"></i> Social login</a></li>
<li <?php
if ($page === "error_log") {
echo $active;
}
?> ><a href="error_log.php"><i class="fa fa-times"></i> Error Log</a></li>
<li <?php
if ($page === "settings") {
echo $active;
}
?> ><a href="settings.php"><i class="fa fa-cog"></i> Settings</a></li>
</ul>
<div class="clear"></div>
</div><!-- End div #sidebar-menu -->
</div><!-- End div .sidebar-inner .slimscroller -->
</div><!-- End div .body .rows .scroll-y -->
</div>
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="right content-page">
<!-- BEGIN CONTENT HEADER -->
<div class="header content rows-content-header">
<!-- Button mobile view to collapse sidebar menu -->
<button class="button-menu-mobile show-sidebar">
<i class="fa fa-bars"></i>
</button>
<!-- BEGIN NAVBAR CONTENT-->
<div class="navbar navbar-default" role="navigation">
<div class="container">
<!-- Navbar header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<i class="fa fa-angle-double-down"></i>
</button>
</div><!-- End div .navbar-header -->
<!-- Navbar collapse -->
<div class="navbar-collapse collapse">
<!-- Right navbar -->
<ul class="nav navbar-nav navbar-right top-navbar">
<li><a target="_new" href="/">View site</a></li>
<!-- Dropdown User session -->
<li class="dropdown">
<a href="#fakelink" class="dropdown-toggle" data-toggle="dropdown">Howdy, <strong><?php echo $user['name']; ?></strong> <i class="fa fa-chevron-down i-xs"></i></a>
<ul class="dropdown-menu animated half flipInX">
<li><a href="admin.php">My Profile</a></li>
<li><a href="logout.php" class="md-trigger" data-modal="logout-modal">Logout</a></li>
</ul>
</li>
<!-- End Dropdown User session -->
</ul>
</div><!-- End div .navbar-collapse -->
</div><!-- End div .container -->
</div>
<!-- END NAVBAR CONTENT-->
</div>
<!-- END CONTENT HEADER -->
<?php
}
function footer() {
?>
<!-- Footer -->
<footer>
<?php echo date("Y"); ?> © <?php echo $GLOBALS['site_name'];?> | All right reserved.
</footer>
<!-- End Footer -->
<!-- END PAGE -->
<!--
================================================
JAVASCRIPT
================================================
-->
<!-- Basic Javascripts (Jquery and bootstrap) -->
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- VENDOR -->
<!-- Slimscroll js -->
<script src="assets/third/slimscroll/jquery.slimscroll.min.js"></script>
<!-- Morris js -->
<script src="../../../../cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="assets/third/morris/morris.js"></script>
<!-- Nifty modals js -->
<script src="assets/third/nifty-modal/js/classie.js"></script>
<script src="assets/third/nifty-modal/js/modalEffects.js"></script>
<!-- Sortable js -->
<script src="assets/third/sortable/sortable.min.js"></script>
<!-- Bootstrao selectpicker js -->
<script src="assets/third/select/bootstrap-select.min.js"></script>
<!-- Summernote js -->
<script src="assets/third/summernote/summernote.js"></script>
<!-- Magnific popup js -->
<script src="assets/third/magnific-popup/jquery.magnific-popup.min.js"></script>
<!-- Bootstrap file input js -->
<script src="assets/third/input/bootstrap.file-input.js"></script>
<!-- Bootstrao datepicker js -->
<script src="assets/third/datepicker/js/bootstrap-datepicker.js"></script>
<!-- Icheck js -->
<script src="assets/third/icheck/icheck.min.js"></script>
<!-- Form wizard js -->
<script src="assets/third/wizard/jquery.snippet.min.html"></script>
<script src="assets/third/wizard/jquery.easyWizard.js"></script>
<script src="assets/third/wizard/scripts.js"></script>
<!-- LANCENG TEMPLATE JAVASCRIPT -->
<script src="assets/js/lanceng.js"></script>
<?php
}
?>