0) { foreach($bettee_id as $i => $bettee) { if ($private == '') { $private = '0'; } if ($infinite_sub == 'yes') { $num_subway = -99; } if ($infinite_cook == 'yes') { $num_cookie = -99; } if ($double_meat == 'yes') { $meat = '1'; } else { $meat = '0'; } if ($num_subway == '') { $num_subway = 0; } if ($num_cookie == '') { $num_cookie = 0; } $now = "SELECT NOW()"; $result = mysql_query($now); list($date) = mysql_fetch_row($result); $insert_sql = "INSERT INTO bets (better_id, bettee_id, description, subways, cookies, double_meat, status, timestamp, private) VALUES (" . $_SESSION['user_id'] . ", " . $bettee . ", '" . $description . "', " . $num_subway . ", " . $num_cookie . ", '" . $meat . "', 1, '" . $date ."', '" . $private . "')"; $result = mysql_query($insert_sql) or die ('error adding bet' . mysql_error()); $bet_sql = "SELECT bet_id FROM bets WHERE timestamp = '" . $date . "' AND better_id = " . $_SESSION['user_id'] . " AND bettee_id = " . $bettee; $bet_result = mysql_query($bet_sql) or die ('error finding bet' . mysql_error()); $better_sql = "SELECT userName, email FROM users WHERE user_id = " . $_SESSION['user_id']; $better_result = mysql_query($better_sql) or die ('error getting better info' . mysql_error()); $bettee_sql = "SELECT firstname, email FROM users WHERE user_id = " . $bettee; $bettee_result = mysql_query($bettee_sql) or die ('error getting bettee info' . mysql_error()); list($firstName, $bettee_email) = mysql_fetch_row($bettee_result); list($userName, $better_email) = mysql_fetch_row($better_result); list($bet_id) = mysql_fetch_row($bet_result); $msg = "Dear " . $firstName . ",\n\n" . $userName . " has proposed a bet. The bet is: \n\n" . html_entity_decode($description) . "\n\n...you would owe: "; if ($num_subway <> 0) { if ($num_subway == -99) { $msg = $msg . " INFINITE subways"; } else { $msg = $msg . $num_subway . " subways"; } } if ($meat == '1') { $msg = $msg . "(double the meat)"; } if ($num_cookie <> 0) { if ($num_cookie == -99) { $msg = $msg . " and INFINITE cookies"; } else { $msg = $msg . " and " . $num_cookie . " cookies"; } } $msg = $msg . "."; $msg = $msg . "\n\nTo ACCEPT this bet as is, go to:\n\nhttp://" . $_SERVER['SERVER_NAME'] . "/subway/bet.php?bet_id=" . $bet_id . "&action=Accept&submit=yes\n"; $msg = $msg . "\nTo REJECT this bet, go to:\n\nhttp://" . $_SERVER['SERVER_NAME'] . "/subway/bet.php?bet_id=" . $bet_id . "&action=Reject&submit=yes\n"; $msg = $msg . "\nTo NEGOTIATE and make a counteroffer for this bet, go to:\n\nhttp://" . $_SERVER['SERVER_NAME'] . "/subway/bet.php?bet_id=" . $bet_id . "&action=Negotiate\n"; $success = imap_mail($bettee_email, "You have a new Subway bet!", $msg, "From: " . $better_email) or die("problem sending email"); mysql_free_result($bet_result); mysql_free_result($better_result); mysql_free_result($bettee_result); $error = true; $error_msg = "Your bet has been recorded and your betting partner(s) have been emailed."; } } else { $error = true; $error_msg = "You must select at least one betting partner!"; } } ?> voodoochild.org

voodoochild.org

subway betting zone - new bet


 
 
Select a user.

This is the person that will owe you if they accept the bet and the conditions become true.

Multiple users can be selected by holding down CTRL while clicking.

Make this bet private? 

If checked, this will not allow anyone besides you and your betting partner to see this bet while viewing your profile.

 
Enter the conditions of the bet:
 
Enter # Subways: Double the meat?
Or, click here for INFINITE subways:    
 
Enter # Cookies:
Or, click here for INFINITE cookies: