Файл: Source/pages/home.php
Строк: 211
<?php
/*
* Script name: Points4Prize
* Author: Soft Projects
* Date created: 15/07/2015
*/
require_once 'inc/header.php';
?>
<style>
.line {
background: url(assets/img/line.gif) repeat-x;
height: 1px;
margin: 4px 0;
clear: both;
}
</style>
<!--<body class="no-slider">-->
<body class="has-top-menu">
<!-- BEGIN #slider-imgs -->
<div id="slider-imgs">
<div class="featured-img-box">
<div id="featured-img-1" class="featured-img"></div>
<div id="featured-img-2" class="featured-img invisible"></div>
<div id="featured-img-3" class="featured-img invisible"></div>
<div id="featured-img-4" class="featured-img invisible"></div>
</div>
<!-- END #slider-imgs -->
</div>
<!-- BEGIN #top-layer -->
<div id="top-layer">
<div id="header-top">
<?php
require_once 'inc/header_top.php';
?>
</div>
<section id="content">
<header id="header">
<div id="menu-bottom">
<?php
require_once 'inc/menu_bottom.php';
?>
</div>
<div id="slider">
<div id="slider-info">
<a href="javascript: featSelect(1);" href="#" id="featSelect-1" class="featured-select this-active">
<span class="w-bar" id="feat-countdown-bar-1">.</span>
<span class="w-coin" id="feat-countdown-1">0</span>
<img href="#" src="uploads/slider/image-small-1.jpg" alt="" title="" />
</a>
<a href="javascript: featSelect(2);" id="featSelect-2" class="featured-select">
<span class="w-bar" id="feat-countdown-bar-2">.</span>
<span class="w-coin" id="feat-countdown-2">0</span>
<img src="uploads/slider/image-small-2.jpg" alt="" title="" />
</a>
<a href="javascript: featSelect(3);" id="featSelect-3" class="featured-select">
<span class="w-bar" id="feat-countdown-bar-3">.</span>
<span class="w-coin" id="feat-countdown-3">0</span>
<img src="uploads/slider/image-small-3.jpg" alt="" title="" />
</a>
<a href="javascript: featSelect(4);" id="featSelect-4" class="featured-select">
<span class="w-bar" id="feat-countdown-bar-4">.</span>
<span class="w-coin" id="feat-countdown-4">0</span>
<img src="uploads/slider/image-small-4.jpg" alt="" title="" />
</a>
</div>
</div>
</header>
<div id="main-box">
<div id="main">
<h2><span>Welcome!</span></h2>
<div class="content-padding">
<div class="form-split-about">
<?php
$info = mysql_query("SELECT * FROM `pages` WHERE `title`= 'welcome' ORDER BY id DESC LIMIT 1");
$row = mysql_fetch_array($info);
if (empty($row)) {
echo "<div class='alert alert-danger'>Please, add info in admin panel.</div>";
} else {
echo html_entity_decode($row['content']);
}
?>
</div>
</div>
</div>
<!-- BEGIN #sidebar -->
<div id="sidebar">
<!-- BEGIN .panel -->
<div class="panel">
<?php
if (isset($_SESSION['logged_in'])) {
?>
<h2>Profile</h2>
<div class="panel-content">
<div class="profile-left-side">
<?php
if (isset($_SESSION['user'], $_SESSION['pass'])) {
$user = str_replace(" ", "", $_SESSION['user']);
$user = sprintf("%s", mysql_real_escape_string($user));
} else {
$user = str_replace(" ", "", $_COOKIE['user']);
$user = sprintf("%s", mysql_real_escape_string($user));
}
$result = mysql_query("SELECT * FROM vn_users WHERE user='{$user}'") or die(mysql_error());
$row = mysql_fetch_array($result);
$points = number_format($row['points'], 0, ',', ' ');
$result2 = mysql_query("SELECT forw FROM vn_messages WHERE forw='{$user}' and readed='0'") or die(mysql_error());
$countm = mysql_num_rows($result2);
if ($countm > 0) {
$countm = "<b>$countm</b>";
} else {
$countm = $countm;
}
if (empty($row['avatar'])) {
$avatar = "uploads/avatars/noavatar.png";
} else {
$avatar = $row['avatar'];
}
?>
<style>
.panel a.defbutton {
font-size:13px;
}
</style>
<div class="the-profile-top">
<div style="float:left;width:40%;margin-right:3%;">
<span class="wrapimg" style="border-radius: inherit; overflow: hidden; position: relative; display: inline-block;">
<span class="wrapimg" style="display:inline-block;position:relative;border-radius:inherit;-moz-border-radius:inherit;overflow:hidden;">
<span class="wrapimg" style="display:inline-block;position:relative;border-radius:inherit;-moz-border-radius:inherit;overflow:hidden;">
<img src="<?php echo $avatar;?>" class="setborder" alt="" width="100%"></span></span></span>
</div>
<div style="float:left;width:55%;">
<h3><?php echo $row['user'];?></h3>
<hr style="margin-bottom:4px;margin-top:0px;" />
<h4>Points: <?php echo $points;?></h4>
<h4><a href="/pm">Messages(<?php echo $countm;?>)</a></h4>
</div>
<div style="clear:both;"></div>
<div>
<ul class="user-button-list">
<li><a href="/cp" class="defbutton profile-button"><i class="fa fa-user"></i>Profile</a></li>
<li><a href="/messages" class="defbutton profile-button"><i class="fa fa-comment"></i>Mesagess</a></li>
<li><a href="/getprize" class="defbutton profile-button"><i class="fa fa-gift"></i>Get Prize</a></li>
<li><a href="/smspoints" class="defbutton profile-button"><i class="fa fa-mobile"></i>SMS Points</a></li>
<li><a href="/settings" class="defbutton profile-button"><i class="fa fa-cog"></i>Settings</a></li>
<li><a href="/logout" class="defbutton profile-button"><i class="fa fa-toggle-on"></i>Logout</a></li>
</ul>
</div>
</div>
<!-- END .profile-left-side -->
</div>
<?php
}else{
if (isset($_POST["user"])) {
login();
}
?>
<h2>Login</h2>
<div class="panel-content">
<form action="" method="post">
<p>
<label for="login_username">Username:</label>
<input name="user" id="login_username" value="" type="text">
</p>
<p>
<label for="login_password">Password:
</label>
<input name="pass" id="login_password" value="" type="password">
</p>
<p>
<label for=""> </label>
<input name="remember" id="login_remember" value="" type="checkbox">
<label class="iiiii" for="login_remember">Remember me</label>
</p>
<p class="form-footer">
<input name="login_submit" id="login_submit" value="Вход" type="submit">
</p>
<p class="form-footer">
<a href="/lost">Lost password?</a> / <a href="/register">Register</a>
</p>
</form>
<?php
}?>
</div>
<!-- END .panel -->
</div>
<!-- BEGIN .panel -->
<div class="panel">
<h2>Statistics</h2>
<div class="panel-content">
<div class="conteiner2_right">
<h4><i class="fa fa-user"></i> Users: <b>
<?php
$query3 = mysql_query("SELECT count(id) as broi from `vn_users`");
$row = mysql_fetch_array($query3);
echo $row['broi'];
?>
</b>
<div class="line">
</div></h4>
<h4><i class="fa fa-comments-o"></i> Sent SMS: <b>
<?php
$query3 = mysql_query("SELECT count(id) as broi from `vn_sms`");
$row = mysql_fetch_array($query3);
echo @$row[broi];
?>
</b>
<div class="line"></div></h4>
<h4><i class="fa fa-gift"></i> Prizes: <b>
<?php
$query3 = mysql_query("SELECT count(id) as broi from `vn_prizes`");
$row = mysql_fetch_array($query3);
echo $row['broi'];
?>
</b>
<div class="line">
</div></h4>
<h4><i class="fa fa-trophy"></i> Win users: <b>
<?php
$query3 = mysql_query("SELECT count(id) as broi from `vn_awarded`");
$row = mysql_fetch_array($query3);
echo @$row[broi];
?>
<div class="line"></div></h4>
</div>
</div>
<!-- END .panel -->
</div>
<!-- END #sidebar -->
</div>
<div class="clear-float"></div>
</div>
</section>
<!-- END #top-layer -->
</div>
<?php
require_once 'inc/footer.php';
?>