function show_cards($user, $type) { global $db, $ir; $pcr = $db->query("SELECT * FROM videopoker WHERE userid='{$user}'", $c) or die(mysql_error()); $pcr2 = mysql_fetch_assoc($pcr); $c1 = $pcr2['c1n']; $c2 = $pcr2['c1s']; $c3 = $pcr2['c2n']; $c4 = $pcr2['c2s']; $c5 = $pcr2['c3n']; $c6 = $pcr2['c3s']; $c7 = $pcr2['c4n']; $c8 = $pcr2['c4s']; $c9 = $pcr2['c5n']; $c10 = $pcr2['c5s']; $card1 = return_cardpic($c1, $c2); $card2 = return_cardpic($c3, $c4); $card3 = return_cardpic($c5, $c6); $card4 = return_cardpic($c7, $c8); $card5 = return_cardpic($c9, $c10); if ($type == 1) { $firstfivecards = "<form action=videopoker.php?act=draw method=post><table>\n\t\t<tr><td align=center>{$card1}<br /><input type='checkbox' name='hold1' value=true><br />Hold?\n\t\t</td><td align=center>{$card2}<br /><input type='checkbox' name='hold2' value=true><br />Hold?\n\t\t</td><td align=center>{$card3}<br /><input type='checkbox' name='hold3' value=true><br />Hold?\n\t\t</td><td align=center>{$card4}<br /><input type='checkbox' name='hold4' value=true><br />Hold?\n\t\t</td><td align=center>{$card5}<br /><input type='checkbox' name='hold5' value=true><br />Hold?\n\t\t</td></tr></table><input type=submit value='Discard and Draw'></form>"; } else { $firstfivecards = "<table>\n\t\t<tr><td align=center>{$card1}\n\t\t</td><td align=center>{$card2}\n\t\t</td><td align=center>{$card3}\n\t\t</td><td align=center>{$card4}\n\t\t</td><td align=center>{$card5}\n\t\t</td></tr></table>\n\t\t<form action=videopoker.php?act=newdeal&bet={$pcr2['betAmount']} method=post>\n\t\t<input type=submit value='New Deal'></form>"; } return $firstfivecards; }
function show_cards($user, $type) { global $db, $ir; $pcr = $db->query("SELECT * FROM blackjack WHERE userid='{$user}'", $c) or die(mysql_error()); $pcr2 = mysql_fetch_assoc($pcr); //player $c5 = $pcr2['c6n']; $c6 = $pcr2['c6s']; $c7 = $pcr2['c7n']; $c8 = $pcr2['c7s']; $c9 = $pcr2['c8n']; $c10 = $pcr2['c8s']; $c11 = $pcr2['c9n']; $c12 = $pcr2['c9s']; $c13 = $pcr2['c10n']; $c14 = $pcr2['c10s']; //dealer $c1 = $pcr2['c1n']; $c2 = $pcr2['c1s']; $c3 = $pcr2['c2n']; $c4 = $pcr2['c2s']; $c15 = $pcr2['c3n']; $c16 = $pcr2['c3s']; $c17 = $pcr2['c4n']; $c18 = $pcr2['c4s']; $c19 = $pcr2['c5n']; $c20 = $pcr2['c5s']; $d1 = return_cardpic($c1, $c2, 'dealer1'); $d2 = return_cardpic($c3, $c4, 'dealer2'); $d3 = return_cardpic($c15, $c16, 'dealer3'); $d4 = return_cardpic($c17, $c18, 'dealer4'); $d5 = return_cardpic($c19, $c20, 'dealer5'); $u1 = return_cardpic($c5, $c6, 'player1'); $u2 = return_cardpic($c7, $c8, 'player2'); $u3 = return_cardpic($c9, $c10, 'player3'); $u4 = return_cardpic($c11, $c12, 'player4'); $u5 = return_cardpic($c13, $c14, 'player5'); $playerhas = calc_playerscore($user); $firstfivecards = "<table>\n\t<tr><th colspan=100%>Dealer</th></tr><tr><td align=center>"; if ($type == 1) { $firstfivecards .= "<img name='dealer1' src='images/cards/blankcard.gif'>"; } else { $dealerhas = calc_dealerscore($user); //$firstfivecards.="$d1"; $firstfivecards .= "<img name='dealer1' src='images/cards/blankcard.gif'>"; } $firstfivecards .= "</td><td align=center>{$d2}</td>"; $dhits = $pcr2['dNumHits']; if ($dhits >= 1) { $firstfivecards .= "<td align=center><img name='dealer3' src='images/cards/idontexist.gif'></td>"; } if ($dhits >= 2) { $firstfivecards .= "<td align=center><img name='dealer4' src='images/cards/idontexist.gif'></td>"; } if ($dhits >= 3) { $firstfivecards .= "<td align=center><img name='dealer5' src='images/cards/idontexist.gif'></td>"; } $firstfivecards .= "</tr>"; if ($type == 1) { $firstfivecards .= "<tr><td align=center colspan=100%>Dealer shows " . bjvardvalue($pcr2['c2n']) . ".</td></tr>"; } if ($type == 2) { $firstfivecards .= "<tr><td align=center colspan=100%><span id='txtstatus'>Dealer has " . bjvardvalue($pcr2['c2n']) . ".</span></td></tr>"; } $firstfivecards .= "\n\t<tr><td colspan=100%> </td></tr>\n\t<tr><th colspan=100%>Player</th></tr><tr>\n\t<td align=center>{$u1}</td>\n\t<td align=center>{$u2}</td>"; $hits = $pcr2['uNumHits']; if ($hits >= 1) { $firstfivecards .= "<td align=center>{$u3}</td>"; } if ($hits >= 2) { $firstfivecards .= "<td align=center>{$u4}</td>"; } if ($hits >= 3) { $firstfivecards .= "<td align=center>{$u5}</td>"; } $firstfivecards .= "</tr><tr><td align=center colspan=100%>Player has {$playerhas}.</td></tr></table>"; return $firstfivecards; }