views:

89

answers:

2

Apparently there was confusion as to my original post so let me start over:

I am essentially creating an online shopping cart which gives a manager the ability to enroll his/her employees for training services which we provide. We charge $49 for the services for every employee enrolled. The primary difference between this and a traditional shopping cart however is that we must collect a solid amount of data about 'each' employee enrolled in the program - and this information is provided by the employer at the time of registration/purchase.

As a manager, I enter my personal information and then select how many employees I want to enroll. I currently have the site set up to handle 7 employees but actually need it to handle up to ~30. The issue I am having is the lack of dynamic ability and huge file sizes (especially in on the validation) I am running into.

Each fighter's information is passed and stored in session super globals such as: $_SESSION['F1Firstname']; and $_SESSION['F1SSN3']; and so on. I dont want to use javascript (and won't) to 'add another Enrollee' button because this can be turned off easily on the client side.

My assumptions are this:

1) I must be able to dynamically add variables to each new fighter so they may be stored in an online database and then passed along to our testing center - for example, emplotyee 1's name is F1FirstName; employee 12's Date of Birth is F12DOB1 and so on.

2) The validation for each employee will be the same based on each individual field (all first names must pass the same test). The validation for all email address must past the same email validation test and so on. If I simply build this by each individual record the validation file will be very large. I am thinking I need to add a Firstname array somehow but I'm not entirely sure.

3) I need this to be scalable that in the sense, I want a manager to enroll up to 100 employees, he/she can.

4) As I mentioned, this is like a shopping cart so a manager is enrolling all employees at once so they can pay for ALL of their employees in a single transaction.

Anybody got any ideas?

A: 

You can generate additional fields as needed by javascript. just provide a button 'add boxer' and there wouldn't have to be a lot of hidden fields.

praksant
Thank you for the suggestion - I toyed with this idea, however: 1) if javascript is disabled this doesn't work2) if I did use javascript, i would still have to dynamically 'name' each field with each additional boxer added on (for example, 3 are enrolled, manager clicks 'add another boxer' and 8 new fields are presented (with field names being updated as "F4FirstName", "F4LastName" and I'm not sure how to do this.
JM4
A: 

If you're a "fairly new programmer" the best way would probably be to just have a form to input 1 fighter at a time. Not to mention this would be a lot more user friendly.

Galen
This doesn't answer the question at all. One user at a time doesn't get past the point of what I'm trying to do. Whether it is one fighter or 10,000, the manager is 'enrolling' several fighters at once and paying for them all at once. Your suggestion would be similar to buying groceries at the store and only being able to purchase 1 item at a time with my credit card so this won't work.
JM4
Your comment says more than your actual question. You should edit your question and add this. As you can see people are very confused by your question, including me.
Galen