$cd4_count = $_POST['cd4_count']; } $cd4_date = $_POST['cd4_date']; $vl_taken = $_POST['vl_taken']; if ($vl_taken == "NA" || $vl_taken == "N" || $vl_taken == "NV") { $viral_load = 'NULL'; } else { $viral_load = $_POST['viral_load']; } $viral_date = $_POST['viral_date']; $who_stage = $_POST['who_stage']; $btn = $_POST['btn']; $next_visit = $_POST['next_visit_date']; $adherence = array($a_study_id, $visit, $haart_change, $haart_change_date, $haart_regimen, $art_effect, $self_art_adherence, $self_ctx_adherence, $cd4_taken, $cd4_count, $cd4_date, $vl_taken, $viral_load, $viral_date, $who_stage, $next_visit); if ($btn == "submit") { if ($db->insertAdherence($adherence) > 0) { echo '<label class="control-label" for="inputSuccess">Women Adherence recorded successfully</label> <br \\> Return to <a href="dashboard.php" >Dashboard</a>'; } else { echo '<label class="control-label" for="inputError">Women Adherence was not recorded.</label><br \\>Return to <a href="dashboard.php" >Dashboard</a>'; } } else { if ($btn == "update") { if ($db->editAdherence($adherence, $adherence_id) > 0) { echo '<label class="control-label" for="inputSuccess">Women Adherence updated successfully</label> <br \\> Return to <a href="dashboard.php" >Dashboard</a>'; } else { echo '<label class="control-label" for="inputError">Women Adherence was not updated.</label><br \\>Return to <a href="dashboard.php" >Dashboard</a>'; } } } } if ($action == "add" || $action == "edit") {