From 759d76b818ce63f221215f8521b246fd61ab3976 Mon Sep 17 00:00:00 2001
From: "Alan J. Pippin" <ajp@pippins.net>
Date: Wed, 8 Sep 2010 14:37:25 -0600
Subject: [PATCH] Improved drop down list choices for ppi and ht interviews

---
 inc/class.eq.inc.php | 36 ++++++++++++++++--------------------
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php
index 1038cf0..328b1ab 100644
--- a/inc/class.eq.inc.php
+++ b/inc/class.eq.inc.php
@@ -2555,7 +2555,7 @@ class eq
       $notes = get_var('notes',array('GET','POST'));
       $eqpresppi = get_var('eqpresppi',array('GET','POST'));
      
-      $sql = "SELECT * FROM eq_presidency where valid=1 and eqpres=0";
+      $sql = "SELECT * FROM eq_presidency where valid=1 and (president=1 or counselor=1 or secretary=1)";
       $this->db2->query($sql,__LINE__,__FILE__);
       while ($this->db2->next_record())
       {
@@ -2893,25 +2893,21 @@ class eq
       $date = get_var('date',array('GET','POST'));
       $notes = get_var('notes',array('GET','POST'));
       $eqpresppi = get_var('eqpresppi',array('GET','POST'));
-      
-      $sql = "SELECT * FROM eq_district where valid=1 ORDER BY district ASC";
-      $this->db->query($sql,__LINE__,__FILE__);
-      while ($this->db->next_record())
-	{
-	  $supervisor = $this->db->f('supervisor');
-	  $sql = "SELECT * FROM eq_elder WHERE elder=" . $supervisor;
-	  $this->db2->query($sql,__LINE__,__FILE__);
-	  $this->db2->next_record();
-	  $interviewer_name = $this->db2->f('name');
-	  
-	  if($supervisor == $interviewer) { 
-	    $this->t->set_var('interviewer',$supervisor . ' selected');
-	  } else {
-	    $this->t->set_var('interviewer',$interviewer);
-	  }
-	  $this->t->set_var('interviewer_name',$interviewer_name);
-	  $this->t->fp('int_list','interviewer_list',True);
-	}
+
+      $sql = "SELECT * FROM eq_presidency where valid=1 and (president=1 or counselor=1 or secretary=1 or district!=0)";
+      $this->db2->query($sql,__LINE__,__FILE__);
+      while ($this->db2->next_record())
+      {
+        $elder = $this->db2->f('elder');
+        $interviewer_name = $this->db2->f('name');
+        if($elder == $interviewer) {
+          $this->t->set_var('interviewer',$interviewer . ' selected');
+        } else {
+          $this->t->set_var('interviewer',$interviewer);
+        }
+        $this->t->set_var('interviewer_name',$interviewer_name);
+        $this->t->fp('int_list','interviewer_list',True);
+      }
       
       if($action == 'save')
 	{
-- 
2.34.1