The $to_date and $from_date variables were incorrectly referenced as $form_to_date and $form_from_date.
Merge branch 'master' of git://github.com/openemr/openemr