How to query to display data that has different months?

So, I have a view report display that filters Period From and Period To, as shown below:

View Filter Report

And, I have employee data with dates like this:

View Data Employee

Then, when I view the report, the end_date for February doesn’t appear because the Period From and To process is only in January. It should appear because the start_date is in January.

Image Display of Report Results

This is my query, please help.

$this->db->select("a.id, a.employee_id, a.employee_name, a.leave_name, a.start_date, a.end_date, a.status, 
                   b.id, b.employee_id, b.job_title_name, b.employment_status_name")
         ->join('hr_employee b', 'a.employee_id = b.employee_id', 'left')
         ->where("a.start_date AND a.end_date BETWEEN '$data[from]' AND '$data[to]'");

   return $this->db->get('hr_leaves a');