<span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"></a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="dropdown-toggle" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown"> <b class="username"> <?php require_once "../controller/Config.php"; require_once Config::HELPER_FILE_USERDB; $userDBHelper = new User_DB_Helper(); $socialID = (int) $_COOKIE['platform_id']; echo $userDBHelper->getUser($socialID)->fetch_assoc()['name']; ?> </b> <span class="caret"></span> </a> <ul class="dropdown-menu"> <li> <a href="http://localhost/ESETGuvenlikOyunu/logout.php">Çıkış Yap</a> </li> </ul> </li> </ul> </div><!--/.nav-collapse --> </div>
<?php if (isset($_COOKIE['platform_id'])) { require_once "../controller/Config.php"; require_once Config::HELPER_FILE_USERDB; $userDBHelper = new User_DB_Helper(); $socialID = (int) $_COOKIE['platform_id']; $currentLevel = $userDBHelper->getLevel($socialID); $level = true; } else { header("Location: http://localhost/ESETGuvenlikOyunu/"); } include '../views/layouts/header.php'; include '../views/layouts/menu.php'; ?> <div class="container"> <div id="level-container"> <?php if ($level) { include "../views/levels/level-{$currentLevel}.html"; } ?> </div> </div> <?php include '../views/layouts/footer.php';
<?php require_once "Config.php"; require_once Config::HELPER_FILE_USERDB; $function = $_POST['function']; $data = $_POST['data']; $returnData = array(); if (in_array($function, Config::$VALID_FUNCTIONS)) { $userDBHelper = new User_DB_Helper(); switch ($function) { case "increasePoint": if (isset($_COOKIE['platform_id'])) { $socialID = (int) $_COOKIE['platform_id']; $points = (int) $data; if ($points > Config::MAX_POINT || $points < Config::MIN_POINT) { break; } $userDBHelper->increasePoint($socialID, $points); // Puan sayısı burda değiştirilebilir } break; case "decreasePoint": if (isset($_COOKIE['platform_id'])) { $socialID = (int) $_COOKIE['platform_id']; $points = (int) $data; if ($points > Config::MAX_POINT || $points < Config::MIN_POINT) { break; } $userDBHelper->decreasePoint($socialID, $points); // Puan sayısı burda değiştirilebilir }