function commune
This commit is contained in:
parent
04604fd89b
commit
2a167a6b96
BIN
html/imgs/Arenes-Nimes.jpg
Normal file
BIN
html/imgs/Arenes-Nimes.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 550 KiB |
|
@ -1,4 +1,10 @@
|
||||||
|
<article>
|
||||||
|
<h2>Cette arène est en cours de maintenance, elle sera de nouveau prête dans les prochains jours</h2>
|
||||||
|
<p><img src="Arenes-Nimes.jpg" alt="travaux sur les arènes de Nimes"/></p>
|
||||||
|
|
||||||
|
</article>
|
||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
require_once(__DIR__."/functions.php");
|
require_once(__DIR__."/functions.php");
|
||||||
|
|
||||||
$bots=get_Bots_Array('Battleship');
|
$bots=get_Bots_Array('Battleship');
|
||||||
|
@ -52,4 +58,5 @@ if(!$postParams){
|
||||||
<!-- battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check) -->
|
<!-- battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check) -->
|
||||||
<p><label> </label><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="battleship(document.getElementById('bot1').value,document.getElementById('bot2').value,getElementById('width').value,getElementById('height').value,getElementById('ship1').value,getElementById('ship2').value,getElementById('ship3').value,getElementById('ship4').value,getElementById('ship5').value,getElementById('ship6').value,'<?php echo xd_check_input(2); ?>');"></p>
|
<p><label> </label><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="battleship(document.getElementById('bot1').value,document.getElementById('bot2').value,getElementById('width').value,getElementById('height').value,getElementById('ship1').value,getElementById('ship2').value,getElementById('ship3').value,getElementById('ship4').value,getElementById('ship5').value,getElementById('ship6').value,'<?php echo xd_check_input(2); ?>');"></p>
|
||||||
<div id="fightResult"></div>
|
<div id="fightResult"></div>
|
||||||
</article>
|
</article
|
||||||
|
*/>
|
|
@ -1,23 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
function get_IA_Response($iaUrl,$postParams){
|
|
||||||
//send params JSON as body
|
|
||||||
$data_string = json_encode($postParams);
|
|
||||||
|
|
||||||
$ch = curl_init($iaUrl);
|
|
||||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
|
||||||
'Content-Type: application/json',
|
|
||||||
'Content-Length: ' . strlen($data_string))
|
|
||||||
);
|
|
||||||
$output= curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
//echo $iaUrl." ".$data_string." ".$output.'<br/>';
|
|
||||||
return json_decode($output,TRUE);
|
|
||||||
}
|
|
||||||
function get_Post_Params($botsCount){
|
function get_Post_Params($botsCount){
|
||||||
$keysBots=array('bot1','bot2');
|
$keysBots=array('bot1','bot2');
|
||||||
foreach($keysBots as $botKey){
|
foreach($keysBots as $botKey){
|
||||||
|
|
|
@ -34,23 +34,3 @@ function get_Bots_Array(){
|
||||||
return $bots;
|
return $bots;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
function get_IA_Response($iaUrl,$postParams){
|
|
||||||
//send params JSON as body
|
|
||||||
|
|
||||||
$data_string = json_encode($postParams);
|
|
||||||
|
|
||||||
$ch = curl_init($iaUrl);
|
|
||||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
|
||||||
'Content-Type: application/json',
|
|
||||||
'Content-Length: ' . strlen($data_string))
|
|
||||||
);
|
|
||||||
$output= curl_exec($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
//echo $iaUrl." ".$data_string." ".$output.'<br/>';
|
|
||||||
return json_decode($output,TRUE);
|
|
||||||
}
|
|
|
@ -332,3 +332,24 @@ function does_arena_exist($string,$arenasArr){
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_IA_Response($iaUrl,$postParams){
|
||||||
|
//send params JSON as body
|
||||||
|
|
||||||
|
$data_string = json_encode($postParams);
|
||||||
|
|
||||||
|
$ch = curl_init($iaUrl);
|
||||||
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: ' . strlen($data_string))
|
||||||
|
);
|
||||||
|
$output= curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
//echo $iaUrl." ".$data_string." ".$output.'<br/>';
|
||||||
|
return json_decode($output,TRUE);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user