$db = new db_transactions(); if ($mode == "retention") { $studyid = $_POST['studyid']; $hiv_visit = $_POST['hiv_visit']; $next_visit = $_POST['next_visit']; $btn = $_POST['btn']; $retention = array($studyid, $hiv_visit, $next_visit); if ($btn == "submit") { if ($db->insertRentention($retention) > 0) { echo '<label class="control-label" for="inputSuccess">Women Retention recorded successfully</label> <br \\> Return to <a href="dashboard.php" >Dashboard</a>'; } else { echo '<label class="control-label" for="inputError">Women Retention was not recorded.</label><br \\>Return to <a href="dashboard.php" >Dashboard</a>'; } } else { if ($btn == "update") { if ($db->editRentention($retention, $retention_id) > 0) { echo '<label class="control-label" for="inputSuccess">Women Retention recorded successfully</label> <br \\> Return to <a href="dashboard.php" >Dashboard</a>'; } else { echo "id = " . $retention_id; echo '<label class="control-label" for="inputError">Women Retention was not recorded.</label><br \\>Return to <a href="dashboard.php" >Dashboard</a>'; } } } } if ($action == "add" || $action == "edit") { $select_record = $db->selectRecord($table, $tbl_id, $retention_id); ?> <form role="form" action="retention.php?id=<?php echo $retention_id; ?>