} else {
            $sql = "REPLACE INTO suppress (name,col,expire) VALUES ('{$column}','{$sup_field}','{$sup_date} {$sup_time}')";
        }
        $result = perform_query($sql, $dbLink, $_SERVER['PHP_SELF']);
        switch ($sup_field) {
            case 'mne':
                $column = crc2mne($column);
                break;
            case 'facility':
                $column = int2fac($column);
                break;
            case 'severity':
                $column = int2sev($column);
                break;
            case 'program':
                $column = crc2prg($column);
                break;
        }
        if ($sup_field == "msg") {
            $success .= "Set event suppression for {$sup_field} to '{$msg_text}'<br>";
        } else {
            $success .= "Set event suppression for {$sup_field} to '{$column}'<br>";
        }
    }
} else {
    $where = "WHERE id IN ('{$dbid}')";
}
switch ($action) {
    case "save":
        if ($sup_field) {
            $sql = "UPDATE " . $_SESSION["TBL_MAIN"] . " set suppress='{$sup_date} {$sup_time}' {$where}";
                break;
        }
        $ids[] = $array[$i][0];
        $host_crcs[] = $array[$i][1];
        $facilities[] = $array[$i][2];
        $severities[] = $array[$i][3];
        $programs[] = $array[$i][4];
        $msg_crc[] = $array[$i][5];
        $mnes[] = $array[$i][6];
        $eids[] = $array[$i][7];
        $notes_crcs[] = $array[$i][8];
        $counters[] = $array[$i][9];
        $fos[] = $array[$i][10];
        $los[] = $array[$i][11];
        $counts[] = $array[$i][12];
        $prgname = crc2prg($array[$i][4]);
        $arr["$prgname"] = $array[$i][12];
    }
    // pop the array because there's a blank from the meta info
    array_pop($arr);
    // echo "<pre>";
    // echo "Debug:\n<br>";
    // echo "Total = $total<br>";
    $pievalues = json_encode($arr);
    $_SESSION['top10p'] = $pievalues;
    // echo $pie;
    // die($_SESSION['top10p']);

?>
<!-- 2. Add the JavaScript to initialize the chart on document ready -->
        <script type="text/javascript">