diff --git a/public/all_processing_submit.php b/public/all_processing_submit.php
index 2cc48f4..141972e 100644
--- a/public/all_processing_submit.php
+++ b/public/all_processing_submit.php
@@ -1,60 +1,132 @@
0)
-
-header( 'Location: processing.php?submit=false' ) ;
-
-else {
-
-
-$Count = filter_var($_POST['Count'], FILTER_SANITIZE_STRING);
-$Full = filter_var($_POST['Full'], FILTER_SANITIZE_STRING);
-$Full = !empty($Full) ? "'$Full'" : "NULL";
-$Verify = filter_var($_POST['Verify'], FILTER_SANITIZE_STRING);
-$Checked = filter_var($_POST['Checked'], FILTER_SANITIZE_STRING);
-$Library = filter_var($_POST['Library'], FILTER_SANITIZE_STRING);
+$Name = trim((string)($_POST['Name'] ?? ''));
+$traytemp = trim((string)($_POST['TrayLocation'] ?? ''));
+$Count = trim((string)($_POST['Count'] ?? ''));
+$Full = trim((string)($_POST['Full'] ?? ''));
+$Verify = trim((string)($_POST['Verify'] ?? ''));
+$Checked = trim((string)($_POST['Checked'] ?? ''));
+$Library = trim((string)($_POST['Library'] ?? ''));
+
+if ($Library === '' || $traytemp === '' || $Count === '' || $Checked === '' || $Verify === '') {
+ header('Location: processing.php?submit=blank');
+ exit;
+}
$PCode = substr($traytemp, -2);
+$timestamp = date('Y-m-d H:i:s');
+
+/*
+|--------------------------------------------------------------------------
+| Check for duplicate tray/shelf barcode
+|--------------------------------------------------------------------------
+*/
+$checkSql = "SELECT 1 FROM ProcessingAll WHERE ptraylocation = ? LIMIT 1";
+$checkStmt = $conn->prepare($checkSql);
+
+if (!$checkStmt) {
+ die('Prepare failed: ' . $conn->error);
+}
+$checkStmt->bind_param('s', $traytemp);
+$checkStmt->execute();
+$checkResult = $checkStmt->get_result();
+$isDuplicate = $checkResult instanceof mysqli_result && $checkResult->num_rows > 0;
+$checkStmt->close();
-if($Library =='' OR $traytemp =='' OR $Count =='' OR $Checked =='' OR $Verify =='')
-header( 'Location: processing.php?submit=blank' ) ;
-
-else {
-
-
-$sql = "INSERT INTO ProcessingAll (ProcessingKey, ptimestamp, pname, ptraylocation, pcode, pcount, pfull, pverify, pchecked, plibrary, cctimestamp, ccname, cccount, ccverify, ccchecked) VALUES (NULL, CURRENT_TIMESTAMP, '$Name', $TrayLocation, '$PCode', '$Count', $Full, '$Verify', '$Checked', '$Library', NULL, NULL, NULL, NULL, NULL)";
-
-if ($conn->query($sql) === TRUE) {
- header( 'Location: processing.php?submit=true' ) ;
-
-} else {
- echo "Error: " . $sql . "
" . $conn->error;
-}
+if ($isDuplicate) {
+ header('Location: processing.php?submit=false');
+ exit;
}
+
+/*
+|--------------------------------------------------------------------------
+| Normalize nullable fields
+|--------------------------------------------------------------------------
+*/
+$fullValue = ($Full !== '') ? $Full : null;
+
+/*
+|--------------------------------------------------------------------------
+| Insert record
+|--------------------------------------------------------------------------
+*/
+$insertSql = "
+ INSERT INTO ProcessingAll (
+ ProcessingKey,
+ ptimestamp,
+ pname,
+ ptraylocation,
+ pcode,
+ pcount,
+ pfull,
+ pverify,
+ pchecked,
+ plibrary,
+ cctimestamp,
+ ccname,
+ cccount,
+ ccverify,
+ ccchecked,
+ updated
+ ) VALUES (
+ NULL,
+ ?,
+ ?,
+ ?,
+ ?,
+ ?,
+ ?,
+ ?,
+ ?,
+ ?,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ?
+ )
+";
+
+$insertStmt = $conn->prepare($insertSql);
+
+if (!$insertStmt) {
+ die('Prepare failed: ' . $conn->error);
}
-$conn->close();
-mysqli_close($conn);
+$insertStmt->bind_param(
+ 'ssssssssss',
+ $timestamp, // ptimestamp
+ $Name, // pname
+ $traytemp, // ptraylocation
+ $PCode, // pcode
+ $Count, // pcount
+ $fullValue, // pfull
+ $Verify, // pverify
+ $Checked, // pchecked
+ $Library, // plibrary
+ $timestamp // updated
+);
+
+if ($insertStmt->execute()) {
+ $insertStmt->close();
+ $conn->close();
+ header('Location: processing.php?submit=true');
+ exit;
+}
+$error = $insertStmt->error;
+$insertStmt->close();
+$conn->close();
-?>
+echo 'Error: ' . htmlspecialchars($error, ENT_QUOTES, 'UTF-8');
diff --git a/public/index.php b/public/index.php
index 77b89e1..053bece 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,134 +1,159 @@
(int)$_SESSION['expire']) {
+ session_destroy();
+ header('Location: login.php');
+ exit;
+}
- if ($now > $_SESSION['expire']) {
- session_destroy();
- header("Location: login.php");
- }
+include 'header.php';
-} else {
- // Redirect them to the login page
- header("Location: login.php");
+if (!isset($conn) || !($conn instanceof mysqli)) {
+ die('Database connection not available.');
+}
+
+$userId = (string)($_SESSION['user_id'] ?? '');
+$working = isset($working) ? (string)$working : 'false';
+$account = isset($account) ? (string)$account : 'false';
+
+$pendingCrossChecks = 0;
+
+$sql = "SELECT COUNT(*) AS pending_count FROM ProcessingAll WHERE ccname IS NULL OR ccname = ''";
+$result = mysqli_query($conn, $sql);
+
+if ($result instanceof mysqli_result) {
+ $row = mysqli_fetch_assoc($result);
+ $pendingCrossChecks = isset($row['pending_count']) ? (int)$row['pending_count'] : 0;
+ mysqli_free_result($result);
}
?>
-
+ .no-shadow {
+ box-shadow: none !important;
+ }
+
+ .btn-large .badge {
+ position: static; /* remove floating behavior */
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ margin-left: 10px;
+ vertical-align: middle;
+ height: 22px;
+ min-width: 22px;
+ line-height: 22px;
+ padding: 0 6px;
+ font-size: 12px;
+ border-radius:4px;
+ color: #fff;
+ margin-top: 16px;
+}
+
+
+
Be sure to clock in to your time card before beginning work.
-Manage ongoing special project and track time spent working on Deaccessions.
-Manage ongoing special project and track time spent working on Deaccessions.
+