X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Foutput.php;h=161ef3a8746f1b824c74045d5d5cd1e4fb505041;hp=6823b4db6ae33f628cfe8e0c068b32824188a607;hb=0a4212f2c7179913c6ae87011b8f00d435af93e3;hpb=c1585e23cb3ea757674c234c9193889b4f2f2090 diff --git a/include/output.php b/include/output.php index 6823b4d..161ef3a 100644 --- a/include/output.php +++ b/include/output.php @@ -12,7 +12,7 @@ function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid) global $RULES; echo "
\n
\n"; - echo "Do you want to continue playing?(This will start a new game, with the next person as dealer.)\n"; + echo "Do you want to continue playing?(This will start a new game, with the $playerD as dealer.)\n"; echo " \n"; echo " \n"; echo " \n"; @@ -114,12 +114,17 @@ function output_form_for_new_game($names) \n"; - else - $HTML = "\n\n"; + $HTML.= " class=\"$class\""; + if($id!="") + $HTML.= " id=\"$id\""; + + $HTML.=">\n"; $i=0; @@ -133,10 +138,7 @@ function output_table($data,$caption="",$class="") else { if($i==1) $HTML .= " \n"; - if($i % 2) - $HTML .= " "; - else - $HTML .= " "; + $HTML .= " "; } foreach($record as $point) { @@ -298,8 +300,16 @@ function output_header() e-Doko - + + + +
@@ -512,7 +522,7 @@ function output_exchanged_cards() * go through all positions, check that position has cards that need to be shown and * show those cards */ - $show = 1; + $show=1; for($mypos=1;$mypos<5;$mypos++) { $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid); @@ -520,22 +530,45 @@ function output_exchanged_cards() $mypos==$povertypos1 || $mypos==$partnerpos1 || $mypos==$povertypos2 || $mypos==$partnerpos2 ) { + /* figure out if we gave trump back */ + $trump_back1=0; + if($povertypos2) + foreach($povertycards1 as $card) + { + if(is_trump($card)) + { + $trump_back1=1; + break; + } + } + $trump_back2=0; + if($povertypos2) + foreach($povertycards2 as $card) + { + if(is_trump($card)) + { + $trump_back2=1; + break; + } + } + + /* output vorbehalt */ echo "
Vorbehalt
\n"; if($show) echo " $usersick
\n"; + + /* output cards */ if($mypos==$partnerpos1) { - $trump_back=0; foreach($partnercards1 as $card) { - if(is_trump($card)) $trump_back=1; echo ' '; if($povertyhash1 == $me || $partnerhash1 == $me || $mystatus=='gameover') display_card($card,$PREF['cardset']); else display_card(0,$PREF['cardset']); } - if($trump_back) echo "Trump back"; + if($trump_back1) echo " Trump back"; } else if($mypos==$povertypos1) { @@ -547,6 +580,7 @@ function output_exchanged_cards() else display_card(0,$PREF['cardset']); } + if($trump_back1) echo " Trump back"; } else if($mypos==$povertypos2) { @@ -558,10 +592,10 @@ function output_exchanged_cards() else display_card(0,$PREF['cardset']); } + if($trump_back2) echo " Trump back"; } else if($mypos==$partnerpos2) { - $trump_back=0; foreach($partnercards2 as $card) { if(is_trump($card)) $trump_back=1; @@ -571,13 +605,12 @@ function output_exchanged_cards() else display_card(0,$PREF['cardset']); } - if($trump_back) echo "Trump back"; + if($trump_back2) echo " Trump back"; } echo "
\n"; - - if($mygametype == $usersick) - $show = 0; } + if($mygametype == $usersick) + $show = 0; } }