if (!snomed_import()) {
            echo htmlspecialchars(xl('ERROR: Unable to load the file into the database.'), ENT_NOQUOTES) . "<br>";
            temp_dir_cleanup($db);
            exit;
        }
    } else {
        //$db == 'ICD'
        if (!icd_import($db)) {
            echo htmlspecialchars(xl('ERROR: Unable to load the file into the database.'), ENT_NOQUOTES) . "<br>";
            temp_dir_cleanup($db);
            exit;
        }
    }
}
// set the revision version in the database
if (!update_tracker_table($db, $file_revision_date, $version, $file_checksum)) {
    echo htmlspecialchars(xl('ERROR: Unable to set the version number.'), ENT_NOQUOTES) . "<br>";
    temp_dir_cleanup($db);
    exit;
}
// done, so clean up the temp directory
if ($newInstall === "1") {
    ?>
    <div><?php 
    echo xlt("Successfully installed the following database") . ": " . text($db);
    ?>
</div>
    <?php 
} else {
    ?>
    <div><?php 
            if (!rxnorm_import(IS_WINDOWS)) {
                echo htmlspecialchars(xl('ERROR: Unable to load the file into the database.'), ENT_NOQUOTES) . "<br>";
                temp_dir_cleanup($mode);
                exit;
            }
        } else {
            //$mode == 'snomed'
            if (!snomed_import()) {
                echo htmlspecialchars(xl('ERROR: Unable to load the file into the database.'), ENT_NOQUOTES) . "<br>";
                temp_dir_cleanup($mode);
                exit;
            }
        }
        // 4. set the revision version in the database
        echo htmlspecialchars(xl('Setting the version number in the database...'), ENT_NOQUOTES) . "<br>";
        if (!update_tracker_table($mode, $file_revision_date)) {
            echo htmlspecialchars(xl('ERROR: Unable to set the version number.'), ENT_NOQUOTES) . "<br>";
            temp_dir_cleanup($mode);
            exit;
        }
        // done, so clean up the temp directory
        if ($pending_new) {
            echo "<b>" . htmlspecialchars(xl('Successfully installed the database.'), ENT_NOQUOTES) . "</b><br>";
        } else {
            //$pending_upgrade
            echo "<b>" . htmlspecialchars(xl('Successfully upgraded the database.'), ENT_NOQUOTES) . "</b><br>";
        }
        temp_dir_cleanup($mode);
    }
} else {
    if ($installed_flag) {