botsArena/src/arenas/tictactoe/public.php

47 lines
1.3 KiB
PHP
Raw Normal View History

<?php
require_once(__DIR__."/functions.php");
2015-11-30 22:28:20 +01:00
$bots=get_Bots_Array('tictactoe');
2015-11-28 15:57:35 +01:00
$postParams=get_Post_Params(count($bots));
2015-11-28 14:26:11 +01:00
if(!$postParams){
$bot1="";
$bot2="";
}else{
$bot1=$postParams['bot1'];
$bot2=$postParams['bot2'];
}
?>
2016-06-09 10:20:59 +02:00
<article>
2015-11-29 11:39:01 +01:00
<h2><?php echo $lang['MAKE_DUEL'];?></h2>
2015-11-28 14:26:11 +01:00
<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>
2016-06-16 13:41:15 +02:00
<p><input type="checkbox" id="fullLogs"/><label for="fullLogs">view the full logs</label></p>
2016-06-16 13:45:07 +02:00
<p><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="tictactoe(document.getElementById('bot1').value,document.getElementById('bot2').value,'<?php echo xd_check_input(2); ?>',document.getElementById('fullLogs').checked);"></p>
2015-12-10 20:39:32 +01:00
<div id="fightResult"></div>
</article>