コード例 #1
0
ファイル: problem_del.php プロジェクト: edubort/openclinic-1
$returnLocation = "../medical/problem_list.php";
// controlling var
/**
 * Prevent user from aborting script
 */
$oldAbort = ignore_user_abort(true);
/**
 * Delete medical problems connections
 */
$connQ = new Query_Connection();
$numRows = $connQ->select($idProblem);
$conn = array();
for ($i = 0; $i < $numRows; $i++) {
    $conn[] = $connQ->fetch();
}
$connQ->freeResult();
while ($aux = array_shift($conn)) {
    $connQ->delete($idProblem, $aux[1]);
}
$connQ->close();
unset($connQ);
unset($conn);
/**
 * Delete problem
 */
$problemQ = new Query_Page_Problem();
if (defined("OPEN_DEMO") && !OPEN_DEMO) {
    if (!$problemQ->select($idProblem)) {
        $problemQ->close();
        FlashMsg::add(_("That medical problem does not exist."), OPEN_MSG_ERROR);
        header("Location: " . $returnLocation);