From f61e0db6c6bc1cd0eeb99fad9db237983c90a345 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sun, 12 Sep 2010 10:14:16 -0600 Subject: [PATCH] added YM to ht interview individual list if they are a home teacher --- inc/class.tc.inc.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php index 4b072ca..93d8aed 100644 --- a/inc/class.tc.inc.php +++ b/inc/class.tc.inc.php @@ -1703,7 +1703,7 @@ class tc // create the individual id -> individual name mapping // TODO: changed this so it picks the quorum dynamically - $sql = "SELECT * FROM tc_indiv where valid=1 ORDER BY name ASC"; + $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1 ORDER BY name ASC"; $this->db->query($sql,__LINE__,__FILE__); $i=0; $indiv_id_data = NULL; @@ -1715,6 +1715,21 @@ class tc $individ2name[$indiv_id_data[$i]] = $indiv_name_data[$i]; $i++; } + // add any YM that are home teachers + $sql = "SELECT * FROM tc_companionship where valid=1"; + $this->db->query($sql,__LINE__,__FILE__); + while ($this->db->next_record()) + { + $tmp_indiv_id = $this->db->f('indiv'); + $sql = "Select * FROM tc_indiv where indiv='$tmp_indiv_id' and steward='' and valid=1"; + $this->db2->query($sql,__LINE__,__FILE__); + while ($this->db2->next_record()) { + $indiv_name_data[$i] = $this->db2->f('name'); + $indiv_id_data[$i] = $this->db2->f('indiv'); + $individ2name[$indiv_id_data[$i]] = $indiv_name_data[$i]; + $i++; + } + } array_multisort($indiv_name_data, $indiv_id_data); if($action == 'save') -- 2.34.1