X-Git-Url: http://git.treefish.org/banana.git/blobdiff_plain/fcea930220d4896e30baa93ee1603b08df1ff4d7..5f365b6030b2a9a0d57ee13d9a62bdb2c585afb8:/admin/sessionoverview.php?ds=inline diff --git a/admin/sessionoverview.php b/admin/sessionoverview.php index 570f59b..ab6cd7e 100644 --- a/admin/sessionoverview.php +++ b/admin/sessionoverview.php @@ -24,8 +24,12 @@ $up_tstamp = trim($_GET['tstamp']); $up_editsub = trim($_GET['editsub']); + if( $up_editsub == "" ) { $up_manydone = 0; } + else{ $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"); } } @@ -34,8 +38,8 @@ print ""; } print "";