X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;ds=inline;f=inc%2Fclass.eq.inc.php;h=747a9a5ab2e2293b5f6bd9e494bb03f75d8921d9;hb=a58cb12cfe9a89076a37b96afbecb25d1c6eb5dd;hp=3dac97e0e4e3ce2ecc1c5e4665740e756a2bd9d1;hpb=af61eec323981d19d4d95a90aa26fa761e904194;p=eq%2F.git
diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php
index 3dac97e..747a9a5 100644
--- a/inc/class.eq.inc.php
+++ b/inc/class.eq.inc.php
@@ -80,6 +80,7 @@ class eq
$this->default_vis_num_years = 1;
$this->max_num_districts = 4;
$this->time_drop_down_lists = 1;
+ $this->monthly_hometeaching_interviews = 0;
$this->time_drop_down_list_inc = 15;
$this->default_visit_appt_duration = 45;
$this->default_ppi_appt_duration = 30;
@@ -1908,12 +1909,12 @@ class eq
}
// If this companionship has had a hometeaching interview this quarter, don't show them on the schedule list
- $sql = "SELECT * FROM eq_interview WHERE date >= '$quarter_start' AND date < '$quarter_end' ".
+ $sql = "SELECT * FROM eq_ppi WHERE date >= '$quarter_start' AND date < '$quarter_end' ".
"AND elder=" . $id;
$this->db2->query($sql,__LINE__,__FILE__);
if(!$this->db2->next_record()) {
- $sql = "SELECT * FROM eq_interview WHERE elder=" . $id . " ORDER BY date DESC";
+ $sql = "SELECT * FROM eq_ppi WHERE elder=" . $id . " ORDER BY date DESC";
$this->db3->query($sql,__LINE__,__FILE__);
if($this->db3->next_record()) { $date = $this->db3->f('date'); } else { $date = ""; }
$link_data['menuaction'] = 'eq.eq.int_update';
@@ -2464,6 +2465,7 @@ class eq
" ppi='" . $ppi . "'" .
", interviewer='" . $interviewer . "'" .
", elder='" . $elder . "'" .
+ ", aaronic='" . $aaronic . "'" .
", date='" . $date . "'" .
", notes='" . $notes . "'" .
", eqpresppi='" . $eqpresppi . "'" .
@@ -2475,8 +2477,8 @@ class eq
if($action == 'insert')
{
$notes = get_var('notes',array('POST'));
- $this->db->query("INSERT INTO eq_ppi (interviewer,elder,date,notes,eqpresppi) "
- . "VALUES ('" . $interviewer . "','" . $elder . "','"
+ $this->db->query("INSERT INTO eq_ppi (interviewer,elder,aaronic,date,notes,eqpresppi) "
+ . "VALUES ('" . $interviewer . "','" . $elder . "','" . $aaronic . "','"
. $date . "','" . $notes . "','" . $eqpresppi ."')",__LINE__,__FILE__);
$this->ppi_view();
return false;
@@ -2678,7 +2680,7 @@ class eq
$month_start = "$year"."-"."$month"."-"."01";
$month_end = "$year"."-"."$month"."-"."31";
$month = "$month"."/"."$year";
- $sql = "SELECT * FROM eq_interview WHERE date >= '$month_start' AND date <= '$month_end' ".
+ $sql = "SELECT * FROM eq_ppi WHERE date >= '$month_start' AND date <= '$month_end' ".
"AND elder=" . $elder_id . " AND aaronic=" . $aaronic_id;
$this->db2->query($sql,__LINE__,__FILE__);
$header_row .= "
$month | ";
@@ -2713,15 +2715,25 @@ class eq
$total_companionships += $num_companionships;
$stat_data = "$num_companionships Companionships Interview Quarterly Totals: | ";
- 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% | ";
+ // Print the hometeaching interview stats
+ if($this->monthly_hometeaching_interviews == 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 .= "
";
}
- $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 .= "";
+ }
+
$this->t->set_var('table_width',$table_width);
$this->t->set_var('header_row',$header_row);
$this->t->set_var('table_data',$table_data);
@@ -2729,17 +2741,27 @@ class eq
$this->t->fp('list','district_list',True);
}
- // Display the totals, cummulative per quarter
- $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% | ";
+ // Display the totals
+ if($this->monthly_hometeaching_interviews == 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 .= "
";
}
- $totals .= "";
$this->t->set_var('totals',$totals);
$this->t->pfp('out','int_view_t');
@@ -2789,14 +2811,14 @@ class eq
if($action == 'save')
{
$notes = get_var('notes',array('POST'));
- $this->db->query("UPDATE eq_interview set " .
- " interview='" . $interview . "'" .
+ $this->db->query("UPDATE eq_ppi set " .
+ " ppi='" . $interview . "'" .
", interviewer='" . $interviewer . "'" .
", elder='" . $elder . "'" .
", aaronic='" . $aaronic . "'" .
", date='" . $date . "'" .
", notes='" . $notes . "'" .
- " WHERE interview=" . $interview,__LINE__,__FILE__);
+ " WHERE ppi=" . $interview,__LINE__,__FILE__);
$this->int_view();
return false;
}
@@ -2804,7 +2826,7 @@ class eq
if($action == 'insert')
{
$notes = get_var('notes',array('POST'));
- $this->db->query("INSERT INTO eq_interview (interviewer,elder,aaronic,date,notes) "
+ $this->db->query("INSERT INTO eq_ppi (interviewer,elder,aaronic,date,notes) "
. "VALUES ('" . $interviewer . "','" . $elder . "','" . $aaronic . "','"
. $date . "','" . $notes ."')",__LINE__,__FILE__);
$this->int_view();
@@ -2829,7 +2851,7 @@ class eq
if($action == 'edit' || $action == 'view')
{
- $sql = "SELECT * FROM eq_interview WHERE interview=".$interview;
+ $sql = "SELECT * FROM eq_ppi WHERE ppi=".$interview;
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$this->t->set_var('interview',$interview);