I’m working on yii project where i can create a food menu, which has multiple food categories and each category has multiple Dishes. Further these dishes have multiple prices (like small, medium and large).
I’ve created 4 tables for this.
[list=1]
[*]Menu
[*]Menu_categories
[*]Menu_dishes
[*]Dish_prices
[/list]
Menu table consists of menu_id, name, desc
Menu_categories table consists of category_id, menu_id,name,desc
Menu_dish consists of dish_id, category_id, name, desc
Dish_prices table consists of dish_id, size, prize
I’ve done adding dishes but i’m having trouble with dish prices. I trying to add all dishes’s pprice belonging to a menu at a time and eadch dish has multiple prices.
Please help me by providing the view and controller which can handle my requirement.
You have textboxes for one dish at time (description and price), so also a "save and new dish" button to insert again a dish and a "finished" button to terminate operation (simply to close the operation, because data has been saved before);
You have some rows with textboxes for insert many dish at time (for example 3 or 4), and a "+" button to add new textboxes (using jquery for example) and then an unique submit to save data;
But both solution are client side, Yii has little to do.