forked from La_Bureautique/zeg1jeux
63 lines
961 B
PHP
63 lines
961 B
PHP
|
<?php
|
|||
|
require_once('config.php');
|
|||
|
require_once('lib/Gchange.class.php');
|
|||
|
|
|||
|
|
|||
|
if (isset($_POST['player'])) {
|
|||
|
|
|||
|
$_SESSION['player_pubkey'] = $_POST['player'];
|
|||
|
|
|||
|
$gchange = new Gchange();
|
|||
|
$user = $gchange->getUser($_SESSION['player_pubkey']);
|
|||
|
|
|||
|
$_SESSION['player_lat'] = $user->_source->geoPoint->lat;
|
|||
|
$_SESSION['player_lon'] = $user->_source->geoPoint->lon;
|
|||
|
|
|||
|
header('Location:map.php');
|
|||
|
|
|||
|
} else {
|
|||
|
|
|||
|
$bodyIds = 'login-page';
|
|||
|
|
|||
|
include_once('header.php');
|
|||
|
|
|||
|
echo '
|
|||
|
<form method="post" action="">
|
|||
|
|
|||
|
<p>
|
|||
|
<label>Joueur :
|
|||
|
<select name="player">';
|
|||
|
|
|||
|
foreach ($players as $p) {
|
|||
|
|
|||
|
echo '<option value="'. $p->getPubkey() .'">'. $p->getName() .'</option>';
|
|||
|
}
|
|||
|
|
|||
|
echo '
|
|||
|
|
|||
|
</select>
|
|||
|
</label>
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
<label>
|
|||
|
Sel :
|
|||
|
<input type="text" name="salt" />
|
|||
|
</label>
|
|||
|
</p>
|
|||
|
|
|||
|
<p>
|
|||
|
<label>
|
|||
|
Poivre:
|
|||
|
<input type="text" name="pepper" />
|
|||
|
</label>
|
|||
|
</p>
|
|||
|
|
|||
|
|
|||
|
<p>
|
|||
|
<input type="submit" />
|
|||
|
</p>
|
|||
|
</form>
|
|||
|
';
|
|||
|
|
|||
|
}
|