BUGFIX: typo in javascript
[e-DoKo.git] / include / output.php
index 42f40856ad35ec1240b07a6b74b0206baaa2d1f0..50da5791cf5d073de06dc2d5e5f17b7cd41c6f02 100644 (file)
@@ -53,48 +53,80 @@ function output_form_for_new_game($names)
                         * after we selected them to make sure that each name
                         * only shows up once
                         */
+
+  /* delete players name, since he will be on position D anyway */
+  unset($copy_names[array_search($_SESSION["name"],$copy_names)]);
+  srand((float) microtime() * 10000000);
+
+
   echo '  <form action="index.php?action=new" method="post">';
   echo '    <h2> '._('Select players (Remember: you need to be one of the players)').' </h2>';
-  echo '   <div class="table">';
-  echo '     <img class="table" src="pics/table.png" alt="table" />';
 
-  /* ask player for names */
+  echo '   <div class="table">';
 
-  $i=0;
+  echo  "     <div class=\"table1\">\n";
+  $randkey = array_rand($copy_names);
+  $rand = $copy_names[$randkey];
+  /* delete this name from the list of possible names */
+  unset($copy_names[$randkey]);
+  echo "       <select name=\"PlayerB\" size=\"1\">  \n";
+  foreach($names as $name)
+    {
+      if($name==$rand)
+       echo "         <option selected=\"selected\">$name</option>\n";
+      else
+       echo "         <option>$name</option>\n";
+    }
+  echo "       </select>\n     </div>\n";
 
-  /* delete players name, since he will be on position D anyway */
-  unset($copy_names[array_search($_SESSION["name"],$copy_names)]);
+  echo '   <div class="middle">';
 
-  srand((float) microtime() * 10000000);
-  foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player)
+  $randkey = array_rand($copy_names);
+  $rand = $copy_names[$randkey];
+  /* delete this name from the list of possible names */
+  unset($copy_names[$randkey]);
+  echo  "     <div class=\"table0\">\n";
+  echo "       <select name=\"PlayerA\" size=\"1\">  \n";
+  foreach($names as $name)
     {
-      /* 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]);
-       }
+      if($name==$rand)
+       echo "         <option selected=\"selected\">$name</option>\n";
       else
-       {
-         $rand = $_SESSION["name"];
-       }
+       echo "         <option>$name</option>\n";
+    }
+  echo "       </select>\n     </div>\n";
 
-      echo  "     <div class=\"table".$i."\">\n";
-      $i++;
-      echo "       <select name=\"$player\" size=\"1\">  \n";
-      foreach($names as $name)
-       {
-         if($name==$rand)
-           {
-             echo "         <option selected=\"selected\">$name</option>\n";
-           }
-         else
-           echo "         <option>$name</option>\n";
-       }
-      echo "       </select>\n     </div>\n";
+  echo '     <img class="table" src="pics/table.png" alt="table" />';
+  $randkey = array_rand($copy_names);
+  $rand = $copy_names[$randkey];
+  /* delete this name from the list of possible names */
+  unset($copy_names[$randkey]);
+  echo  "     <div class=\"table2\">\n";
+  echo "       <select name=\"PlayerC\" size=\"1\">  \n";
+  foreach($names as $name)
+    {
+      if($name==$rand)
+       echo "         <option selected=\"selected\">$name</option>\n";
+      else
+       echo "         <option>$name</option>\n";
     }
+  echo "       </select>\n     </div>\n";
+
+  echo '   </div>';
+  $rand = $_SESSION["name"];
+  echo  "     <div class=\"table3\">\n";
+  $i++;
+  echo "       <select name=\"PlayerD\" size=\"1\">  \n";
+  foreach($names as $name)
+    {
+      if($name==$rand)
+       echo "         <option selected=\"selected\">$name</option>\n";
+      else
+       echo "         <option>$name</option>\n";
+    }
+  echo "       </select>\n     </div>\n";
+
+  /* ask player for names */
 
     echo '    </div>';
     echo '';
@@ -376,9 +408,10 @@ function output_header()
   <head>
      <title>e-Doko</title>
      <meta charset="utf-8" />
+     <meta name="viewport" content="width=device-width; initial-scale=1.0;" />
      <link rel="shortcut icon" href="pics/edoko-favicon.png" />
      <link rel="stylesheet" href="css/normalize.css?v=1" />
-     <link rel="stylesheet" href="css/standard.css?v=36" />
+     <link rel="stylesheet" href="css/standard.css?v=39" />
      <link rel="stylesheet" href="css/dateinput.css?v=1"/>
      <script type="text/javascript" src="include/jquery.js"> </script>
      <script type="text/javascript" src="include/jquery.tablesorter.js"></script>
@@ -409,7 +442,7 @@ function output_footer()
     "  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";
- echo " <p class=\"right\"> See the latest changes <a href=\"http://nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=summary\">\n".
 echo " <p class=\"right\"> See the latest changes <a href=\"http://nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=summary\">\n".
     "  via git </a> <br />or download the source via <br />\n'git clone http://nubati.net/git/e-DoKo.git' <br />\n".
     "  <a href=\"http://www.dreamhost.com/green.cgi\">\n".
     "  <img alt=\"Green Web Hosting! This site hosted by DreamHost.\"".