From 288a7087acaeb011fe8bb828d8d081be2a7fc12e Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 9 Oct 2012 16:48:56 +0200 Subject: [PATCH 1/1] modification of empty submits now possible. --- admin/sessionoverview.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/sessionoverview.php b/admin/sessionoverview.php index 77b29b6..449ace1 100644 --- a/admin/sessionoverview.php +++ b/admin/sessionoverview.php @@ -23,9 +23,11 @@ $up_mnumber = trim($_GET['mnumber']); $up_tstamp = trim($_GET['tstamp']); $up_editsub = trim($_GET['editsub']); + $up_manydone = count(explode(",",$up_editsub)); if( $db->query("SELECT COUNT(*) FROM workdone WHERE mnumber=$up_mnumber AND session=$up_sessionid AND tstamp=$up_tstamp")->fetch(PDO::FETCH_NUM)[0] == 0 ) { - $db->query("UPDATE workdone SET thisdone='$up_editsub', manydone=" . count(explode(",",$up_editsub)) . ",tstamp=$up_tstamp WHERE mnumber=$up_mnumber AND session=$up_sessionid"); + $db->query("DELETE FROM workdone WHERE mnumber=$up_mnumber AND session=$up_sessionid"); + $db->query("INSERT INTO workdone (session,mnumber,thisdone,manydone,tstamp) values ($up_sessionid,$up_mnumber,\"$up_editsub\",$up_manydone,$up_tstamp)"); block("lightgreen", "modified submit"); } } -- 2.39.5