Solved

PHP Code Design questions

Posted on 2011-02-27
3
278 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

707 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

16 Experts available now in Live!

Get 1:1 Help Now