if ($mode == "anc_followup") {
    $anc_study_id = $_POST['anc_study_id'];
    $abs_date = $_POST['abs_date'];
    $visit_count = $_POST['visit_count'];
    $anc_visit_date = $_POST['anc_visit_date'];
    $gestational_period = $_POST['gestational_period'];
    $haart_change = $_POST['haart_change'];
    $haart_regimen = $_POST['haart_regimen'];
    $haart_change_date = $_POST['haart_change_date'];
    $counselling = $_POST['counselling'];
    $hiv_status_partner = $_POST['hiv_status_partner'];
    $return_date = $_POST['return_date'];
    $btn = $_POST['btn'];
    $anc_followup = array($anc_study_id, $abs_date, $visit_count, $anc_visit_date, $gestational_period, $haart_change, $haart_regimen, $haart_change_date, $counselling, $hiv_status_partner, $return_date);
    if ($btn == "submit") {
        if ($db->insertAncFollowup($anc_followup) > 0) {
            echo '<label class="control-label" for="inputSuccess">Women ANC Followup recorded successfully</label> <br \\> Return to <a href="dashboard.php" >Dashboard</a>';
        } else {
            echo '<label class="control-label" for="inputError">Women ANC Followup was not recorded.</label><br \\>Return to <a href="dashboard.php" >Dashboard</a>';
        }
    } else {
        if ($btn == "update") {
            if ($db->editAncFollowup($anc_followup, $anc_id) > 0) {
                echo '<label class="control-label" for="inputSuccess"> Women ANC Followup  updated successfully</label> <br \\> Return to <a href="dashboard.php" >Dashboard</a>';
            } else {
                echo '<label class="control-label" for="inputError">Women ANC Followup was not updated.</label><br \\>Return to <a href="dashboard.php" >Dashboard</a>';
            }
        }
    }
}
if ($action == "add" || $action == "edit") {