Well, you'd fill in the...
#decide whether or not this is a file the user wants
...
... section with code that checked the files in the directory against what the user has selected. For example, you might look at the date part of the filename, and see if it is in the range that you get from the variables you already pull out of the user query ($get_file_from and $get_file_to)
In pseudocode:
foreach file in the directory {
get the date from the filename
check if it is in the $get_file_from to $get_file_to range
if so, add it to @files
}
later
foreach @files {
open and process
}