Where to next?

I’ve been writing function oriented PHP for over a decade… it’s always done what I want it to do (more or less)… but I decided, this time I’m going to go for OOP and a framework. Yii looks better than all the others and so far, it has been awesome. I’ve created a data structure to hold data for an annual report which multiple chapters of an organization have to fill out every year.

I’ve structured the data like this:

Using Gii, I’ve got nice really nice crud pages which I then modified to pick up fields from other tables, etc. But now I’m not sure what to do regarding combining this all into a usable form for a user. Here’s what I envision:

  1. When a user logs in, they will be directed to their chapter’s “dashboard.” That dashboard will contain a list of categories which will each have a “completion percentage” as a percentage of completed subtasks for that chapter in that category… I can write that SQL… but I’m not sure if I create a new view within category? a site page? a whole new mvc for something called dashboard?

  2. When a user clicks on a category, it opens a list of the tasks for that category, each task expandable with subtasks (subtask table) below each task (task table) (hell, doesn’t even have to be expandable) and a checkbox (subtask_status.complete BOOLEAN) next to each subtask. Once again, where do I put something like this? Do I leverage the models for each of these tables to create some sort of single model or do I leverage the models only within a view of some sort?

I’ve gotten a pretty good feel for altering the crud files created by gii, and for making individual pages and using extensions… just trying to feel my way along to the next step.

I’ll be interested in the replies because I’m at a similar state with my app.

I am also doing a simple dashboard as the main page of my app. While I haven’t done much with it yet, the strategy overall will be to load up several models and push that data to a main view, which will then push out parts to ‘subviews’ using renderPartial. Each subview will be its own ‘container’ so it can be moved/styled with css.

Your second question - are you asking in context of filling out a form or in displaying the content as a report?

For the reporting of my app I am using a separate reporting controller that fetches the data in a more readable way. Nothing more to say on that because its not built yet.

I’m assuming that a model of the combined data would be used for both displaying the data and in form creation. The input would be the chapter id, report year and category id. The chapter id and report year would be held in session (each alterable by the user depending on access control) and the category would likely be a get variable.