Fixed import bug that existed when Aaronic Priesthood Companion was not found in db
[eq/.git] / inc / class.eq.inc.php
index d9a58fac43b2c7ef277e69b4a2dd75a1ff20c71c..aab3ffd61d40b3792059fcc712c4cdb8d8e1d6e7 100644 (file)
@@ -875,10 +875,16 @@ class eq
       $i=0;
       while ($this->db->next_record())
        {
-         $districts[$i]['district'] = $this->db->f('district');
-         $districts[$i]['name'] = $this->db->f('name');
-         $districts[$i]['supervisor'] = $this->db->f('supervisor');
-         if($eqpresppi == 0) { $i++; }
+         if($eqpresppi == 1 && $this->db->f('district') == 1) {
+           $districts[$i]['district'] = $this->db->f('district');
+           $districts[$i]['name'] = $this->db->f('name');
+           $districts[$i]['supervisor'] = $this->db->f('supervisor');
+          } else if($eqpresppi == 0) {
+            $districts[$i]['district'] = $this->db->f('district');
+           $districts[$i]['name'] = $this->db->f('name');
+            $districts[$i]['supervisor'] = $this->db->f('supervisor');
+            $i++;
+         }
        }
 
       $sql = "SELECT * FROM eq_elder where valid=1 ORDER BY elder ASC";