Welcome to Coffee Bitch - the office coffee maker selector!

Coffee Bitch was created to help settle the age-old argument of who has to make the coffee for everyone in the office.

Rather than resort to arguments, sulking, or all out fighting, let Coffee Bitch take the guesswork out of who has to get the kettle on and the brews in!

Confused? You can read more about what exactly Coffee Bitch is here.

Log in

Select your group: 0) { print ''; } ?>
Enter your group password:
Sorry the details you entered were incorrect. Need a reminder?

Don't have a group set up? Use the sign up page to set up a free account.

Brew Confirmed!

Thanks for using Coffee-Bitch - the easy way to choose who has to get the kettle on!

0) { while ($r = mysql_fetch_assoc($findit)) { if (!$firstrun_flag) { if (($r['made'] == 0) and ($r['drank'] == 0)) $last_update = time()-86400; } else $firstrun_flag = true; if (!$last_update) $last_update = strtotime($r['last_mirror_update']); if ($ts >= $last_update) { if ($chosen == $r['id']) { $made = $r['made'] += $numbitches; $drank = $r['drank'] + 1; $q = "UPDATE $Database.$Table SET drank='$drank', made='$made' WHERE id='$r[id]'"; if ($live_mode) mysql_query($q); $q = "INSERT INTO $Database.$TableStats (`group`, `name`, `drank`, `made`) VALUES (\"$cbgroup\", \"$r[name]\", \"1\", \"$numbitches\")"; if ($live_mode) mysql_query($q); print "

$r[name] (the unlucky) has made $made and drank $drank coffees!

"; } else { $drank = $r['drank'] + 1; $q = "UPDATE $Database.$Table SET drank='$drank' WHERE id='$r[id]'"; if ($live_mode) mysql_query($q); $q = "INSERT INTO $Database.$TableStats (`group`, `name`, `drank`, `made`) VALUES (\"$cbgroup\", \"$r[name]\", \"1\", \"0\")"; if ($live_mode) mysql_query($q); print "

$r[name] has made $r[made] and drank $drank coffees!

"; } } else { print "

$r[name] has made $r[made] and drank $r[drank] coffees!

"; } } } } } elseif ($_POST['make'] != 'coffee') { ?>

Coffee Bitch

Who's in this round?

0) { $js = ''; while ($r = mysql_fetch_assoc($findit)) { print "

$r[name]

"; $js .= "document.getElementById('cb_$r[id]').checked = cval;\n"; } ?>

check all, uncheck all

Choosing a bitch...

'; $cb = $_POST['cb']; $in = ''; $postvar = ''; foreach ($cb as $dummy=>$id) { if ($in != '') { $in .= ', '; $postvar .= ','; } $in .= "'$id'"; $postvar .= $id; } if ($in) { $js = ''; $bitches = array(); $findit = mysql_query("SELECT * FROM $Database.$Table WHERE id IN ($in)"); if (mysql_num_rows($findit) > 0) { while ($r = mysql_fetch_assoc($findit)) $bitches[] = $r; // choose! $chosen = false; $numbitches = count($bitches); $ratios = array(); $lowest = false; // calculate ratio start point for ($i=0; $i<$numbitches; $i++) { if ($lowest == false) $lowest = $bitches[$i]['made']; if ($bitches[$i]['made'] < $lowest) $lowest = $bitches[$i]['made']; if ($bitches[$i]['drank'] < $lowest) $lowest = $bitches[$i]['drank']; } if ($lowest > 1) { $lowest = intval($lowest / 2); } else $lowest = 0; for ($i=0; $i<$numbitches; $i++) { if ($lowest > 0) { $bitches[$i]['drank'] = $bitches[$i]['drank'] - $lowest; $bitches[$i]['made'] = $bitches[$i]['made'] - $lowest; } $ratios[$i] = abs(($bitches[$i]['drank'] / ($bitches[$i]['made']+1)) + 0.01) * 8; if ($ratios[$i] <= 5) $ratios[$i] += 5; } $counter = 0; while ($chosen == false) { $tbl = ''; for ($i=0; $i<$numbitches; $i++) { if ($chosen == false) { $bitches[$i]['total'] += $ratios[$i] * mt_rand(0, 2); } if ($bitches[$i]['total'] > 200) { $chosen = true; $col = '#ff0000'; } else $col = '#0000ff'; $n = split(' ', $bitches[$i]['name']); $nn = $n[0]; $tbl .= ''; } $tbl .= '
' . $nn . '
 
'; $wait = ($counter * 300) + 10; $counter++; $js .= "setTimeout(\"$('#bitch_table').html('$tbl')\", $wait);\n"; } $wait = ($counter * 300) + 250; $js .= "setTimeout(\"$('#bitch_confirm').slideDown('slow').fadeIn('slow')\", $wait);\n"; // find biggest! $chosen = 0; $unlucky = false; for ($i=0; $i<$numbitches; $i++) { if ($bitches[$i]['total'] > $chosen) { $chosen = $bitches[$i]['total']; $unlucky = $i; } } if ($unlucky !== false) { ?>
Choosing...

And the results are in...


"; for ($i=0; $i<$numbitches; $i++) { if ($i == $unlucky) $size = '19px'; else $size = '13px'; // print "

" . $bitches[$i]['name'] . ' (' . intval($bitches[$i]['total']); if ($i == $unlucky) { print "

" . $bitches[$i]['name'] . ' - UNLUCKY!!!  

'; } // else print ")

"; } print '

The Coffee Bitch selector has spoken!!

Once ' . $bitches[$unlucky]['name'] . ' agrees to make the brews, click the \'confirm\' button to update the stats!

If the "bitch" refuses or made drinks last time, hit your browser\'s "refresh" to re-roll - that\'s just not cricket though!'; print ''; } } } } else print 'Eh? You must choose some bitches! go back'; footer(); ?>