Adamhumbug Posted February 9, 2019 Share Posted February 9, 2019 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 Quote Link to comment Share on other sites More sharing options...
gw1500se Posted February 9, 2019 Share Posted February 9, 2019 It sounds like you are asking about sessions. Quote Link to comment Share on other sites More sharing options...
Adamhumbug Posted February 9, 2019 Author Share Posted February 9, 2019 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? Quote Link to comment Share on other sites More sharing options...
gw1500se Posted February 9, 2019 Share Posted February 9, 2019 Yes, sessions can be persistent. See session.cookie_lifetime. Quote Link to comment Share on other sites More sharing options...
Adamhumbug Posted February 9, 2019 Author Share Posted February 9, 2019 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? Quote Link to comment Share on other sites More sharing options...
gw1500se Posted February 9, 2019 Share Posted February 9, 2019 You are going to let other users change a particular user's selection? Quote Link to comment Share on other sites More sharing options...
Adamhumbug Posted February 9, 2019 Author Share Posted February 9, 2019 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. Quote Link to comment Share on other sites More sharing options...
Barand Posted February 9, 2019 Share Posted February 9, 2019 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." Quote Link to comment Share on other sites More sharing options...
ginerjm Posted February 9, 2019 Share Posted February 9, 2019 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. Quote Link to comment Share on other sites More sharing options...
Adamhumbug Posted February 9, 2019 Author Share Posted February 9, 2019 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 Quote Link to comment Share on other sites More sharing options...
Adamhumbug Posted February 9, 2019 Author Share Posted February 9, 2019 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. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted February 9, 2019 Share Posted February 9, 2019 "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? Quote Link to comment Share on other sites More sharing options...
Barand Posted February 9, 2019 Share Posted February 9, 2019 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 | +----------------+ Quote Link to comment Share on other sites More sharing options...
seoswaqny Posted February 17, 2019 Share Posted February 17, 2019 i think you shuold check your session.cookie Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.