/* Check to make sure we are connected to the database before
allowing access to the home page. If not connected, go connect
and initialize; otherwise, welcome the user.\
*/
if(!database.connected())
redirect("init.htm");
client.numberofplans = 0;
totalplanscursor = database.cursor("select * from benefit_plan", true);
secondtotalplanscursor = database.cursor("select * from benefit_plan", true);
while (totalplanscursor.next()) {
client.numberofplans++;
}
project.lock();
cursor = database.cursor("select plan_code from primary_coverage order by plan_code");
project.unlock();
total = new MakeArray(client.numberofplans);
while (cursor.next()) {
total[cursor.plan_code]++;
}
Below is a real-time listing of each benefit plan and the number of associated
enrollees.
Plan
Total Enrollees
var i = 1;
while (secondtotalplanscursor.next()) {
write("