What I was working on today. 10 replies

  • 1
  • 2

Please wait...

Tango Protocol

Master of my own domain

50 XP

18th July 2003

0 Uploads

8,283 Posts

0 Threads

#1 12 years ago

This screenshot just contains debug information (and I know the color scheme is horrible, it's a temporary one that I did not set in the first place) mixed in with what users will see when it goes live.

Basically... at the FLL tournament that we host during lunch break, the people come to our lunch stands and there is a longggg line to buy snacks, food, etc. So a few years okay, we started accepting pre-ordering so teams can pre-order their food weeks in advanced.. then come the competition.. they just skip the line and pick up their food.

Well, until now.. it's all been manually done. The teams would email us and tell us what they want. But with what I am doing, it's all going to be done via a web interface.

snapshot1wk9.png

Of course there will be more food items to choose from, but these are just test items. Teams can choose any amount between 0-15 for each item.. (Teams have at most 10 kids per team, plus one or two adults.. but we want them to have the ability to get extras and stuff.

The giberish you see right flush below Confirm Your Order is a serialized array. an array is a type of information that holds information together. If you convert this serialized array back to a real array, it'd look like this

[0] food_ID => 3 quantity => 6 [1] food_ID => 4 quantity => 2

Cool huh?




PC Chipmunk VIP Member

Please don't kick.

50 XP

9th July 2005

0 Uploads

7,866 Posts

0 Threads

#2 12 years ago

You geek :p




Tango Protocol

Master of my own domain

50 XP

18th July 2003

0 Uploads

8,283 Posts

0 Threads

#3 12 years ago

That's what my girlfriend calls me :D




the1chaos VIP Member

I pretend to do stuff.

100,595 XP

16th January 2004

0 Uploads

9,047 Posts

0 Threads

#4 12 years ago

Javascript or php? (Only seeing a submit button, and not knowing if there's a previous page, who knows? Knowing you, I'm going with full-php though.)




Tango Protocol

Master of my own domain

50 XP

18th July 2003

0 Uploads

8,283 Posts

0 Threads

#5 12 years ago

Haha, it's all PHP based. There will be a second submit button when I get around to it. It doesnt show the confirm until an order is placed.

It's: Place Confirm Awaiting approval Successful order.

when the order confirmed, it'll be added to the database using the serialized array as the reference text.




Tango Protocol

Master of my own domain

50 XP

18th July 2003

0 Uploads

8,283 Posts

0 Threads

#6 12 years ago

[php] function Food_Info($food_ID) { $query = mysql_query("SELECT * FROM `fll_food_food` WHERE `ID` = '$food_ID'"); return mysql_fetch_array($query, MYSQL_ASSOC); } function Food_From_Menu($menu_ID) { $query = mysql_query("SELECT * FROM `fll_food_food` WHERE `menu_ID` = '$menu_ID'"); while ($row = mysql_fetch_array($query, MYSQL_ASSOC)) { $return[$row['ID']] = Food_Info($row['ID']); } return $return; } function Menu_Info($menu_ID) { $query = "SELECT * FROM `fll_food_menu` WHERE `ID` = '$menu_ID'"; $queryexec = mysql_query($query); while ($row = mysql_fetch_array($queryexec, MYSQL_ASSOC)) { $return['ID'] = $row['ID']; $return['name'] = $row['name']; $return['sequence'] = $row['sequence']; $return['display'] = $row['display']; $return['items'] = Food_From_Menu($row['ID']); } return $return; } function All_Menus() { $query = mysql_query("SELECT * FROM `fll_food_menu` ORDER BY `sequence` ASC"); while ($row = mysql_fetch_array($query)) { $return_values[$row['ID']] = Menu_Info($row['ID']); } return $return_values; } [/php]




Guest

I didn't make it!

0 XP

 
#7 12 years ago

Basically the same thing FIRST does at their tournaments. Neato Skeato.




the1chaos VIP Member

I pretend to do stuff.

100,595 XP

16th January 2004

0 Uploads

9,047 Posts

0 Threads

#8 12 years ago

I should really start working with arrays more. The mysql_result($Result,$Counter,"Name"); stuff is always clutering up my code. :uhm:




Tango Protocol

Master of my own domain

50 XP

18th July 2003

0 Uploads

8,283 Posts

0 Threads

#9 12 years ago

What i do.. is if i am expecting multiple results from a DB query i do this

$query = mysql_query("query here");

while ($row = mysql_fetch_array($query) { echo "ID: " . $row['ID'] . "
\n"; }




Tango Protocol

Master of my own domain

50 XP

18th July 2003

0 Uploads

8,283 Posts

0 Threads

#10 12 years ago
AfterburnerBasically the same thing FIRST does at their tournaments. Neato Skeato.

Exactly.

And since it's a FIRST organization and a FIRST sponsored tournament.. :p yayyy




  • 1
  • 2