$hei_id = $_POST['hei_id']; $d_study_id = $_POST['d_study_id']; $birth_date = $_POST['birth_date']; $birth_weight = $_POST['birth_weight']; $sex = $_POST['sex']; $delivery_place = $_POST['delivery_place']; $arv_prophylaxis = $_POST['arv_prophylaxis']; $arv_pro_other = $_POST['arv_pro_other']; $enrol_date = $_POST['enrol_date']; $enrol_age = $_POST['enrol_age']; $participant_outcome = $_POST['participant_outcome']; $outdate = $_POST['outdate']; $btn = $_POST['btn']; $registration = array($hei_id, $d_study_id, $birth_date, $birth_weight, $sex, $delivery_place, $arv_prophylaxis, $arv_pro_other, $enrol_date, $enrol_age, $participant_outcome, $outdate); if ($btn == "submit") { if ($db->insertInfantRegistration($registration) > 0) { echo '<label class="control-label" for="inputSuccess">Early Infant Registration recorded successfully</label> <br \\> Return to <a href="dashboard.php" >Dashboard</a>'; } else { echo '<label class="control-label" for="inputError">Early Infant Registration was not recorded.</label><br \\>Return to <a href="dashboard.php" >Dashboard</a>'; } } else { if ($btn == "update") { if ($db->editInfantRegistration($registration, $reg_id) > 0) { echo '<label class="control-label" for="inputSuccess"> Early Infant Registration updated successfully</label> <br \\> Return to <a href="dashboard.php" >Dashboard</a>'; } else { echo '<label class="control-label" for="inputError"> Early Infant Registration was not updated.</label><br \\>Return to <a href="dashboard.php" >Dashboard</a>'; } } } } ?>