function output_form_for_new_game($names)
{
+ $copy_names = $names; /* local copy, so that we can delete names from it
+ * after we selected them to make sure that each name
+ * only shows up once
+ */
?>
<form action="index.php?action=new" method="post">
<h2> Select players (Remember: you need to be one of the players) </h2>
<div class="table">
<img class="table" src="pics/table.png" alt="table" />
<?php
- /* ask for player names */
- $i=0;
+
+ /* ask player for names */
+
+ $i=0;
+
+ /* delete players name, since he will be on position D anyway */
+ unset($copy_names[array_search($_SESSION["name"],$copy_names)]);
+
+ srand((float) microtime() * 10000000);
foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player)
{
- srand((float) microtime() * 10000000);
- $randkey = array_rand($names);
- $rand = $names[$randkey];
+ /* pick 3 names at random and put the players name on position D*/
+ if($i<3)
+ {
+ $randkey = array_rand($copy_names);
+ $rand = $copy_names[$randkey];
+ /* delete this name from the list of possible names */
+ unset($copy_names[$randkey]);
+ }
+ else
+ {
+ $rand = $_SESSION["name"];
+ }
+
echo " <div class=\"table".$i."\">\n";
$i++;
echo " <select name=\"$player\" size=\"1\"> \n";
return;
}
-function output_form_calls($me)
+function output_form_calls($me,$myparty)
{
if( can_call(120,$me) )
- echo " re/contra (120):".
- " <input type=\"radio\" name=\"call\" value=\"120\" /> <br />";
+ {
+ if($myparty=='re')
+ echo "re (120):";
+ else if ($myparty=='contra')
+ echo "contra (120):";
+ else
+ echo " re/contra (120):";
+ echo " <input type=\"radio\" name=\"call\" value=\"120\" /> <br />";
+ }
if( can_call(90,$me) )
echo " 90:".
" <input type=\"radio\" name=\"call\" value=\"90\" /> <br />";
echo "</div>\n\n";
echo "<div class=\"footer\">\n";
- echo " <p class=\"left\"> copyright 2006-2008 Arun Persaud, Lance Thornton <br />\n".
+ echo " <p class=\"left\"> copyright 2006-2009 Arun Persaud, Lance Thornton(graphics), Jeff Zerger(database support) <br />\n".
" Verwendung der [deutschen] Kartenbilder mit Genehmigung <br />der Spielkartenfabrik Altenburg GmbH,(c) ASS Altenburger <br />\n".
" - ASS Altenburger Spielkarten - Spielkartenfabrik Altenburg GmbH <br />\n".
" a Carta Mundi Company Email: info@spielkarten.com Internet: www.spielkarten.com</p>\n";