<div class="col-lg-6"> <?php $mode = $_REQUEST["mode"]; $retention_id = $_REQUEST["id"]; $action = $_REQUEST["action"]; $table = "retention"; $tbl_id = "retention_id"; $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>'; } } } }