PHP Code Design questions

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
LVL 17
Dushan De SilvaTechnology ArchitectAsked:
Who is Participating?
 
Beverley PortlockConnect With a Mentor Commented:
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
 
AnilKumarSharmaCommented:
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
 
Dushan De SilvaTechnology ArchitectAuthor Commented:
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
All Courses

From novice to tech pro — start learning today.