// referencial integrity require_once "../model/Query/Page/Record.php"; /** * Retrieving post vars */ $idPatient = intval($_POST["id_patient"]); $patName = Check::safeText($_POST["name"]); /** * Prevent user from aborting script */ $oldAbort = ignore_user_abort(true); /** * Delete relatives */ $relQ = new Query_Relative(); $numRows = $relQ->select($idPatient); $rel = array(); for ($i = 0; $i < $numRows; $i++) { $rel[] = $relQ->fetch(); } $relQ->freeResult(); while ($aux = array_shift($rel)) { $relQ->delete($idPatient, $aux[1]); } $relQ->close(); unset($relQ); unset($rel); /** * Delete patient */ $patQ = new Query_Page_Patient();
/** * Retrieving vars (PGS) */ $idPatient = Check::postGetSessionInt('id_patient'); $patient = new Patient($idPatient); if ($patient->getName() == '') { FlashMsg::add(_("That patient does not exist."), OPEN_MSG_ERROR); header("Location: ../medical/patient_search_form.php"); exit; } /** * Search database for relatives */ $relQ = new Query_Relative(); $relArray = array(); if ($relQ->select($idPatient)) { while ($rel = $relQ->fetch()) { $relArray[] = $rel[1]; } $relQ->freeResult(); } $relQ->close(); unset($relQ); /** * Show page */ $title = _("View Relatives"); $titlePage = $patient->getName() . ' (' . $title . ')'; require_once "../layout/header.php"; /** * Breadcrumb