<?php
require_once('sql.php');
require_once('functions.php');
//$avatars = get_user_avatars();
?>

<!DOCTYPE html>
<html>
	<head>
		<title>Prati Nemačku</title>
		<link rel="stylesheet" type="text/css" href="jquery.mCustomScrollbar.css" />
		<link rel="stylesheet" type="text/css" href="style.css" />
		<meta charset="UTF-8">
        <script src='//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
        <script src='js/jquery.mCustomScrollbar.min.js'></script>
        <script src='js/jquery.mousewheel.min.js'></script>
    </head>
    <body>
		<div class="container">
            <div class="hp_text">
                O nagradama i uslovima nagradne igre  više pročitajte na <a target="_blank" href="pravila.pdf">ovom linku.</a>
            </div>
    <?php if(!empty($_SESSION['access_token']) || !empty($_SESSION['access_token']['oauth_token']) || !empty($_SESSION['access_token']['oauth_token_secret'])) :?>

        <div class="second_screen">
	        <div class="avatar_border">
	            <img class = "avatar" src="user_img/<?php echo $_SESSION['tw_screen_name']; ?>.png">
	        </div>
	        <p class="message"><?php if(isset($msg)){echo $msg;} ?></p>
	        <form action="index.php" method="POST">
	            <input type="submit" class="btn btn_postavi" name="submit" value="" />
	        </form>
	        <a class = 'cancel_btn' href = 'http://homepage.rs/pratinemacku/clearsessions.php'>
		    <img src='img/cancel.png'>
	        </a>
		</div>
    <?php else :  ?>
			<a class = "btn btn_kreiraj" href="./redirect.php"><img src="img/btn_promeni.png"></a>
                <img class="soccer_ball" src="img/soccer_ball.png">
            <!-- <img class = "first_image" src="images/img_first_new.png"> -->
	    <?php endif; ?>
	    <div class="twitter_avatras"><?php echo get_user_avatars(); ?></div>
    </div>
        <script>
            (function($){
                $(window).load(function(){
                    $(".twitter_avatras").mCustomScrollbar({
                        theme : 'minimal'
                    });
                });
            })(jQuery);
        </script>

    </body>
</html>
