$objDb->UpdateDocumentCategory($id, $iCat); } } else { $objDb->UpdateDocumentCategory($id, $_POST["category"]); } } // Go back to main header("Location: index.php"); exit; } // Iterate through the data (this should probably display a progressbar // in the browser, since the user can select a gazillion files. $aItems = array(); $iCat = FALSE; foreach ($_POST["batch"] as $id) { $aRes = $objDb->GetDetails($id); if ($aRes === FALSE) { continue; } if ($iCat === FALSE) { $iCat = $aRes["category"]; } else { if ($iCat != $aRes["category"]) { $iCat === FALSE; break; } } } ?> <html> <head>
<?php require_once "includes/db.php"; if (!isset($_GET["id"])) { header("Location: index.php"); exit; } $objDb = new ScannerDB(); $objDb->open(); $aRes = $objDb->GetDetails($_GET["id"]); if ($aRes === FALSE) { header("Location: index.php"); exit; } if (isset($_POST["update"]) && isset($_POST["category"])) { $objDb->UpdateDocumentCategory($_GET["id"], $_POST["category"]); header("Location: view.php?id=" . $_GET["id"]); exit; } if (isset($_GET["autodate"])) { $iDate = $objDb->GuessDateForDocument($_GET["id"], $aRes["added"]); if ($iDate != 0 && $iDate !== FALSE) { $objDb->UpdateDocumentDate($_GET["id"], $iDate); } header("Location: view.php?id=" . $_GET["id"]); exit; } if (isset($_GET["resetdate"])) { $objDb->UpdateDocumentDate($_GET["id"], 0); header("Location: view.php?id=" . $_GET["id"]); exit;