Пример #1
0
<?php

session_start();
//echo "sdfsdf";
require 'controller/dbsettings.php';
if (Game::findGame()->type != "geo") {
    header('Location: showAnswerOther.php');
}
/*
if (Game::findGame()->type=="pop")
      header( 'Location: showAnswerPop.php') ;
if (Game::findGame()->type=="weather")
      header( 'Location: showAnswerWeather.php') ;
if (Game::findGame()->type=="age")
      header( 'Location: showAnswerAge.php') ;
if (Game::findGame()->type=="user")
      header( 'Location: showAnswerAge.php') ;
if (Game::findGame()->type=="time")
      header( 'Location: showAnswerTime.php');
*/
$allAnswers = new AllAnswers($_SESSION["questionNumber"]);
?>

<html>
<head>
      <link rel="stylesheet" href="style/global.css">
      <style type="text/css">
            html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}


Пример #2
0
<?php

session_start();
//echo "sdfsdf";
require 'controller/dbsettings.php';
if (Game::findGame()->type != "geo" && Game::findGame()->type != "pt" && Game::findGame()->type != "places") {
    header('Location: showAnswerOther.php');
}
$theQuestion = Question::loadQuestion();
$theQuestion->alertUsers(-1);
$allAnswers = new AllAnswers($_SESSION["questionNumber"]);
//die ($allAnswers->zoomLevel());
?>


<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Answer</title>

	<link rel="stylesheet" href="style/global.css">
	<link rel="stylesheet" href="style/showAnswer.css">
	<link rel="stylesheet" href="style/showAnswerOther.css">

	<!--<script src="scripts/getQuestion.js"></script>-->
	<script src="scripts/global.js"></script>
	<script src="scripts/socketScripts.js"></script>
	<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDFCvK3FecOiz5zPixoSmGzPsh0Zv75tZs"></script>

	<script>
Пример #3
0
          body{
            <?php 
if ($theQuestion->type == "age") {
    ?>
              background-size: contain;
            <?php 
} else {
    ?>
              background-size: cover;
            <?php 
}
?>
            background-repeat: no-repeat;
            background-position:center center;
            background: url('<?php 
echo Question::loadImage($allAnswers->correctAns->name, Game::findGame()->type);
?>
');

          }

          #overlayWrap{
            left:400px;
            height:140px;
            background: rgba(0,0,0,.7);
          }

          #scoresWrap{
            display: block;
            position: fixed;
            left: 0px;
Пример #4
0
<?php

session_start();
$whitelist = array('message', 'submit', 'name', 'game_id');
require 'controller/dbsettings.php';
if ($submit == "Join") {
    //$name=substr($name,0,20);
    $_SESSION["game_id"] = $game_id;
    // User::createUser($game_id,$name);
    if (Game::findGame() == null) {
        header('Location: joinQuiz.php?error=Bad Game');
    }
    if (!User::createUser($game_id, $name)) {
        header('Location: joinQuiz.php?error=Bad Username');
    }
    $game = Game::findGame();
    $questionNumber = $game->round;
    if ($questionNumber != -1) {
        if ($game->type == "geo") {
            header('Location: userScreen.php?question=' . $questionNumber);
        } else {
            $type = ucwords($game->type);
            header('Location: userScreen' . $type . '.php?question=' . $questionNumber);
        }
    }
}
?>
 <html>
 <head>
    <link rel="stylesheet" href="style/global.css">
    <link rel="stylesheet" href="style/joinQuiz.css">
Пример #5
0
 public static function getNumberUsers()
 {
     $game = Game::findGame();
     global $conn;
     $lastQuestionNumber = $game->round - 1;
     if ($lastQuestionNumber > 0) {
         $sql = "SELECT COUNT(*) as total FROM `answers` WHERE game_id ='" . $_SESSION["game_id"] . "' AND questionNum='{$lastQuestionNumber}' AND points>=1";
         //echo $sql;
         $result = $conn->query($sql);
         if ($result) {
             $row = $result->fetch_assoc();
             return $row['total'];
         }
     } else {
         $sql = "SELECT COUNT(*) as total FROM `users` WHERE game_id ='" . $_SESSION["game_id"] . "'";
         $result = $conn->query($sql);
         if ($result) {
             $row = $result->fetch_assoc();
             return $row['total'];
         }
     }
     return 999;
 }
Пример #6
0
			}, 50);



		}

	</script>

	<style>
		body{
			background-image:url("<?php 
echo $theQuestion->getImage();
?>
");
			<?php 
if (Game::findGame()->type == "age" || Game::findGame()->type == "entertainment" || Game::findGame()->type == "rand") {
    ?>
			background-size       : contain;
			background-position   : top center;
			<?php 
} else {
    ?>
			background-size       : cover;
			background-position   : center;
			<?php 
}
?>
		}
	</style>

</head>
Пример #7
0
			    val = parseInt(labels[i].innerHTML);
			    labels[i].innerHTML = comma(val);
			  }
			}
	</script>

	<style>
		body{
			background-color:black;
	    background-image: url('<?php 
echo $theQuestion->loadImage();
?>
');
			background-attachment : fixed;
			<?php 
if (Game::findGame()->type == "age") {
    ?>
			background-size       : contain;
			background-position   : top center;
			<?php 
} else {
    ?>
			background-size       : cover;
			background-position   : center;
			<?php 
}
?>
			background-repeat: no-repeat;
		}
	</style>
Пример #8
0
 public static function addUser($qID, $loc, $ans, $userID, $correct, $points, $color)
 {
     $answer = new self();
     $answer->user_id = $userID;
     $answer->location = $loc;
     $answer->ans = $ans;
     $answer->qID = $qID;
     $answer->color = $color;
     if ($ans == -999) {
         //meaning they didnt submit
         $answer->distanceAway = -999.99;
     } else {
         if (!is_object($correct)) {
             //meaning end of game
             $answer->distanceAway = -999.99;
         } else {
             if (Game::findGame()->type == "geo" || Game::findGame()->type == "pt" || Game::findGame()->type == "places") {
                 $answer->distanceAway = LatLong::findDistance($correct->location, $loc);
             } else {
                 $answer->distanceAway = abs($ans - $correct->value);
             }
         }
     }
     if ($ans > 100000) {
         $answer->distanceAway = round($answer->distanceAway, -5);
     }
     $answer->getUserInfo();
     $answer->updateUser();
     $answer->roundPoints = $points;
     return $answer;
 }