- if($this->monthly_hometeaching_interview_stats == 0) { //Quarterly
- $quarter_total = 0;
- $totals = "<tr><td><b><font size=-2>$total_companionships Total Comps<br>Interview Quarterly Totals:</font></b></td>";
- for($m=$num_months; $m >=0; $m--) {
- $month = $current_month - $m;
- if(($month % 3) == 1) { $quarter_total = $total_ints[$m]; }
- else { $quarter_total += $total_ints[$m]; }
- $percent = ceil(($quarter_total / $total_companionships)*100);
- $totals .= "<td align=center><font size=-2><b>$quarter_total<br>$percent%</font></b></td>";
- }
- $totals .= "</tr>";
- }
- else { //Monthly
- $totals = "<tr><td><b><font size=-2>$total_companionships Total Comps<br>Interview Monthly Totals:</font></b></td>";
- for($m=$num_months; $m >=0; $m--) {
- $percent = ceil(($total_ints[$m] / $total_companionships)*100);
- $totals .= "<td align=center><font size=-2><b>$total_ints[$m]<br>$percent%</font></b></td>";
- }
- $totals .= "</tr>";
+ $total = 0;
+ $totals = "<tr><td><b><font size=-2>$total_companionships Total Comps<br>Interview Totals:</font></b></td>";
+ for($m=$num_months; $m >=0; $m--) {
+ $month = $current_month - $m;
+ $month_begins = $month % $this->monthly_hometeaching_interview_stats;
+ if($this->monthly_hometeaching_interview_stats == 1) { $month_begins = 1; }
+ if(($month_begins) == 1) { $total = $total_ints[$m]; }
+ else { $total += $total_ints[$m]; }
+ $percent = ceil(($total / $total_companionships)*100);
+ $totals .= "<td align=center><font size=-2><b>$total<br>$percent%</font></b></td>";