From 81a98152e7cf8876e590a42eb362e99c0e2e742d Mon Sep 17 00:00:00 2001
From: Alan Pippin <apippin@pippins.net>
Date: Fri, 1 Oct 2010 14:50:38 -0600
Subject: [PATCH] Removed all references to mls_id, these were unncessary.
 Fixed PPI location auto filling with supervisor's address

---
 inc/class.tc.inc.php | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php
index 2ba160b..ae33d78 100644
--- a/inc/class.tc.inc.php
+++ b/inc/class.tc.inc.php
@@ -1720,11 +1720,6 @@ class tc
 						$supervisor_last_name = $supervisor_array[0];
 						$sql = "SELECT * FROM tc_individual where individual='$supervisor'";
 						$this->db2->query($sql,__LINE__,__FILE__);
-						if($this->db2->next_record()) {
-							$mls_id = $this->db2->f('mls_id');
-						}
-						$sql = "SELECT * FROM tc_individual where mls_id='$mls_id'";
-						$this->db2->query($sql,__LINE__,__FILE__);
 						if($this->db2->next_record()) {
 							$supervisor_address = $this->db2->f('address');
 						}
@@ -1804,11 +1799,6 @@ class tc
 			$supervisor_last_name = $supervisor_array[0];
 			$sql = "SELECT * FROM tc_individual where individual='$supervisor'";
 			$this->db2->query($sql,__LINE__,__FILE__);
-			if($this->db2->next_record()) {
-				$mls_id = $this->db2->f('mls_id');
-			}
-			$sql = "SELECT * FROM tc_individual where mls_id='$mls_id'";
-			$this->db2->query($sql,__LINE__,__FILE__);
 			if($this->db2->next_record()) {
 				$supervisor_address = $this->db2->f('address');
 			}
@@ -3539,7 +3529,7 @@ class tc
 			$presidency_data[$i]['name'] = $this->db->f('name');
 			$presidency_data[$i]['indiv'] = $this->db->f('individual');
 			$presidency2name[$presidency_data[$i]['id']] = $presidency_data[$i]['name'];
-			$presidency2indiv[$presidency_data[$i]['id']] = $presidency_data[$i]['individual'];
+			$presidency2indiv[$presidency_data[$i]['id']] = $presidency_data[$i]['indiv'];
 			$i++;
 		}
 
@@ -3587,13 +3577,9 @@ class tc
 						} else if($indiv > 0) {
 							$supervisor_name_array = explode(",",$presidency2name[$presidency]);
 							$supervisor_last_name = $supervisor_name_array[0];
+							print "presidency2indiv: $presidency $presidency2indiv[$presidency]<br>";
 							$sql = "SELECT * FROM tc_individual where individual='$presidency2indiv[$presidency]'";
 							$this->db2->query($sql,__LINE__,__FILE__);
-							if($this->db2->next_record()) {
-								$mls_id = $this->db2->f('mls_id');
-							}
-							$sql = "SELECT * FROM tc_individual where mls_id='$mls_id'";
-							$this->db2->query($sql,__LINE__,__FILE__);
 							if($this->db2->next_record()) {
 								$supervisor_address = $this->db2->f('address');
 							}
@@ -3713,11 +3699,6 @@ class tc
 						$supervisor_last_name = $supervisor_name_array[0];
 						$sql = "SELECT * FROM tc_individual where individual='$presidency2indiv[$presidency]'";
 						$this->db2->query($sql,__LINE__,__FILE__);
-						if($this->db2->next_record()) {
-							$mls_id = $this->db2->f('mls_id');
-						}
-						$sql = "SELECT * FROM tc_individual where mls_id='$mls_id'";
-						$this->db2->query($sql,__LINE__,__FILE__);
 						if($this->db2->next_record()) {
 							$supervisor_address = $this->db2->f('address');
 						}
@@ -3751,7 +3732,7 @@ class tc
 				$table_data.= "</td>";
 
 				// individual drop down list (for PPIs)
-				$table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][indiv] STYLE="font-size : 8pt">';
+				$table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][individual] STYLE="font-size : 8pt">';
 				$table_data.= '<option value=0></option>';  
 				for ($j=0; $j < count($individual); $j++) {
 					$id = $individual[$j];
@@ -3807,7 +3788,7 @@ class tc
 				$table_data.= "</td>";
 
 				// individual drop down list
-				$table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][indiv] STYLE="font-size : 8pt">';
+				$table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][individual] STYLE="font-size : 8pt">';
 				$table_data.= '<option value=0></option>';  
 				for ($j=0; $j < count($individual); $j++) {
 					$id = $individual[$j];
-- 
2.34.1