From: Alan Jack Pippin Date: Fri, 10 Feb 2006 03:09:11 +0000 (-0700) Subject: Fixed bug with valid qualifier missing from eq_companionship table access during... X-Git-Tag: release_0_1_0~59 X-Git-Url: http://git.pippins.net/embedvideo/images/%7Badd%7D?a=commitdiff_plain;h=f797899c6416d6731e4c014fd9b1cfd0dd94a829;p=eq%2F.git Fixed bug with valid qualifier missing from eq_companionship table access during ht_update. --- diff --git a/import_ward_data b/import_ward_data index a691a91..522386e 100755 --- a/import_ward_data +++ b/import_ward_data @@ -265,7 +265,7 @@ sub update_eq_companionship_table my $rows = scalar @data; if($rows == 0) { # No existing records found for this companionship, make a new entry - print " Adding Elder to companionship: $elder_name -> $id\n"; + print " Adding Companion to companionship: $elder_name -> $id\n"; $sth = $dbh->prepare("insert into eq_companionship values ($id,'$elder','$aaronic','$district',1)"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; } else { diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 0512ca0..8f62c1b 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -328,7 +328,7 @@ class eq if($action == 'save') { // Get a list of all the companionships in this district - $sql = "SELECT distinct companionship FROM eq_companionship where district=". $district; + $sql = "SELECT distinct companionship FROM eq_companionship where valid=1 and district=". $district; $this->db->query($sql,__LINE__,__FILE__); $j=0; while ($this->db->next_record()) @@ -344,7 +344,9 @@ class eq // companionship. This will lead to duplicate visits being entered for an older // month for the same family, making it impossible to change the past history once // a family is reassigned. However, you will be able to view the history just fine. - + + //$comp=$unique_companionships[$j]['companionship']; + //print "deleting from eq_visit where companionship=$comp and date=$date and district=$district
"; // Delete all the visits that have taken place for all families for this month $this->db->query("DELETE from eq_visit where companionship=" . $unique_companionships[$j]['companionship'] . " AND " . "date='" . $date . "'",__LINE__,__FILE__); @@ -905,7 +907,7 @@ class eq // Select all the unique companionship numbers for this district if($eqpresppi == 1) { - $sql = "SELECT distinct companionship FROM eq_companionship"; + $sql = "SELECT distinct companionship FROM eq_companionship where valid=1"; } else { $sql = "SELECT distinct companionship FROM eq_companionship where valid=1 and district=". $districts[$i]['district'];