View Routes

<<Back to Main Menu

Description:
This lists all the Routes and Complex Routes in the database, displaying 'from', 'to', 'operator'. Complex Routes include a list of Roue Parts. Each has an associated link to View Route (for more information). There are options to sort the list in various ways.

Accessible by:
Managers

Accessed from:
Main Menu
Itself

Input parameters:
sortBy

Output
List of Routes with links to View Route. This list is part of a View Routes Form, which allows the manager to order the search in various ways, by submitting the form to Itself
The options in the form are to sort by 'from', 'to', 'operator', 'total revenue' or 'average revenue'
Active and inactive Routes are displayed in different colours

Pseudo Code:
get/create session
if ('usertype' param in the session == 'm') {
   get parameters from the form
   get Route data from the database
   if (there's no 'sortBy' variable) {
      display the list in a View Routes Form
   }
   else if (sortBy == 'from') {
      sort the list by 'from'
      display the list in a View Routes Form
   }
   else if (sortBy == 'to') {
      sort the list by 'to'
      display the list in a View Routes Form
   }
   else if (sortBy == 'total revenue') {
      sort the list by 'total revenue'
      display the list in a View Routes Form
   }
   else if (sortBy == 'average revenue') {
      sort the list by 'average revenue'
      display the list in a View Routes Form
   }
   else if (sortBy == 'operator') {
      sort the list by 'op'
      display the list in a View Routes Form
   }
}
else {
   error message to say user must be a manager
}