From b64d6c81558b47272c0b2311a93e32de0bfbb1b8 Mon Sep 17 00:00:00 2001
From: Owen Leonard <owen@balawis.leonard.fam>
Date: Fri, 1 Oct 2010 15:15:46 -0600
Subject: [PATCH] last commit just used tc_presidency.email, changed it to use
 tc_presidency.email first, then tc_individual.email

---
 inc/class.tc.inc.php | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php
index a6ad7c1..7dea317 100644
--- a/inc/class.tc.inc.php
+++ b/inc/class.tc.inc.php
@@ -4257,10 +4257,14 @@ class tc
 			$dtstart = gmdate("Ymd"."\T"."His"."\Z", mktime($hour,$minute,$seconds,$month,$day,$year));
 			$dtstartstr = date("l, F d, o g:i A", mktime($hour,$minute,$seconds,$month,$day,$year));
 
-			$sql = "SELECT tp.email AS email, ti.name AS name FROM tc_presidency AS tp JOIN tc_individual AS ti WHERE tp.individual=ti.individual AND tp.presidency='$presidency'";
+			$sql = "SELECT tp.email AS email1, ti.email AS email2, ti.name AS name FROM tc_presidency AS tp JOIN tc_individual AS ti WHERE tp.individual=ti.individual AND tp.presidency='$presidency'";
 			$this->db2->query($sql,__LINE__,__FILE__);
 			if($this->db2->next_record()) {
-				$email = $this->db2->f('email');
+				if ($this->db2->f('email1') != "") {
+					$email = $this->db2->f('email1');
+				} else { 
+					$email = $this->db2->f('email2');
+				}
 				$interviewer = $this->db2->f('name');
 			}
 
-- 
2.34.1