//convert any checked records to an array of ids
    foreach ($HTTP_POST_VARS as $key => $value) {
        if (substr($key, 0, 5) == "check") {
            $theids[] = $value;
        }
    }
    //Search Options Command Process
    //=====================================================================================================
    switch ($command) {
        case "new":
            // relocate to new screen
            //=====================================================================================================
            $theurl = getAddEditFile($db, "tbld:a4cdd991-cf0a-916f-1240-49428ea1bdd1") . "?reftable=" . $reftable . "&refid=" . $_GET["refid"] . "&backurl=" . $backurl;
            goURL($theurl);
            break;
        case "delete":
            //a bit more complicated so we'll put it in it's own function?
            //=====================================================================================================
            include_once "modules/base/include/notes.php";
            $searchFunctions = new notesSearchFunctions($db, "tbld:a4cdd991-cf0a-916f-1240-49428ea1bdd1", $theids);
            $statusmessage = $searchFunctions->delete_record();
            break;
        case "edit/view":
            // relocate to edit screen
            //=====================================================================================================
            goURL(getAddEditFile($db, "tbld:a4cdd991-cf0a-916f-1240-49428ea1bdd1") . "?id=" . $theids[0] . "&refid=" . $_GET["refid"] . "&backurl=" . $backurl);
            break;
    }
    //end switch
}
//end if
示例#2
0
$displayTable->querywhereclause = $whereclause;
$displayTable->tableoptions["printex"] = 0;
$displayTable->tableoptions["othercommands"] = false;
$displayTable->tableoptions["select"] = 0;
if (isset($_POST["deleteCommand"])) {
    if ($_POST["deleteCommand"]) {
        $_POST["command"] = $_POST["deleteCommand"];
    }
}
if (isset($_POST["command"])) {
    switch ($_POST["command"]) {
        case $displayTable->thetabledef["deletebutton"]:
            //=====================================================================================================
            include_once "modules/base/include/notes.php";
            $theids = explode(",", $_POST["theids"]);
            $searchFunctions = new notesSearchFunctions($db, $displayTable->thetabledef["uuid"], $theids);
            $tempmessage = $searchFunctions->delete_record();
            if ($tempmessage) {
                $statusmessage = $tempmessage;
            }
            break;
    }
    //end switch
}
//on the fly sorting... this needs to be done after command processing or the querystatement will not work.
if (!isset($_POST["newsort"])) {
    $_POST["newsort"] = "";
}
if (!isset($_POST["desc"])) {
    $_POST["desc"] = "";
}