Looking for a solution - php noob.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

kemph
Forum Newbie
Posts: 5
Joined: Mon Sep 27, 2004 2:44 pm

Looking for a solution - php noob.

Post by kemph »

I am new to the world of php and wanted to give you my scenario and see if anyone could shed some light on how I should go about it.

An organization wants me to create an online application where a user comes in, registers, and fills out a quick application. THEN after they complete the application they will need to select a time slot to interview during a set time slot given.

I do not know how to go about the time slot scenario...

Again, new to php so if you have any urls or how-tos dealing with something like this I would greatly appreciate it!

Thanks,
K
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'd bet hotscripts has something that does similar things you could modify..
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

I don't think you can just look for a code, you will have to learn the language first before going any further. Not only will you require knowledge on PHP but you will need some general database programming knowledge aswell.
kemph
Forum Newbie
Posts: 5
Joined: Mon Sep 27, 2004 2:44 pm

Post by kemph »

Joe wrote:I don't think you can just look for a code, you will have to learn the language first before going any further. Not only will you require knowledge on PHP but you will need some general database programming knowledge aswell.
I have coded in PHP and I have connected using MySQL. I understand the code, I just am not sure how to go about this particular project.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

break it into pieces and do the individual pieces.. each piece is a class or function, generally..
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Well I think for a project such as this all you would really need to know is how to insert data into the database. By this I mean "POST" all of the html elements into the mysql db after the user submits from the html application form. Most of the work would be in html/xhtml/css or whatever you decide to use.
kemph
Forum Newbie
Posts: 5
Joined: Mon Sep 27, 2004 2:44 pm

Post by kemph »

Joe wrote:Well I think for a project such as this all you would really need to know is how to insert data into the database. By this I mean "POST" all of the html elements into the mysql db after the user submits from the html application form. Most of the work would be in html/xhtml/css or whatever you decide to use.
Yes, I have planned to simply have a form to post all the information into the db, but I cannot figure out how to set up on the db for the interviews.

I have thought that on the db create a field for each time slot available and then display each field on the page and if they try to select a field that has already been taken (or value = 1) then ask them to select again. I just dont know how to go about building this... any suggestions?
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

As for the planning you should sit with a pen and paper and think about it. My recommendation would be a structure like:

|_
| firstname
|_
| lastname
|_
| address
|_
| postcode
|_
| phonenumber
|_
| dateofinterview

If the user enters a time which has already been taken or whatever you will have to work a bit with php.

8)
kemph
Forum Newbie
Posts: 5
Joined: Mon Sep 27, 2004 2:44 pm

Post by kemph »

Joe wrote: If the user enters a time which has already been taken or whatever you will have to work a bit with php.
Here's my problem, again. I haven't jumped into enough php to know how to do this.
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Well the best advice I can give you kemph is to either learn more php or hire a programmer if you need it asap.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'd suggest not allowing them to actually enter the time themselves.. instead have buttons or table cells that are clickable for the time slots you have available.. all other used or blocked slots wouldn't be clickable.
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

feyd wrote:I'd suggest not allowing them to actually enter the time themselves.. instead have buttons or table cells that are clickable for the time slots you have available.. all other used or blocked slots wouldn't be clickable.
That would take alot of time for a newcomer though!.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

not really... you know the time alotments, you can easily build an interval to know how many slots to create, what times to block out for lunch or whatever..

just need to take it in small steps.. play with the time functions in the database, or php's.. if you need to dynamically create these time slot windows.. otherwise, you can just hard code the slot locations.. then just need a database table to know if an time x is already taken to not have it clickable.
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Yeah and you can use classy calendars so the user knows times and days by using:

Untested

Code: Select all

shell_exec("cal 2004");
Just thought I should mention :P
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I wouldn't use the calender command line ;)
Post Reply