Tag: Script Php
PHP Coffee Mug v1.0
by Stephen Blair on Apr.24, 2009, under A PHP Life
A co-worker and myself went to Starbucks today where I decided that I really could use an office coffee mug to keep at work. I of course chose the largest mug they had which also just happens to come with a porcelain pen that you can use to write on it and eventually heat treat to make permanent. As I was sitting here writing code for work I was also thinking about what clever sayings or cool pictures I could put on my new coffee mug. The mixture of work and play came out as a random coffee mug php script I have come to label as “PHP Coffee Mug v1.0″.
I hope you enjoy my random and utterly useless coffee mug script!
// PHP Coffee Mug v1.0 | Stephen R. Blair | www.srblair.com
require_once('coffee_cup.php');
if($coffeeCup == empty) {
//Check to see if there is a fresh pot of coffee
if($coffeePot != 'fresh') {
//Make a fresh pot of coffee
makeCoffee();
} else {
//Pour coffee into the coffee cup
pourCoffee();
//Drink the coffee!
drinkCoffee();
}
} else {
//Check the date for the coffee in the mug
if($date > $dateExpire) {
//Rinse out the cup if it is old coffee
rinseCup();
//Check to see if there is a fresh pot of coffee
if($coffeePot != 'fresh') {
//Make a fresh pot of coffee
makeCoffee();
} else {
//Pour coffee into the coffee cup
pourCoffee();
}
} else {
//The coffee is fine, drink it!
drinkCoffee();
}
}


















