You will have to start by giving the checkbox fields values so you can verify if they have been checked or not. So instead of:
<input name="doc1del" type="checkbox" value="" />
It should be:
<input name="doc1del" type="checkbox" value="1" />
Then you have to set the default image value to the field in the database when they aren't deleting. So for instance on line 52 instead of:
'DefaultFileName' => "".((($_POST["doc1del"] != "delete"))?$_POST["document1"]:"") ."",
you would have:
'DefaultFileName' => "".((isset($_POST["doc1del"]) && $_POST["doc1del"] == "1")?"":$Recordset1->getColumnVal("document1")) ."",
That way if they checked delete it sets the value to blank, otherwise it leaves the existing value from the recordset.