I'm building the back-end for an MMORPG database website that I'm developing. One example of what I'm trying to do is Equipment Sets. Each set has certain equipment that, when a character wears more than one piece, provide bonuses. Here are the related tables:
Expand|Select|Wrap|Line Numbers
- # Equipment
- id | equipment_set_id | name | gender | class | ...
- # Equipment Set
- id | name | gender | class
- # Equipment Set Bonuses
- id | equipment_set_id | pieces | attribute_id | attribute_value
- # Attributes
- id | name
I use CodeIgniter as my framework. It's controllers are a series of methods, and all back-end database elements have a controller with CRUD methods. I want to be able to edit the Equipment Set Bonuses through the Equipment Set screen. I cannot technically edit Equipment Set Bonuses without first defining an Equipment Set to add them to (at least without my back-end becoming very unorganized).
Ideally, I'd want to be able to build a table of Equipment Set Bonuses that I can add to, edit, and remove from. But, i set up all of my controllers to be built dynamically. I set the model to use, the form elements to build, and it basically handles itself from there. I'd want to do the same for Equipment Set Bonuses, but only make it accessible when an Equipment Set ID was set (or when a new one is being built).
I don't think I'd want to use AJAX, since the Equipment Set has no ID until after it is created, and I'd want to be able to add the bonuses prior to creating the full Equipment Set. I'm having a tough time doing this elegantly (technically, at all lol).
Any ideas?