From: Owen Leonard Date: Mon, 20 Sep 2010 20:58:13 +0000 (-0600) Subject: fixed import of ht stats so it doesn't include last month since that is always No... X-Git-Tag: release_1_0_0~11 X-Git-Url: http://git.pippins.net/embedvideo/.git/static/images/%7Bnolink%7D?a=commitdiff_plain;h=7536f56a8181f8024ae8da99bc31d7b1c43934a8;p=eq%2F.git fixed import of ht stats so it doesn't include last month since that is always No for every family --- diff --git a/bin/import_ward_data b/bin/import_ward_data index 68ee95d..a9e70c6 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -402,6 +402,8 @@ sub update_tc_visit_table ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime(); my %visit_status = ('X', 'y', '-', 'n', '', ''); + $sth = $dbh->prepare("TRUNCATE TABLE tc_visit"); + $sth->execute or die "-E- DB error: $DBI::errstr\n"; foreach $index (keys %hometeaching_stats_data) { $hashref = $hometeaching_stats_data{$index}; @@ -448,7 +450,7 @@ sub update_tc_visit_table #print "$month_header\n"; #print $hometeaching_stats_data{$index}{$month_header}; #print "\n"; - foreach $i (reverse(0..$#history)) { + foreach $i (reverse(0..$#history-1)) { # went back a calendar year, decrement $data_year if ($months{$data_months[$i]} > $data_month) { diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php index 156f1ba..54283fc 100644 --- a/inc/class.tc.inc.php +++ b/inc/class.tc.inc.php @@ -2101,7 +2101,7 @@ class tc foreach ($new_data as $entry) { $visit_notes = $entry['notes']; $family = $entry['family_id']; - $visit_pri = $entry['pri']; + $visit_pri = $entry['pri']; // Perform database save actions here $this->db->query("SELECT * FROM tc_family WHERE family='$family'",__LINE__,__FILE__); if ($this->db->next_record()) {