Solved

PHP Code Design questions

Posted on 2011-02-27
3
279 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:Dushan911
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:Dushan911
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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now