Вход Регистрация
Файл: Source/pages/gifts.php
Строк: 131
<?php
/*
 * Script name: Points4Prize
 * Author: Soft Projects
 * Date created: 15/07/2015
 */

require_once 'inc/header.php';
?>
<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 class="wrapper">
                    <div class="header-breadcrumbs">
 <?php                    require_once 'inc/stats.php';                    ?>
                        <ul>
                            <li><a href="index.php">Home</a></li>
                            <li>Gifts </li>
                        </ul>
                    </div>
                </div>

            </header>
            <div id="main-box" class="full-width">
                <div id="main">
                    <div class="signup-panel">
                        <div class="left" style="width:666px;">
                            <h2><span>Gifts</span></h2>
                            <div class="content-padding">
                            
                              <?php
                
if (!isset($_SESSION['logged_in'])) {
                    
$_SESSION['location'] = "/gifts";
                    
header('Location: /login');
                    exit();
                } else {
                    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));
                    }
                    
$uquery mysql_query("SELECT id,points,vip FROM vn_users WHERE user='{$user}'") or die(mysql_error());
                    
$row mysql_fetch_assoc($uquery);
                    
$today date("d.m.Y");
                    
$time time();

                    if (isset(
$_GET['gift'])) {

                        
$points rand($GLOBALS['gifts_random_points_start'], $GLOBALS['gifts_random_points_finish']);

                        
$gamestq mysql_query("SELECT uid,timef FROM podaraci WHERE uid='{$row[id]}' and timef='{$today}'") or die(mysql_error());
                        
$gamest mysql_num_rows($gamestq);
                        if (
$row[vip] == "1" and $gamest >= 2) {
                            echo 
"<div class='alert alert-dismissable alert-danger'>
Already get gift today!
</div>"
;
                        } elseif (
$row[vip] == "0" and $gamest >= 1) {
                            echo 
"<div class='alert alert-dismissable alert-danger'>
  <button type='button' class='close' data-dismiss='alert'>×</button>
Already get gift today!
</div>"
;
                        } elseif (
$points == "0") {
                            
mysql_query("INSERT INTO podaraci (uid, points, time, timef) VALUES('{$row[id]}','{$points}','{$time}','{$today}')") or die(mysql_error());
                            echo 
"<div class='alert alert-dismissable alert-warning'>
No luck :(. Do not you got the gift, please try again!
</div>"
;
                        } else {
                            
mysql_query("INSERT INTO podaraci (uid, points, time, timef) VALUES('{$row[id]}','{$points}','{$time}','{$today}')") or die(mysql_error());
                            
mysql_query("UPDATE vn_users SET points=points+{$points} WHERE id='{$row[id]}'") or die(mysql_error());
                            if (
$points == "1") {
                                
$ptext "point";
                            } else {
                                
$ptext "points";
                            }
                            echo 
"<div class='alert alert-dismissable alert-success'>
You win <b>
$points</b> $ptext. Congratulations.
</div>
                    "
;
                        }
                    }

                    
$gamestq2 mysql_query("SELECT uid,timef FROM podaraci WHERE uid='{$row[id]}' and timef='{$today}'") or die(mysql_error());
                    
$gamest2 mysql_num_rows($gamestq2);
                    if (
$gamest2 >= 1) {
                
$r_ss 60 date("s");
                
$r_mm 60 date("i");
                
$hh 24 date("H");
                if(
$hh == 1) { $t_hh "hour"
                } else {
                    
$t_hh "hours"
                }
                if(
$r_mm == 1) { $t_mm "minute";
                } else {
                    
$t_mm "minutes";
                }
                
$t_ss "seconds";
                if(
strlen($hh) == 1)     { $hh '0'.$hh; }
                if(
strlen($r_mm) == 1)     { $r_mm '0'.$r_mm; }
                if(
strlen($r_ss) == 1)     { $r_ss '0'.$r_ss; }
                        echo 
"
                        <center><img src='assets/img/games/gifts.png' width='200' /></center>
                <br />
                <script src='assets/js/countdown.js'></script>
                <script type='text/javascript'>
                    $(function(){
                        $('#cd').countdown({
                            image: 'assets/img/digits.png',
                            startTime: '
$hh:$r_mm:$r_ss',
                            timerEnd: function(){ location.reload(); }
                            });
                    });
                </script>
                <div style='text-align:center; padding:10px 0px 5px 0px;'>You can get again:</div>
                <div id='cd'> </div>
                <div style='width:310px; margin:0px auto; text-align:left;'>
                    <span style='margin-left:25px;'>
$t_hh</span> 
                    <span style='margin-left:67px;'>
$t_mm</span> 
                    <span style='margin-left:52px;'>
$t_ss</span> 
                </div>
                "
;
                    } else {
                       
                        echo 
'
                            <center>
                            <h3 style="color:green;">Select one of the gifts that you think will have the most - many points. :)
                            </h3>                            
                            <br /><br />'
;
                        
$sql_gifts mysql_query("SELECT * FROM `gifts_images` ORDER BY RAND() LIMIT 10");
                        
$i 1;
                        while (
$row mysql_fetch_array($sql_gifts)) {
                            echo 
'
                            <a href="/gifts:gift-' 
$row['id'] . '" class="tooltip_tip"  alt="' $row['id'] . '">
                            
                            <img src="' 
$row['icon'] . '" /></a>';
                            
$i++;
                            if (
$i === 8) {
                                echo 
'<br />';
                            }
                        }

                        echo 
'</center>';
                    }
                }
                
?>
                            
                            
                        </div>
                        <div class="clear-float"></div>
                    </div>
                    
                    <div class="right" style="width:245px;">
                            
                                <div class="content-padding">
                                    
                                    <div class="form-split-about">
                                    
                                    <?php
                                     
//include ads
                                     
include("inc/ads250.php");
                                     
?>
                                    
                                    </div>
                                    
                                </div>
                            </div>

                            <div class="clear-float"></div>
                    
                </div>
                <div class="clear-float"></div>
            </div>
    </div>
</div>

<?php
require_once 'inc/footer.php';
?>
Онлайн: 1
Реклама