示例#1
0
}
session_start();
if (isset($_GET["clear"])) {
    header("Location: index.php");
}
if (isset($_GET["view"])) {
    $iTotal = count(GetMenu()) - 1;
    $iNew = intval($_GET["view"]);
    $_SESSION["view"] = min($iTotal, max(0, $iNew));
    header("Location: index.php");
    exit;
}
if (!isset($_SESSION["view"])) {
    $_SESSION["view"] = 0;
}
$objDb = new ScannerDB();
$objDb->open();
?>
<html>
	<head>
		<title>lagerDox</title>
		<style type="text/css">
			div.menu {
				border-top: 1px solid; 
				border-bottom: 1px solid; 
				background-color: #eeeeee; 
				padding: 2px; 
				margin-bottom: 20px
			}
			
			div.date {
示例#2
0
<?php

require_once "includes/db.php";
if (!isset($_POST["batch"])) {
    header("Location: index.php");
    exit;
}
$objDb = new ScannerDB();
$objDb->open();
if (isset($_POST["category"]) || isset($_POST["action"]) && $_POST["action"] == "deduce") {
    $bDeduce = isset($_POST["action"]) && $_POST["action"] == "deduce";
    // Apply changes
    // TODO: Use SQL, not code loop!
    foreach ($_POST["batch"] as $id) {
        if ($bDeduce) {
            $iCat = $objDb->GuessCategoryForDocument($id);
            if ($iCat !== FALSE) {
                $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;
示例#3
0
<?php

require_once "includes/db.php";
header("Content-Type: image/png");
$objDb = new ScannerDB();
$objDb->open();
if (!isset($_GET["id"]) || !isset($_GET["width"])) {
    die("Invalid parameters");
}
if (!isset($_GET["page"])) {
    $iPage = 1;
} else {
    $iPage = intval($_GET["page"]);
}
$objDb->ShowThumbnail($_GET["id"], $iPage, $_GET["width"]);
示例#4
0
<?php

require_once "includes/db.php";
$objDb = new ScannerDB();
$objDb->open();
$aCat = $objDb->GetCategories();
if (isset($_GET["edit"])) {
    // See if we have it
    $aRecord = false;
    foreach ($aCat as $aEntry) {
        if ($aEntry["id"] == $_GET["edit"]) {
            $aRecord = $aEntry;
            break;
        }
    }
    if ($aRecord === FALSE || $aRecord["id"] == 0) {
        header("Location: categories.php");
        exit;
    }
}
if (isset($_POST["cmd"])) {
    $id = 0;
    if (isset($_POST["id"])) {
        $id = intval($_POST["id"]);
    }
    $sName = trim($_POST["name"]);
    $sKeywords = trim($_POST["keywords"]);
    if (isset($_POST["disconnect"]) && $_POST["disconnect"] == "yes") {
        $bRemoveLink = true;
    } else {
        $bRemoveLink = false;
示例#5
0
<?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;
示例#6
0
        $aLikely = $aWords;
    }
    return array("likely" => $aLikely, "unlikely" => $aUnlikely);
}
if (isset($_GET["id"])) {
    // Convert!
    $aBatch = array($_GET["id"]);
} else {
    if (isset($_POST["batch"])) {
        $aBatch = $_POST["batch"];
    } else {
        header("Location: index.php");
        exit;
    }
}
$objDb = new ScannerDB();
$objDb->open();
// Iterate through the data (this should probably display a progressbar
// in the browser, since the user can select a gazillion files.
$aItems = array();
$aCombLikely = FALSE;
$aCombUnlikely = FALSE;
foreach ($aBatch as $id) {
    $aRes = obtainData($objDb, $id);
    if ($aRes !== FALSE) {
        array_push($aItems, array("id" => $id, "likely" => $aRes["likely"], "unlikely" => $aRes["unlikely"]));
        if ($aCombLikely === FALSE) {
            $aCombLikely = $aRes["likely"];
            $aCombUnlikely = $aRes["unlikely"];
        } else {
            $aCombLikely = array_unique(array_merge($aCombLikely, $aRes["likely"]));
示例#7
0
<?php

require_once "includes/db.php";
require_once "includes/processing.php";
if (isset($_GET["id"])) {
    // Convert!
    $id = $_GET["id"];
} else {
    header("Location: index.php");
    exit;
}
$objDb = new ScannerDB();
$objDb->open();
$aRes = $objDb->GetDetails($id);
if ($aRes === FALSE) {
    header("Location: index.php");
    exit;
}
$iSplit = 0;
if (isset($_POST["split"])) {
    $iSplit = intval($_POST["split"]);
    if ($iSplit < 1 || $iSplit > $aRes["pages"] - 1 || $aRes["pages"] < 2) {
        // Really want to split this one don't you? But it's not possible
        header("Location: index.php");
        exit;
    }
    // Okay! This should work, now, generate some kind of UI while we do it since it takes time
    // to do that, we need to disable all kind of buffering...
    @apache_setenv('no-gzip', 1);
    @ini_set('zlib.output_compression', 0);
    @ini_set('implicit_flush', 1);
示例#8
0
<?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($_GET["yes"]) && $_GET["yes"] == "indeed") {
    $objDb->Delete($_GET["id"]);
    header("Location: index.php");
    exit;
}
?>
<html>
	<head>
		<title>Delete document</title>
		<style type="text/css">
			img {
				margin: 5px;
				border: 1px solid;
			}
			
			h2 {
				display: inline;
示例#9
0
<?php

require_once "includes/db.php";
$aSafer = array("/" => "-", "\\" => "-", " " => "_", ":" => ".", ";" => ".");
$objDb = new ScannerDB();
$objDb->open();
if (!isset($_GET["id"])) {
    die("Invalid parameters");
}
$aRes = $objDb->GetDetails($_GET["id"]);
header("Content-Type: application/pdf");
header(sprintf('Content-Disposition: attachment; filename="%s_%s_%d_pages.pdf"', strftime("%F", $aRes["added"]), strtr($aRes["name"], $aSafer), $aRes["pages"]));
readfile($aRes["filename"]);