Checked if doc_id in POST is nonzero

if ( isset( $_POST['doc_id'] )&&$_POST['doc_id']!=0 )
needs the check for the doc_id being nonzero otherwise a zero id in the POST will result in the code trying to update the post with id 0