Ejemplo n.º 1
0
/**
 * Author : Jan Germann
 * Datum : 27.04.2010
 * Modul : files
 * Beschreibung : Löschen von Files
*/
function delete()
{
    global $log, $msg, $mysql;
    //Keine Dateien vorhanden? Dann Abbrechen mit Fehler!
    if (!mysql_result($mysql->query("SELECT count(*) FROM " . _PREFIX_ . "images"), 0)) {
        $msg->error("Sie müssen erst Bilder hochladen, bevor sie welche löschen können.");
        return;
    }
    if (!isset($_POST['id'])) {
        return delete_choose();
    } elseif (isset($_POST['id']) && !isset($_POST['sure'])) {
        return delete_confirm();
    } elseif (isset($_POST['id']) && isset($_POST['sure'])) {
        return delete_do($_POST['id']);
    }
}
Ejemplo n.º 2
0
function delete()
{
    global $log, $msg, $mysql;
    //Keine Seiten vorhanden? Dann Abbrechen mit Fehler!
    if (!mysql_result($mysql->query("SELECT count(*) FROM " . _PREFIX_ . "pages"), 0)) {
        $msg->error("Es gibt noch keine Seiten.");
        return;
    }
    if (!isset($_POST['id'])) {
        return delete_choose();
    } elseif (isset($_POST['id']) && !isset($_POST['sure'])) {
        return delete_confirm();
    } elseif (isset($_POST['id']) && isset($_POST['sure'])) {
        return delete_do($_POST['id'], $_POST['menuid']);
    }
}
Ejemplo n.º 3
0
function jump($action)
{
    switch ($action) {
        case 'add':
            add();
            break;
        case 'edit_del':
            if (array_key_exists('edit', $_REQUEST)) {
                edit();
            } elseif (array_key_exists('delete', $_REQUEST)) {
                delete_confirm();
            } else {
                error('invalid edit_del');
            }
            break;
        case 'update':
            if (array_key_exists('cancel', $_REQUEST)) {
                message('Edit canceled');
                main_page();
            } else {
                update();
            }
            break;
        case 'delete_do':
            if (array_key_exists('cancel', $_REQUEST)) {
                message('Delete canceled');
                main_page();
            } else {
                delete_do();
            }
            break;
        default:
            error_message('unhandled jump: ' . $action);
            main_page();
    }
    // fall-through
    message('jump > fall-through (%s)', $action);
    main_page();
}
    list($button) = array_keys($_REQUEST["button"]);
    switch ($button) {
        case "cancelsel":
            $OUTPUT = cancel();
            break;
        case "allsel":
            $OUTPUT = printInv();
            break;
    }
} elseif (isset($_REQUEST["key"])) {
    switch ($_REQUEST["key"]) {
        case "view":
            $OUTPUT = printInv();
            break;
        case "delete_confirm":
            $OUTPUT = delete_confirm();
            break;
        case "delete_write":
            $OUTPUT = delete_write();
            break;
        default:
            $OUTPUT = slct();
            break;
    }
} else {
    # Display default output
    $OUTPUT = slct();
}
require "template.php";
# Default view
function slct()
#
#
require "settings.php";
require "core-settings.php";
require_lib("docman");
// Merge get vars and post vars
foreach ($_GET as $key => $val) {
    $_POST[$key] = $val;
}
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "view":
            $OUTPUT = printInvoice($_POST);
            break;
        case "delete_confirm":
            $OUTPUT = delete_confirm($_POST);
            break;
        case "delete_write":
            $OUTPUT = delete_write($_POST);
            break;
        default:
            $OUTPUT = slct();
            break;
    }
} else {
    # Display default output
    $OUTPUT = slct();
}
require "template.php";
# Default view
function slct()