botsArena/src/arenas/Battleship/public.php

45 lines
1.1 KiB
PHP
Raw Normal View History

2015-12-10 20:50:19 +01:00
<?php
2015-12-10 20:53:48 +01:00
require_once(__DIR__."/functions.php");
2015-12-10 20:50:19 +01:00
$bots=get_Bots_Array('"Battleship');
$postParams=get_Post_Params(count($bots));
if(!$postParams){
$bot1="";
$bot2="";
}else{
$bot1=$postParams['bot1'];
$bot2=$postParams['bot2'];
}
?>
<article>
<h2><?php echo $lang['MAKE_DUEL'];?></h2>
<p>
<select name="bot1" id="bot1">
<?php
for($i=0;$i<count($bots);$i++){
if($i==$bot1)
$selected='selected="selected"';
else
$selected='';
echo '<option value="'.$i.'" '.$selected.'>'.$bots[$i]['name'].'</option>';
}
?>
</select>
&nbsp;VS&nbsp;
<select name="bot2" id="bot2">
<?php
for($i=0;$i<count($bots);$i++){
if($i==$bot2)
$selected='selected="selected"';
else
$selected='';
echo '<option value="'.$i.'" '.$selected.'>'.$bots[$i]['name'].'</option>';
}
?>
</select>
</p>
<p><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="battleship(document.getElementById('bot1').value,document.getElementById('bot2').value,'<?php echo xd_check_input(2); ?>');"></p>
<div id="fightResult"></div>
</article>