diff --git a/distfiles/maintformentry.php b/distfiles/maintformentry.php index 0d16adf..042e9b6 100644 --- a/distfiles/maintformentry.php +++ b/distfiles/maintformentry.php @@ -178,6 +178,7 @@ if ($mfadd) { // add the record to maintforms if (! $pdatamismatch) { + $lognoteid = ($lognoteid==NULL) ? 0 : $lognoteid; mysqli_query($db, "insert into maintforms(mfdate,mftime,mftech,mfpart,mfpartloc,mfmalfunction,nha,repord,lognoteid,pending) values (\"$mfdate\", \"$mftime\",\"$loggedinas\",\"$mfpart\",\"$mfpartloc\",\"$mfmalfunction\",\"$nha\",\"$repord\",\"$lognoteid\",\"$pending\")"); $newmaintformid = mysqli_insert_id($db); @@ -186,7 +187,7 @@ if ($mfadd) { // update the flagmap table foreach ($flags as $thisflag) { // set flag for this maintenance form - mysqli_query($db, "insert into flagmap(flagid,maintformid) values(\"$thisflag\",\"$$newmaintformid\")"); + mysqli_query($db, "insert into flagmap(flagid,maintformid) values(\"$thisflag\",\"$newmaintformid\")"); } } }