コード例 #1
0
ファイル: gestion_titres.php プロジェクト: Killerfun/galette
if (!$login->isLogged()) {
    header('location: index.php');
    die;
} elseif (!$login->isAdmin() && !$login->isStaff()) {
    header('location: voir_adherent.php');
    die;
} elseif (!$login->isAdmin()) {
    header('location: gestion_adherents.php');
    die;
}
//delete members
if (isset($_GET['del'])) {
    if (isset($_GET['del'])) {
        $title = new Title((int) $_GET['del']);
        try {
            $res = $title->remove($zdb);
            if ($res === true) {
                $success_detected[] = str_replace('%name', $title->short, _T("Title '%name' has been successfully deleted."));
            } else {
                $error_detected[] = str_replace('%name', $title->short, _T("An error occured removing title '%name' :("));
            }
        } catch (\Exception $e) {
            if ($e->getCode() == 23000) {
                $error_detected[] = _T("That title is still in use, you cannot delete it!");
            } else {
                $error_detected[] = $e->getMessage();
            }
        }
    }
}
if (isset($_POST['new']) && $_POST['new'] == '1') {