Not sure what coding construct you're used to, but in PHP that conditional would be written like so:
if (file_exists($file1) || file_exists($file2) || !empty($txt1) || !empty($txt2) || $row['type1'] == 'Y' || $row['type2'] =='Y') {
//do something
}
Now, I'm assuming you already know the logic of that statement. At present, if either of the files exists, or if either variable is not empty, or if either row is set to 'Y', then (something) will be done. Only 1 of the 6 conditions above needs to be fulfilled in order for the conditional to run the code inside the brackets.