Lessons Learned: Management Program for the Plan Preparations Guide

Several years back, I developed one of my first in-depth PHP scripts. The goal was to create a voting mechanism for a set of notes posted online. The vote helped committee members decide on whether specific notes should be removed, moved, or changed. Although the completed solution wasn't perfect, it was an excellent learning experience. So I wanted to share a few things I learned.

Background

The overall management tool was built for two types of users. The majority of work was put towards the administrative side of the program. They needed the ability to select notes from the website database to be voted on, monitor the progress of the voting process, manage who was placed in the various voting groups, etc.

The second part was for the voting groups (aka the committee members). They needed a place to view the notes up for voting, a form to place their vote, and a way to see the outcome of the vote.

Program Overview

Before a note can be added, modified, or removed, it is approved by a series of committee members. The approval process is started by the administrator who logs into their dashboard and chooses an existing note or enters a new one. All of the notes are then listed with a quick overview of how the voting process is going (see Figure 1).

Screenshot showing the task overview
Figure 1. Task Overview

When ready, the administrator uses the management program to notify committee members that a vote is taking place. The members can then log into their dashboard to accept or reject each suggestion and potential provide additional comments (see Figure 2).

Screenshot of the voting form used by the committee members
Figure 2. Committee Voting Form

Each task can be given a soft deadline to let committee members know how long they have to vote. If anyone doesn't respond in the given time frame, the administrator has the option to bypass them (see Figure 3).

Screenshot showing the bypass option
Figure 3. Bypass Option

Once the voting process is complete, the administrator decides the next steps. Tasks can be sent through two additional voting committees, if necessary. Otherwise, the task(s) can be archived along with their corresponding voting information (see Figure 4).

Screenshot of the form that's used to archive a task
Figure 4. Option to Archive Task

Lessons Learned

One lesson I learned while developing this project is that programs need to be created with change in mind. Anything that can be done to minimize future maintenance will make life simpler.

During the planning stage of the management program, for example, it was mentioned that the size of committee member teams would be fixed. The names of the people could change, but there were only supposed to be a specific number of people voting in each team. So I decided to create two tables. The first table contained the user profiles. The other contained all the details about the tasks along with the resulting votes.

The initial setup worked well for a few years, but as you might guess the number of committee members eventually changed. With every extra member, I needed to add new columns and modify the management program to recognize the new columns.

After manually incorporating a few new committee members, I finally broke down and rebuilt the database. The user-profile table stayed the same and the task table was split into two (see Figure 5).

Database structure after the update
Figure 6. Database Structure After Update

In addition to updating the database, I modified the management program so it automatically created the necessary number of voting entries based on the number of active committee members.

Conclusion

Updating the management program to automatically add voting entries for each active member saved many hours of work. I no longer need to modify the database structure or the program when adding new committee members. A record just needs to be added to the user profile database and the program handles the rest.

The update also allowed me to build a user-management feature for the administrator. Now they can easily see a list of all committee members, remove access, update user profiles, and add new members at their convenience.

0 Comments

There are currently no comments.

Leave a Comment