/* 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"); project.lock(); if (client.action == "insert") { database.execute("insert into primary_coverage (employee_ssn, plan_code) values (" + client.ssn + ", " + request.plan_code + ")"); } else { database.execute("update primary_coverage set plan_code = " + request.plan_code + " where employee_ssn = " + client.ssn + ""); } database.execute("update status set cs6 = 'yes' where employee_ssn = " + client.ssn + ""); project.unlock(); redirect("areas.htm");