Wednesday, July 20, 2011

Schedule Creator Revisited

I finished the visual aspects of my schedule creator tool earlier this summer. I never got around to actually making it work though, since that would require PHP. Instead I went and learned PHP and then created my dynamic data table.

Since that is finished, I'm turning my sites back to the schedule creator. I pulled up my color bed test page, dusted it off, and added a submit button.

The end goal is to have the user click the submit link, which will lead to a "results" PHP file, which will appear as a plain HTML file to the user. The user will save the file as their schedule file to be placed directly into their schedule folder of their ICS webspace template. The PHP file will be reusable, it'll just re-write itself for everyone, but never actually change itself.

Breaking this down, there are three problems which have to be overcome. One, create an array in which every color cell is accounted for, with their background colors. Two, send that array to the PHP document. Three, write out the table using that array.

Part one is now done, it took me about an hour, because I had to figure a couple things out. I ended up keeping the ID constant for all color blocks, and then gave each an individual class. This is backwards of normal web development, but it's easier to get a class using jQuery than it is to get an ID. One other problem is that you can't start an ID or a class with a number. So each one got a class of "block#". Then I parsed that string to get just the number, and placed it in the array each time a color block was clicked.

Part two is what I'm looking at now, and that will be the most difficult part I think. Once I have the array in PHP, displaying it will be simple.
 

No comments:

Post a Comment