PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old June 9th, 2004, 02:29 PM
MrAnderson MrAnderson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 MrAnderson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP/MySQL Solution for product request routing

My company offers a video product free of charge to anyone who requests it. This product is distributed through regional representatives, and is available in VHS or DVD. I want to create a page using PHP and MySQL and a form that will allow the customer to simply enter their address, and select their preference of DVD or VHS. The page should then send an email request to the appropriate representative, based on the state that was entered on the form. I've created a table with the information linking each state to an email address, and I'm not sure how to proceed from here. My website is hosted on a server that supports PHP.

Reply With Quote
  #2  
Old June 10th, 2004, 10:10 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
What code have you gotten so far?

My recomendation would be this:

Start writing a pseduocode for what you want to do, start with a structure chart for what the program will need to do, then write the algorithm, you may even want to put together a flowchart for the runthru of the program and then try coding it from there

Reply With Quote
  #3  
Old June 10th, 2004, 10:34 AM
MrAnderson MrAnderson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 MrAnderson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I haven't actually started writing code yet, because I'm having difficulty in visualizing the overall process.

If I could figure out the major steps, I should have no problem writing the code.

What I have now is a request form which includes a place to enter the state (along with a complete mailing address), and a database table that defines an email address for each state. The final result that I'm looking for is an email that goes to the correct representative, which passes along the mailing address, and the custumer's preferred format of DVD or VHS.

Reply With Quote
  #4  
Old June 10th, 2004, 10:44 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
K.. any program does 3 things, input > process > output

you want to design your program backwards

output > process > input

you already know your final result so go from there. Write down the steps for everything, draw a chart of the steps that need to be taken, then write your code from there.

HTH

Reply With Quote
  #5  
Old June 18th, 2004, 03:12 AM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
Hi MrAnderson,

Or should I call you neo?

Here is the flow for your application:

1 - Create a DB called Regions
2 - Create table regions.states
3 - Create table regions.reps
4 - Create table regions.states_reps (relation)
5 - Create table regions.customers

The above is not written in stone. There are several ways to approach this.
It can be highly normalized or you can denormalize... depends on how you want
to work it.

Here is the way it should work:

Customer enters info -
- script matches input state to a state in regions.states_reps
- the above may produce multiples if you have more than one rep in a region
so you have to figure out how to handle this
a. Don't allow two reps to a region
b. Send e-mail to all reps in that region
c. Send e-mail to the first selected rep in the region
d. Let the script pick randomly if multiple matches come up
e. Put a counter in the table to count the times a rep got a lead -- the
next available rep that has the least amount of leads thus far would get
the next lead

- show the customer a thank you page and maybe even send them an e-mail
confirmation (this would be a good page to display your phone number as
well


Good Luck -- contact me if you need further help with this.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #6  
Old June 18th, 2004, 05:45 AM
MrAnderson MrAnderson is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 MrAnderson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for your help. And yes, Neo is fine.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP/MySQL Solution for product request routing


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway