X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclass.eq.inc.php;h=b3730dde2037d5e54e53b94646cc4d95fa1aab7a;hb=d0fe650e8a63864d8fd593aec3429abdec5eac95;hp=4574d4b9290db9ecc5b22dad4605117b303ab943;hpb=c57e6e155b11fb24d9e2a9e29763db98b7d4bf21;p=eq%2F.git
diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php
index 4574d4b..b3730dd 100644
--- a/inc/class.eq.inc.php
+++ b/inc/class.eq.inc.php
@@ -68,12 +68,13 @@ class eq
function eq()
{
- if(file_exists('setup/eq_config.local')) {
- include('setup/eq_config.local');
+ $base_path = $_SERVER['DOCUMENT_ROOT'];
+ if(file_exists("$base_path/eq/setup/eq_config.local")) {
+ include("$base_path/eq/setup/eq_config.local");
} else {
- include('setup/eq_config');
+ include("$base_path/eq/setup/eq_config");
}
-
+
$this->script_path = "$this->application_path"."/bin";
$this->max_presidency_members = 99;
$this->max_appointments = 32768;
@@ -2722,26 +2723,21 @@ class eq
$table_data .= "
|
";
}
$total_companionships += $num_companionships;
- $stat_data = "$num_companionships Companionships Interview Quarterly Totals: | ";
+ $stat_data = "
$num_companionships Companionships Interview Totals: | ";
// Print the hometeaching interview stats
- if($this->monthly_hometeaching_interview_stats == 0) { //Quarterly
- for($m=$num_months; $m >=0; $m--) {
- $month = $current_month - $m;
- if(($month % 3) == 1) { $quarter_total = $ints[$m]; }
- else { $quarter_total += $ints[$m]; }
- $percent = ceil(($quarter_total / $num_companionships)*100);
- $stat_data .= "$quarter_total $percent% | ";
- }
- $stat_data .= "
";
- }
- else { // Monthly
- for($m=$num_months; $m >=0; $m--) {
- $percent = ceil(($ints[$m] / $num_companionships)*100);
- $stat_data .= "$ints[$m] $percent% | ";
- }
- $stat_data .= "";
+ for($m=$num_months; $m >=0; $m--) {
+ $month = $current_month - $m;
+ if($month < 0) { $month = 12 + $month; } // Handle going backwards over a year boundary
+ $month_begins = $month % $this->monthly_hometeaching_interview_stats;
+ //print "$month % $this->monthly_hometeaching_interview_stats = $month_begins
";
+ if($this->monthly_hometeaching_interview_stats == 1) { $month_begins = 1; }
+ if(($month_begins) == 1) { $total = $ints[$m]; }
+ else { $total += $ints[$m]; }
+ $percent = ceil(($total / $num_companionships)*100);
+ $stat_data .= "$total $percent% | ";
}
+ $stat_data .= "";
$this->t->set_var('table_width',$table_width);
$this->t->set_var('header_row',$header_row);
@@ -2751,27 +2747,20 @@ class eq
}
// Display the totals
- if($this->monthly_hometeaching_interview_stats == 0) { //Quarterly
- $quarter_total = 0;
- $totals = "$total_companionships Total Comps Interview Quarterly Totals: | ";
- 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 .= "$quarter_total $percent% | ";
- }
- $totals .= "
";
- }
- else { //Monthly
- $totals = "$total_companionships Total Comps Interview Monthly Totals: | ";
- for($m=$num_months; $m >=0; $m--) {
- $percent = ceil(($total_ints[$m] / $total_companionships)*100);
- $totals .= "$total_ints[$m] $percent% | ";
- }
- $totals .= "
";
+ $total = 0;
+ $totals = "$total_companionships Total Comps Interview Totals: | ";
+ for($m=$num_months; $m >=0; $m--) {
+ $month = $current_month - $m;
+ if($month < 0) { $month = 12 + $month; } // Handle going backwards over a year boundary
+ $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 .= "$total $percent% | ";
}
-
+ $totals .= "
";
+
$this->t->set_var('totals',$totals);
$this->t->pfp('out','int_view_t');
$this->save_sessiondata();