If you've followed along as we've built the core and authentication sections of a project management application, you can guess what this article is all about. It will walk you through the scripts you need to employ to add an administration section to the application. It will enable administrators to complete tasks that you may not want to allow all of your application's users to do.
The administration section of the project management application can only be accessed by users that have admin rights. The main page of the application contains a link to the admin section. The moment that link is clicked, the user will automatically be checked to see if he or she is admin or not. This section has ten scripts as listed below:
Login.php - Verifies whether or not the logged-in user has admin rights.
Add_user.php - Adds new users.
Add_project.php - Adds new projects to the project list.
Edit_user.php - Enables you to make changes to a user's profile.
Edit_project.php - Enables you to make changes to a project.
Del_project.php - Removes a project from the project list.
Del_user.php - Removes a project from the project list.
Index.php - Gives a list of options from which to choose.
List_projects.php - Displays a list of projects.
List_users.php - Displays a list of users.
The main aim of the admin section is to give the administrators overall control of the entire project management application. It also serves as a maintenance tool, in the sense that redundant projects and users are all removed from the application. This ensures that the application runs smoothly and does not get slower.
The two most important scripts here are the login and index pages. These provide access (login) to the entire admin section. The front page (index.php) provides the easy-to-use user interface for smooth navigation. So let's look at the code that makes up these two pages.