Jump to content
Adamhumbug

Check if textbox is different from database field

Recommended Posts

I am building a system where people are able to choose a food menu, they can modify each dish if needed and then say how many of each item they need for the order.

So when they pick the breakfast menu, it selects all starters, mains and desserts.  Should something need to be edited (sausages changed to vegitarian sausages) the user should be able to overtype what has been populated from the select statement)

When the form is submitted, the order needs to be linked to the current job which is in a field ssm_job.job_id but the changes to the menu items need to be stored somewhere for the current order only.  This obviously needs to be accessile later so further changes can be made if needed.  I am not sure of the best way to go about this as i am trying not to save every item in another database (just trying to be tidy)

Any advise on this would be greatly appreciated.

I have had help on this project in relation to an sql and the background can be found below, the help has been amazing but as this is a very different question i thought i would start a new thread.

 

Kind Regards

Share this post


Link to post
Share on other sites
Just now, gw1500se said:

It sounds like you are asking about sessions.

If i store it in a session though, when the user logs back in and comes to make chnages the sessiona will have been killed.  Or am i missing something?

Share this post


Link to post
Share on other sites
1 minute ago, gw1500se said:

Yes, sessions can be persistent. See session.cookie_lifetime.

What if another user logs in and needs to amend the menu that the first user changed.  They would then need all of that session data?

Share this post


Link to post
Share on other sites

You are going to let other users change a particular user's selection?

Share this post


Link to post
Share on other sites
6 minutes ago, gw1500se said:

You are going to let other users change a particular user's selection?

Yes, they are not ordering food for themselves, they are ordering it for an event.

Share this post


Link to post
Share on other sites

How far can they go with changing the dish?


"I want a full English breakfast, but I'd like roast potato instead of hash browns, roast turkey instead of bacon, chipolatas instead of sausage, carrot puree instead of mushrooms, cranbery sauce instead of tomato, sprouts instead of baked beans and some gravy instead of eggs.
Toast and marmalade? No thanks, I'll have Christmas pudding with rum-flavoured white sauce."

Share this post


Link to post
Share on other sites

When you talk about the user changing the food selection, why is that new choice not part of your database already?  If you are going to 'offer' it as an option, why is it not listed for the user to select in the first place?  That would solve what appears to be a big problem at the moment.

Share this post


Link to post
Share on other sites
40 minutes ago, Barand said:

How far can they go with changing the dish?


"I want a full English breakfast, but I'd like roast potato instead of hash browns, roast turkey instead of bacon, chipolatas instead of sausage, carrot puree instead of mushrooms, cranbery sauce instead of tomato, sprouts instead of baked beans and some gravy instead of eggs.
Toast and marmalade? No thanks, I'll have Christmas pudding with rum-flavoured white sauce."

Yes pretty much, they will have the option to change all or part of the menu

Share this post


Link to post
Share on other sites
27 minutes ago, ginerjm said:

When you talk about the user changing the food selection, why is that new choice not part of your database already?  If you are going to 'offer' it as an option, why is it not listed for the user to select in the first place?  That would solve what appears to be a big problem at the moment.

when making the order, they may agree with the client a special menu package.  This may have small one off changes.

 

The menu items can be pretty long.

Herb crusted Marinated Rump of Lamb, served with petit pois a la francese, roasted baby potato, blistered cherry tomatoes, rich lamb jus

They may only want to change roasted to boiled.

The chnages should not be selectable by default.

Share this post


Link to post
Share on other sites

"The ch(an)ges should not be selectable by default".  

What does that mean?  Apparently we already are to assume that you don't have them in your list of available food choices, so what does this sentence tell us?

Plus - with all of these possible changes what is the app supposed to actually accomplish for you?  Aren't you simply going to pass along the customer's order to the kitchen staff, either manually or via a computer screen, as the diner has specified?

Share this post


Link to post
Share on other sites

Seems like your database got bigger

+-----------------+                                                
|     menu        |                                                
+-----------------+                              
|  menu_id        |--+                                             
|  description    |  |                                 
+-----------------+  |                                      
                     |                         
                     |     +-----------------+   
                     |     |  menu_dishes    |   
                     |     +-----------------+   
                     +----<|  menu_id        |         +-------------------+
                           |  dish_id        |>--+     |     dish          |
                           +-----------------+   |     +-------------------+
                                                 +----<|  dish_id          |----+      +----------------+
                           +-----------------+         |  name             |    |      | ingredient     |
                           |  course         |    +---<|  course_id        |    |      +----------------+
                           +-----------------+    |    +-------------------+    |      | ingred_id      |----+
                           |  course_id      |----+                             +-----<| dish_id        |    |     +----------------+
                           |  description    |                                         | name           |    |     | substitute     |
                           +-----------------+                                         +----------------+    |     +----------------+
                                                                                                             |     | sub_id         |
                                                                                                             +----<| ingred_id      |
                                                                                                                   | new_item_desc  |
                                                                                                                   | event_id       |
                                                                                                                   +----------------+

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.