Location: PHPKode > projects > PhpBlock > A9.8/modules/dungeon/createplayer.php
<?php
include_once "../../site.class.php";
include_once $PATH_TO_CODE."/script/fonction.php";
include_once $PATH_TO_CODE."/modules/dungeon/dungeonconstante.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/dungeonfunction.php";

function echoSelectColor($parColorNumber) {
	$locSelectId = "color$parColorNumber";
	$locRand = mt_rand(0, count(Constante::$COLOR_LIST)-1);
	$locColorRand = Constante::$COLOR_LIST[$locRand];
	echo "<SELECT style=\"background-color:#".$locColorRand."\"
            id=\"$locSelectId\" name=\"$locSelectId\" onChange=\"changeSelectColor('$locSelectId');\">";
	foreach(Constante::$COLOR_LIST as $locColor) {
		echo "<OPTION ";
		if($locColorRand == $locColor) {
			echo " SELECTED ";
		}
		echo " value=\"$locColor\" style=\"background-color:#$locColor\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	}
	echo "</SELECT>";
}
?>
<html>
<head>
<TITLE>Dungeon - Create player</TITLE>
<?php echoBaseHead()?>
<link rel="stylesheet" href="css/phpblock.css" type="text/css" />
<link rel="stylesheet" href="modules/dungeon/css/interface.css"
	type="text/css" />
<script type="text/javascript" src="script/javascript/fonction.js"></script>
</head>
<body class="dungeonstyle">
<?php
echoJavascriptTestBrowser();
?>
<script language="javascript">
    function changeSelectColor(parSelectId) {
        locNewColor = wdgId(parSelectId).options[wdgId(parSelectId).selectedIndex].style.backgroundColor;
        wdgId(parSelectId).style.backgroundColor=locNewColor;
    }
</script>
<?php
$locMessage = getGetPost("warnmsg", "", false);
if($locMessage != "") {
?>
<div class="warning">	
<?php
	echo $locMessage;
?>	
</div>
<?php 
}
?>
<form method="POST" action="modules/dungeon/initplayer.php">
<table ALIGN="center">
	<tr>
		<td>Lord name</td>
		<td><input type="text" name="lordName"
			value="<?php echo getGetPost("lordName", "", false)?>" />
			</td>
	</tr>
	<tr>
		<td>Alliance name</td>
		<td><input type="text" name="allianceName"
			value="<?php echo getGetPost("allianceName", "", false)?>" />
			</td>
	</tr>
	<tr>
		<td>People type</td>
		<td><select name="playerType" id="playerType">
			<option
				value="<?php echo DungeonConstante::$PLAYER_TYPE_DUNGEON_MASTER?>">dungeon
			master
			<option value="<?php echo DungeonConstante::$PLAYER_TYPE_UNDEAD?>">undead
			<option
				value="<?php echo DungeonConstante::$PLAYER_TYPE_HUMAN_KNIGHT?>">knight
		</select>
		</td>
	</tr>
	<tr>
		<td>Select your flag color</td>
		<td align="center" colspan="2"><?php
		echoSelectColor(1);
		echoSelectColor(2);
		echoSelectColor(3);
		?>
		</td>	
	</tr>
	<tr>	
		<td>Select your language</td>
		<td align="center" colspan="2">
		<select title="player language" id="language" name="language">
<?php
		dungeonEchoAvailableLanguage();
?>
	</select>
	</td>
	</tr>
	<tr><td><br></td>
	</tr>
	<tr>
		<td>Login</td>
		<td><input type="text" name="login"
			value="<?php echo getGetPost("login", "", false)?>" />
			</td>
	</tr>
	<tr>
		<td>Password</td>
		<td><input type="password" name="password" value="" /></td>
	</tr>
	<tr>
	</tr>
	<tr>
		<td>Email</td>
		<td><input type="text" name="email" value="valid email" /></td>
	</tr>
	<!-- 
    <tr><td>Start location (optionnal, e.g : 500;500;-2)<td>
    	<input type="number" name="startX" value=""/>
    	<input type="number" name="startY" value=""/>
    	<input type="number" name="startZ" value=""/>
    </tr>
     -->
	<tr><td><br></td>
	<tr>
		<td align="center" colspan="2"><input type="submit" name="submit"
			value="create player" /> <INPUT TYPE="reset">
	</tr>
</table>
</form>
</body>
</html>
Return current item: PhpBlock