Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP Code Design questions

Posted on 2011-02-27
3
Medium Priority
?
291 Views
Last Modified: 2013-11-13
Hi Experts,
Please provide code for following question.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
ABC Buses has recently taken delivery of a fleet of 50 buses and has decided to create an automated timetabling system to replace the manual one they have now.

Requirements
•      Staff need to be able to create/update/delete: buses, bus stops and routes.
•      Each bus entered has a number.
•      Each bus stop has a name e.g. ‘Federation Sq.’
•      Each route has a bus with a departing time+stop and an arrival time+stop (time must be in 24hr format) eg Bus 1 leaves Stop ‘Federation Sq’ at 14:00 and arrives at Stop ‘Flinders Station at 16:00’.
•      Staff need to be able to see a printout of all routes in this format
•      DEPART_STOP ARRIVAL_STOP  BUS_NUMBER START_TIME END_TIME TIME


Staff would also like the facility to calculate the shortest route between 2 stops by entering a depart stop+time and an arrival stop; and receive a print out like such

Starting at stop DEPARTING_STOP
Take HH:MM Bus Y to stop Z
Take HH:MM Bus A to stop B
Arrive at stop ARRIVAL_STOP at HH:MM

Note: There is the possibility that no route is possible.
----------------------------------------------------------------------------------------------------------------------------------------------------------------

BR Dushan
0
Comment
Question by:Dushan De Silva
3 Comments
 
LVL 9

Expert Comment

by:AnilKumarSharma
ID: 34994498
Dushan911 , What I think you are requesting a full application (as you asked Please provide code ) rather then PHP code design (as given in question heading). We can help you in any technical area or problem you are struggling to find a solution. It is very uncommon to write a whole new application. Expert are here for helping you and not working full time to make some application on request. That is why it is a question answer type session/forum rather then request a application-code and application-code selected forum.
0
 
LVL 17

Author Comment

by:Dushan De Silva
ID: 34994519
I'm sorry about that, could you kindly give me an idea, how can I start (design) , writing to a text file(like with arrays) or database approach.
0
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 2000 total points
ID: 34997035
Use databases. For any serious level of data storage, using text files is silly.

Design the database FIRST then code the PHP.

When designing the dtaabase ensure that you make your tables conform to 1st, 2nd and 3rd Normal Form ( http://en.wikipedia.org/wiki/Database_normalization#Normal_forms ). If you don't do this then you may as well not bother developing the code at all. Normal forms are incredibily important at promoting production of good code.

Once you have the database designed then identify the functions your system needs to provide and these will provide the coding units needed to access the database. So setting a route may involve one or more depots, a bus, a calendar, and so forth but a route needs creating, updating and deleting so create a route class that can do those things using the relevant tables.

Finally write the main application code to glue your classes together with HTML and CSS.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Introduction to Processes
Suggested Courses
Course of the Month5 days, 18 hours left to enroll

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question