From: Owen Leonard Date: Fri, 17 Sep 2010 06:33:37 +0000 (-0600) Subject: changed indiv fields to individual X-Git-Tag: release_1_0_0~36 X-Git-Url: http://git.pippins.net/embedvideo/.git/%22%22.%24thumbnail.%22/%7Bview%7D?a=commitdiff_plain;h=428f6a4f9c29acce79cd2a94081185bd3fd262d9;p=eq%2F.git changed indiv fields to individual --- diff --git a/bin/import_ward_data b/bin/import_ward_data index 97b3fa1..f2fa90b 100755 --- a/bin/import_ward_data +++ b/bin/import_ward_data @@ -108,7 +108,7 @@ sub print_hash #+-------------+------------------+------+-----+---------+----------------+ #| Field | Type | Null | Key | Default | Extra | #+-------------+------------------+------+-----+---------+----------------+ -#| indiv | int(16) unsigned | | PRI | NULL | auto_increment | +#| individual | int(16) unsigned | | PRI | NULL | auto_increment | #| mls_indiv_id| int(16) unsigned | | | NULL | | #| name | varchar(60) | YES | | NULL | | #| phone | varchar(12) | YES | | NULL | | @@ -133,7 +133,7 @@ sub update_tc_individual_table { $hashref = $membership_data{$index}; $id = $membership_data{$index}{'Indiv ID'}; - $indiv_name = $membership_data{$index}{'Preferred Name'}; + $individual_name = $membership_data{$index}{'Preferred Name'}; $address = $membership_data{$index}{'Street 1'}; if($membership_data{$index}{'Street 2'} ne "") { $address .= " " . $membership_data{$index}{'Street 2'}; @@ -152,46 +152,46 @@ sub update_tc_individual_table if($phone =~ /^\(\d\d\d\) (\d\d\d-\d\d\d\d)/) { $phone = "$1-$2"; } $email = $membership_data{$index}{'indiv E-mail'}; if ($email eq "") { $email = $membership_data{$index}{'Household E-mail'}; } - $sth = $dbh->prepare("select * from tc_individual where name=\"$indiv_name\""); + $sth = $dbh->prepare("select * from tc_individual where name=\"$individual_name\""); $sth->execute or die "-E- DB error: $DBI::errstr\n"; my @data = (); while($sqlhashref = $sth->fetchrow_hashref) { push(@data, $sqlhashref); } my $rows = scalar @data; if($rows == 0) { - # No existing records found for this indiv, make a new entry - print " Adding new indiv: $indiv_name\n"; - $sth = $dbh->prepare("insert into tc_individual values (NULL,'$id',\"$indiv_name\",'$address','$phone','$email','','$hhposition','$priesthood','','$default_interview_pri','','$default_interview_pri','',$attending,1)"); + # No existing records found for this individual, make a new entry + print " Adding new individual: $individual_name\n"; + $sth = $dbh->prepare("insert into tc_individual values (NULL,'$id',\"$individual_name\",'$address','$phone','$email','','$hhposition','$priesthood','','$default_interview_pri','','$default_interview_pri','',$attending,1)"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; } elsif($rows == 1) { - # An existing record was found for this indiv, update it - print " Updating existing indiv: $indiv_name\n"; - $sth = $dbh->prepare("update tc_individual set valid=1 where name=\"$indiv_name\""); + # An existing record was found for this individual, update it + print " Updating existing individual: $individual_name\n"; + $sth = $dbh->prepare("update tc_individual set valid=1 where name=\"$individual_name\""); $sth->execute or die "-E- DB error: $DBI::errstr\n"; if($phone ne "") { - $sth = $dbh->prepare("update tc_individual set phone='$phone' where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set phone='$phone' where name=\"$individual_name\""); } else { - $sth = $dbh->prepare("update tc_individual set phone=NULL where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set phone=NULL where name=\"$individual_name\""); } $sth->execute or die "-E- DB error: $DBI::errstr\n"; if($address ne "") { - $sth = $dbh->prepare("update tc_individual set address='$address' where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set address='$address' where name=\"$individual_name\""); } else { - $sth = $dbh->prepare("update tc_individual set address=NULL where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set address=NULL where name=\"$individual_name\""); } $sth->execute or die "-E- DB error: $DBI::errstr\n"; - $sth = $dbh->prepare("update tc_individual set attending='$attending' where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set attending='$attending' where name=\"$individual_name\""); $sth->execute or die "-E- DB error: $DBI::errstr\n"; - $sth = $dbh->prepare("update tc_individual set mls_indiv_id='$id' where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set mls_indiv_id='$id' where name=\"$individual_name\""); $sth->execute or die "-E- DB error: $DBI::errstr\n"; - $sth = $dbh->prepare("update tc_individual set priesthood='$priesthood' where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set priesthood='$priesthood' where name=\"$individual_name\""); $sth->execute or die "-E- DB error: $DBI::errstr\n"; - $sth = $dbh->prepare("update tc_individual set email='$email' where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set email='$email' where name=\"$individual_name\""); $sth->execute or die "-E- DB error: $DBI::errstr\n"; - $sth = $dbh->prepare("update tc_individual set hh_position='$hhposition' where name=\"$indiv_name\""); + $sth = $dbh->prepare("update tc_individual set hh_position='$hhposition' where name=\"$individual_name\""); $sth->execute or die "-E- DB error: $DBI::errstr\n"; } else { # More than one record was found. Error! This shouldn't happen. - print " -E- More than one record found ($rows) for indiv: $indiv_name\n"; + print " -E- More than one record found ($rows) for individual: $individual_name\n"; } } $sth->finish(); @@ -261,7 +261,7 @@ sub update_tc_district_table $sth2 = $dbh->prepare("select * from tc_individual where name='$supervisor_name'"); $sth2->execute or die "-E- DB error: $DBI::errstr\n"; $sqlhashref2 = $sth2->fetchrow_hashref; - $supervisor_id = $sqlhashref2->{indiv}; + $supervisor_id = $sqlhashref2->{individual}; $sth2->finish(); $sth2 = $dbh->prepare("update tc_district set supervisor='$supervisor_id' where district='$district'"); $sth2->execute or die "-E- DB error: $DBI::errstr\n"; @@ -275,7 +275,7 @@ sub update_tc_district_table #| Field | Type | Null | Key | Default | Extra | #+---------------+------------------+------+-----+---------+-------+ #| companionship | int(16) unsigned | | | 0 | | -#| indiv | int(16) unsigned | YES | | NULL | | +#| individual | int(16) unsigned | YES | | NULL | | #| district | int(16) unsigned | YES | | NULL | | #| valid | tinyint(1) | YES | | NULL | | #+---------------+------------------+------+-----+---------+-------+ @@ -293,34 +293,34 @@ sub update_tc_companionship_table foreach $key (keys %$hashref) { if($key =~ /Quorum/i && $hometeaching_data{$index}{$key} =~ /Elders/i) { foreach $field ("Home Teacher 1","Home Teacher 2") { - $indiv_name = $hometeaching_data{$index}{$field}; - if($indiv_name eq "") { next; } - $sth2 = $dbh->prepare("select * from tc_individual where name='$indiv_name'"); + $individual_name = $hometeaching_data{$index}{$field}; + if($individual_name eq "") { next; } + $sth2 = $dbh->prepare("select * from tc_individual where name='$individual_name'"); $sth2->execute or die "-E- DB error: $DBI::errstr\n"; $sqlhashref2 = $sth2->fetchrow_hashref; - $indiv = $sqlhashref2->{indiv}; + $individual = $sqlhashref2->{individual}; $id = $hometeaching_data{$index}{'Comp ID'}; $district = $hometeaching_data{$index}{'HT District'}; - $sth = $dbh->prepare("select * from tc_companionship where indiv='$indiv' and companionship='$id'"); + $sth = $dbh->prepare("select * from tc_companionship where individual='$individual' and companionship='$id'"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; my @data = (); while($sqlhashref = $sth->fetchrow_hashref) { push(@data, $sqlhashref); } my $rows = scalar @data; if($rows == 0) { # No existing records found for this companionship, make a new entry - print " Adding Companion to companionship: $indiv_name -> $id\n"; - $sth = $dbh->prepare("insert into tc_companionship values ($id,'$indiv','$district',1)"); + print " Adding Companion to companionship: $individual_name -> $id\n"; + $sth = $dbh->prepare("insert into tc_companionship values ($id,'$individual','$district',1)"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; } else { # An existing companionship was found for this companionship, update it $sth2 = $dbh->prepare("select * from tc_companionship where district='$district' and companionship='$id'"); $sth2->execute or die "-E- DB error: $DBI::errstr\n"; - print " Updating Companionship with indiv: $indiv_name ($indiv) -> $id\n"; - $sth = $dbh->prepare("update tc_companionship set district='$district' where indiv='$indiv' and companionship='$id'"); + print " Updating Companionship with individual: $individual_name ($individual) -> $id\n"; + $sth = $dbh->prepare("update tc_companionship set district='$district' where individual='$individual' and companionship='$id'"); $sth->execute or die "-E- DB error 'district': $DBI::errstr\n"; - $sth = $dbh->prepare("update tc_companionship set indiv='$indiv' where indiv='$indiv' and companionship='$id'"); - $sth->execute or die "-E- DB error 'indiv': $DBI::errstr\n"; - $sth = $dbh->prepare("update tc_companionship set valid=1 where indiv='$indiv' and companionship='$id'"); + $sth = $dbh->prepare("update tc_companionship set individual='$individual' where individual='$individual' and companionship='$id'"); + $sth->execute or die "-E- DB error 'individual': $DBI::errstr\n"; + $sth = $dbh->prepare("update tc_companionship set valid=1 where individual='$individual' and companionship='$id'"); $sth->execute or die "-E- DB error 'valid': $DBI::errstr\n"; } $sth->finish(); @@ -393,7 +393,7 @@ sub update_tc_family_table $sth = $dbh->prepare("select * from tc_individual WHERE name='$family_name'"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; while($sqlhashref = $sth->fetchrow_hashref) { - $individual = $sqlhashref->{indiv}; + $individual = $sqlhashref->{individual}; print " Updating family individual: $family_name -> $individual\n"; $sth = $dbh->prepare("update tc_family set individual=$individual where name_id='$name_id'"); $sth->execute or die "-E- DB error: $DBI::errstr\n"; diff --git a/inc/class.tc.inc.php b/inc/class.tc.inc.php index 9f3e12c..49d9a49 100644 --- a/inc/class.tc.inc.php +++ b/inc/class.tc.inc.php @@ -200,11 +200,11 @@ class tc $i++; } - $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY indiv ASC"; + $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY individual ASC"; $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_name[$i] = $this->db->f('name'); $indiv_phone[$individual[$i]] = $this->db->f('phone'); $i++; @@ -250,7 +250,7 @@ class tc // Get this companions information if($companion_table_entry != "") { $companion_table_entry .= " / "; } $companionship = $this->db->f('companionship'); - $individual = $this->db->f('indiv'); + $individual = $this->db->f('individual'); $name = $indivs[$individual]; $phone = $indiv_phone[$individual]; $companion_table_entry .= "$name"; @@ -427,11 +427,11 @@ class tc return false; } - $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY indiv ASC"; + $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY individual ASC"; $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_name[$i] = $this->db->f('name'); $indiv_phone[$individual[$i]] = $this->db->f('phone'); $i++; @@ -466,7 +466,7 @@ class tc // Get this companions information if($companion_table_entry != "") { $companion_table_entry .= " / "; } $companionship = $this->db->f('companionship'); - $individual = $this->db->f('indiv'); + $individual = $this->db->f('individual'); $name = $indivs[$individual]; $phone = $indiv_phone[$individual]; $companion_table_entry .= "$name"; @@ -665,12 +665,12 @@ class tc $i = 0; while ($this->db->next_record()) { - $part_list[$i]['indiv'] = $this->db->f('indiv'); + $part_list[$i]['individual'] = $this->db->f('individual'); $i++; } for ($i=0; $i < count($part_list); $i++) { - $sql = "SELECT * FROM tc_individual WHERE indiv=" . $part_list[$i]['indiv']; + $sql = "SELECT * FROM tc_individual WHERE individual=" . $part_list[$i]['individual']; $this->db->query($sql,__LINE__,__FILE__); $this->db->next_record(); $names[$i] = $this->db->f('name'); @@ -696,7 +696,7 @@ class tc function act_update() { $this->t->set_file(array('form' => 'act_update.tpl')); - $this->t->set_block('form','indiv_list','list'); + $this->t->set_block('form','individual_list','list'); $this->t->set_block('form','add','addhandle'); $this->t->set_block('form','edit','edithandle'); $this->t->set_var('lang_done','Done'); @@ -719,11 +719,11 @@ class tc $this->db->query("DELETE from tc_participation where activity=".$activity['activity'],__LINE__,__FILE__); // Re-add the individuals who are checked as having participated in this activity - $indivs = get_var('indiv_name',array('POST')); + $indivs = get_var('individual_name',array('POST')); if(is_array($indivs)) { // Only do the foreach loop if we have a valid array of indivs to work with foreach ($indivs as $indiv) { - $this->db->query("INSERT INTO tc_participation (indiv,activity) " . - "VALUES (" . $indiv . ",". $activity['activity'] . ")",__LINE__,__FILE__); + $this->db->query("INSERT INTO tc_participation (individual,activity) " . + "VALUES (" . $individual . ",". $activity['activity'] . ")",__LINE__,__FILE__); } } @@ -747,11 +747,11 @@ class tc $activity['activity'] = $this->db->f('activity'); } - $indivs = get_var('indiv_name',array('POST')); + $indivs = get_var('individual_name',array('POST')); foreach ($indivs as $indiv) { - $this->db->query("INSERT INTO tc_participation (indiv,activity) " . - "VALUES (" . $indiv . ",". $activity['activity'] . ")",__LINE__,__FILE__); + $this->db->query("INSERT INTO tc_participation (individual,activity) " . + "VALUES (" . $individual . ",". $activity['activity'] . ")",__LINE__,__FILE__); } $this->act_list(); @@ -818,7 +818,7 @@ class tc while ($this->db->next_record()) { if($this->db->f('valid') == 1 || $action != 'add') { $indiv_name[$i] = $this->db->f('name'); - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_valid[$i] = $this->db->f('valid'); $i++; } @@ -828,7 +828,7 @@ class tc $j=0; for ($i=0; $i < count($individual); $i++) { //$this->nextmatchs->template_alternate_row_color(&$this->t); - $sql = "SELECT * FROM tc_participation where activity=". $activity['activity'] . " AND indiv=" . $individual[$i]; + $sql = "SELECT * FROM tc_participation where activity=". $activity['activity'] . " AND individual=" . $individual[$i]; $this->db->query($sql,__LINE__,__FILE__); if($this->db->next_record()) { $this->t->set_var('checked','checked'); @@ -838,15 +838,15 @@ class tc $checked=0; } if($checked || $indiv_valid[$i] == 1) { - $this->t->set_var('indiv_name',$indiv_name[$i]); - $this->t->set_var('indiv',$individual[$i]); + $this->t->set_var('individual_name',$indiv_name[$i]); + $this->t->set_var('individual',$individual[$i]); if(($j+1) % 3 == 0) { $this->t->set_var('table_sep',""); } else { $this->t->set_var('table_sep',""); } if(($j) % 3 == 0) { $this->nextmatchs->template_alternate_row_color(&$this->t); } - $this->t->fp('list','indiv_list',True); + $this->t->fp('list','individual_list',True); $j++; } } @@ -981,18 +981,18 @@ class tc { $this->t->set_file(array('par_view_t' => 'par_view.tpl')); $this->t->set_block('par_view_t','header_list','list1'); - $this->t->set_block('par_view_t','indiv_list','list2'); + $this->t->set_block('par_view_t','individual_list','list2'); // TODO: changed this so it picks the quorum dynamically $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1"; $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $indiv_name[$i] = $this->db->f('name'); - $individual[$i] = $this->db->f('indiv'); + $individual_name[$i] = $this->db->f('name'); + $individual[$i] = $this->db->f('individual'); $i++; } - array_multisort($indiv_name, $individual); + array_multisort($individual_name, $individual); $sql = "SELECT * FROM tc_activity ORDER BY date DESC"; $this->db->query($sql,__LINE__,__FILE__); @@ -1016,8 +1016,8 @@ class tc $i++; } - $indiv_width=300; $part_width=25; $assignment_width=50; - $total_width=$indiv_width+$part_width; + $individual_width=300; $part_width=25; $assignment_width=50; + $total_width=$individual_width+$part_width; for ($i=0; $i < count($assignment_list); $i++) { $this->t->set_var('assignment_name',$assignment_list[$i]['name']); $this->t->set_var('assignment_code',$assignment_list[$i]['code']); @@ -1028,14 +1028,14 @@ class tc for ($i=0; $i < count($individual); $i++) { $participated=0; $part_table = ''; $this->nextmatchs->template_alternate_row_color(&$this->t); - $this->t->set_var('indiv_name',$indiv_name[$i]); + $this->t->set_var('individual_name',$individual_name[$i]); for ($j=0; $j < count($assignment_list); $j++) { $date = "0000-00-00"; $checkmark=0; $num_matches=0; for ($k=0; $k < count($activity_list); $k++) { if($assignment_list[$j]['assignment'] == $activity_list[$k]['assignment']) { $sql = "SELECT * FROM tc_participation where " . " activity=" . $activity_list[$k]['activity'] . - " AND indiv=" . $individual[$i]; + " AND individual=" . $individual[$i]; $this->db->query($sql,__LINE__,__FILE__); while($this->db->next_record()) { if($activity_list[$k]['date'] > $date) { @@ -1061,10 +1061,10 @@ class tc $part_table .= ' '; } $this->t->set_var('part_table',$part_table); - $this->t->fp('list2','indiv_list',True); + $this->t->fp('list2','individual_list',True); } $this->t->set_var('total_width',$total_width); - $this->t->set_var('indiv_width',$indiv_width); + $this->t->set_var('individual_width',$individual_width); $this->t->set_var('part_width',$part_width); $this->t->set_var('act_width',$act_width); $this->t->pfp('out','par_view_t'); @@ -1075,7 +1075,7 @@ class tc { $this->t->set_file(array('willing_view_t' => 'willing_view.tpl')); $this->t->set_block('willing_view_t','header_list','list1'); - $this->t->set_block('willing_view_t','indiv_list','list2'); + $this->t->set_block('willing_view_t','individual_list','list2'); $this->t->set_var('lang_filter','Filter'); $this->t->set_var('lang_filter_unwilling','Filter out unwilling individuals:'); @@ -1100,7 +1100,7 @@ class tc $i=0; while ($this->db->next_record()) { $indiv_name[$i] = $this->db->f('name'); - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_phone[$individual[$i]] = $this->db->f('phone'); $i++; } @@ -1141,15 +1141,15 @@ class tc for ($i=0; $i < count($individual); $i++) { $willing_table = ''; $indiv_willing=0; - $this->t->set_var('indiv_name',$indiv_name[$i]); - $this->t->set_var('indiv_phone',$indiv_phone[$individual[$i]]); + $this->t->set_var('individual_name',$indiv_name[$i]); + $this->t->set_var('individual_phone',$indiv_phone[$individual[$i]]); $this->t->set_var('editurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.willing_update&individual=' . $individual[$i] . '&action=' . 'edit')); for ($j=0; $j < count($assignment_list); $j++) { $found_willingness=0; $sql = "SELECT * FROM tc_willingness where " . " assignment=" . $assignment_list[$j]['assignment'] . - " AND indiv=" . $individual[$i]; + " AND individual=" . $individual[$i]; $this->db->query($sql,__LINE__,__FILE__); while($this->db->next_record()) { $found_willingness=1; @@ -1163,7 +1163,7 @@ class tc $date = $this->db2->f('date'); $sql = "SELECT * FROM tc_participation where " . " activity=" . $activity . - " AND indiv=". $individual[$i]; + " AND individual=". $individual[$i]; $this->db3->query($sql,__LINE__,__FILE__); if($this->db3->next_record()) { $date_part = $date; @@ -1188,7 +1188,7 @@ class tc } if(($indiv_willing == 1) || ($filter_unwilling == 'n')) { $this->t->set_var('willing_table',$willing_table); - $this->t->fp('list2','indiv_list',True); + $this->t->fp('list2','individual_list',True); $this->nextmatchs->template_alternate_row_color(&$this->t); } } @@ -1200,7 +1200,7 @@ class tc $this->t->set_var('stat_table',$stat_table); $this->t->set_var('total_width',$total_width); - $this->t->set_var('indiv_width',$indiv_width); + $this->t->set_var('individual_width',$indiv_width); $this->t->set_var('willing_width',$willing_width); $this->t->pfp('out','willing_view_t'); $this->save_sessiondata(); @@ -1227,7 +1227,7 @@ class tc if($action == 'save') { // Delete all the previous willingness entries for this individual - $this->db->query("DELETE from tc_willingness where indiv=" . $individual ,__LINE__,__FILE__); + $this->db->query("DELETE from tc_willingness where individual=" . $individual ,__LINE__,__FILE__); // Now, add the assignment willingness that is checked for this individual $new_data = get_var('willingness',array('POST')); @@ -1236,7 +1236,7 @@ class tc $assignment = $data_array[0]; $willing = $data_array[1]; //print "individual: $individual assignment: $assignment willing: $willing
"; - $this->db->query("INSERT INTO tc_willingness (indiv,assignment,willing) " . + $this->db->query("INSERT INTO tc_willingness (individual,assignment,willing) " . "VALUES (" . $individual .",". $assignment .",'". $willing . "')",__LINE__,__FILE__); } $this->willing_view(); @@ -1247,11 +1247,11 @@ class tc $table_data=""; // Find out the individual's name - $sql = "SELECT * FROM tc_individual WHERE indiv=".$individual." AND valid=1"; + $sql = "SELECT * FROM tc_individual WHERE individual=".$individual." AND valid=1"; $this->db->query($sql,__LINE__,__FILE__); if($this->db->next_record()) { $indiv_name = $this->db->f('name'); - $this->t->set_var('indiv_name',$indiv_name); + $this->t->set_var('individual_name',$indiv_name); } // Select all the assignments @@ -1267,7 +1267,7 @@ class tc $table_data.="$assignment_name"; $header_row="AssignmentsWillingness"; - $sql = "SELECT * FROM tc_willingness WHERE indiv=".$individual." AND assignment=".$assignment; + $sql = "SELECT * FROM tc_willingness WHERE individual=".$individual." AND assignment=".$assignment; $this->db2->query($sql,__LINE__,__FILE__); $value = $assignment; @@ -1325,7 +1325,7 @@ class tc function ppi_sched() { $this->t->set_file(array('ppi_sched_t' => 'ppi_sched.tpl')); - $this->t->set_block('ppi_sched_t','indiv_list','indivlist'); + $this->t->set_block('ppi_sched_t','individual_list','indivlist'); $this->t->set_block('ppi_sched_t','appt_list','apptlist'); $action = get_var('action',array('GET','POST')); @@ -1359,12 +1359,12 @@ class tc $president_name = $this->db->f('name'); $president_name_array = explode(",",$president_name); $president_last_name = $president_name_array[0]; - $president_id = $this->db->f('indiv'); + $president_id = $this->db->f('individual'); $presidency_id = $this->db->f('presidency'); - $interviewer = $this->db->f('indiv'); + $interviewer = $this->db->f('individual'); $district_number = '*'; $district_name = $president_name; - $sql = "SELECT * FROM tc_individual where indiv='$president_id'"; + $sql = "SELECT * FROM tc_individual where individual='$president_id'"; $this->db2->query($sql,__LINE__,__FILE__); if($this->db2->next_record()) { $mls_indiv_id = $this->db2->f('mls_indiv_id'); @@ -1384,19 +1384,19 @@ class tc $new_data = get_var('appt_notes',array('POST')); if($new_data != "") { foreach ($new_data as $entry) { - $indiv = $entry['indiv']; + $indiv = $entry['individual']; $appointment = $entry['appointment']; $location = $entry['location']; if($location == "") { $location = "$president_last_name"." home ($president_address)"; } if($indiv == 0) { $location = ""; } //Only perform a database update if we have made a change to this appointment - $sql = "SELECT * FROM tc_appointment where appointment='$appointment' and indiv='$indiv' and location='$location'"; + $sql = "SELECT * FROM tc_appointment where appointment='$appointment' and individual='$indiv' and location='$location'"; $this->db->query($sql,__LINE__,__FILE__); if(!$this->db->next_record()) { // Perform database save actions here $this->db->query("UPDATE tc_appointment set " . - " indiv='" . $indiv . "'" . + " individual='" . $indiv . "'" . ",location='" . $location . "'" . " WHERE appointment=" . $appointment,__LINE__,__FILE__); // Email the appointment @@ -1416,7 +1416,7 @@ class tc $this->db->query("UPDATE tc_individual set " . " ppi_notes='" . $ppi_notes . "'" . ",ppi_pri='" . $ppi_pri . "'" . - " WHERE indiv=" . $individual,__LINE__,__FILE__); + " WHERE individual=" . $individual,__LINE__,__FILE__); } @@ -1433,7 +1433,7 @@ class tc $indiv_name = NULL; while ($this->db->next_record()) { $indiv_name[$i] = $this->db->f('name'); - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $i++; } array_multisort($indiv_name, $individual); @@ -1462,7 +1462,7 @@ class tc while ($this->db->next_record()) { $appointment = $this->db->f('appointment'); - $indiv = $this->db->f('indiv'); + $indiv = $this->db->f('individual'); $location = $this->db->f('location'); if(($location == "") && ($indiv > 0)) { $location = "$president_last_name"." home ($president_address)"; } @@ -1479,7 +1479,7 @@ class tc $appt_table_data.= "$day_string"; $appt_table_data.= "$time_string"; - $appt_table_data.= ''; $appt_table_data.= ''; for ($i=0; $i < count($individual); $i++) { $id = $individual[$i]; @@ -1514,7 +1514,7 @@ class tc $i=0; $individual = NULL; while ($this->db->next_record()) { - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_name[$i] = $this->db->f('name'); $indiv_phone[$individual[$i]] = $this->db->f('phone'); $indiv_ppi_pri[$individual[$i]] = $this->db->f('ppi_pri'); @@ -1535,11 +1535,11 @@ class tc // If this individual has had a yearly PPI this year, don't show him on the schedule list $year_start = $year - 1 . "-12-31"; $year_end = $year + 1 . "-01-01"; $sql = "SELECT * FROM tc_interview WHERE date > '$year_start' AND date < '$year_end' ". - "AND indiv=" . $id . " AND interview_type='ppi'"; + "AND individual=" . $id . " AND interview_type='ppi'"; $this->db2->query($sql,__LINE__,__FILE__); if(!$this->db2->next_record()) { - $sql = "SELECT * FROM tc_interview WHERE indiv=" . $id . " AND interview_type='ppi' ORDER BY date DESC"; + $sql = "SELECT * FROM tc_interview WHERE individual=" . $id . " AND interview_type='ppi' ORDER BY date DESC"; $this->db->query($sql,__LINE__,__FILE__); if($this->db->next_record()) { $date = $this->db->f('date'); @@ -1547,7 +1547,7 @@ class tc $date = ""; } $link_data['menuaction'] = 'tc.tc.ppi_update'; - $link_data['indiv'] = $id; + $link_data['individual'] = $id; $link_data['name'] = $name; $link_data['interview'] = ''; $link_data['interview_type'] = 1; @@ -1580,7 +1580,7 @@ class tc } else { $link_data['menuaction'] = 'tc.tc.ppi_update'; $link_data['interviewer'] = $this->db2->f('interviewer'); - $link_data['indiv'] = $this->db2->f('indiv'); + $link_data['individual'] = $this->db2->f('individual'); $link_data['name'] = $name; $link_data['interview'] = $this->db2->f('interview'); $link_data['interview_type'] = $this->db2->f('interview_type'); @@ -1613,7 +1613,7 @@ class tc $this->t->set_var('completed_header_row',$completed_header_row); $this->t->set_var('completed_table_width',$completed_table_width); $this->t->set_var('completed',$completed_data); - $this->t->fp('indivlist','indiv_list',True); + $this->t->fp('indivlist','individual_list',True); $indivs_width=300; $totals_width=100; $totals_table_width=$indivs_width + $totals_width; @@ -1642,7 +1642,7 @@ class tc function int_sched() { $this->t->set_file(array('int_sched_t' => 'int_sched.tpl')); - $this->t->set_block('int_sched_t','indiv_list','indivlist'); + $this->t->set_block('int_sched_t','individual_list','indivlist'); $this->t->set_block('int_sched_t','appt_list','apptlist'); $action = get_var('action',array('GET','POST')); @@ -1685,7 +1685,7 @@ class tc $indiv_name_data = NULL; while ($this->db->next_record()) { $indiv_name_data[$i] = $this->db->f('name'); - $individual_data[$i] = $this->db->f('indiv'); + $individual_data[$i] = $this->db->f('individual'); $individ2name[$individual_data[$i]] = $indiv_name_data[$i]; $i++; } @@ -1693,12 +1693,12 @@ class tc $sql = "SELECT * FROM tc_companionship where valid=1"; $this->db->query($sql,__LINE__,__FILE__); while ($this->db->next_record()) { - $tmp_individual = $this->db->f('indiv'); - $sql = "Select * FROM tc_individual where indiv='$tmp_individual' and steward='' and valid=1"; + $tmp_individual = $this->db->f('individual'); + $sql = "Select * FROM tc_individual where individual='$tmp_individual' and steward='' and valid=1"; $this->db2->query($sql,__LINE__,__FILE__); while ($this->db2->next_record()) { $indiv_name_data[$i] = $this->db2->f('name'); - $individual_data[$i] = $this->db2->f('indiv'); + $individual_data[$i] = $this->db2->f('individual'); $individ2name[$individual_data[$i]] = $indiv_name_data[$i]; $i++; } @@ -1710,14 +1710,14 @@ class tc $new_data = get_var('appt_notes',array('POST')); if($new_data != "") { foreach ($new_data as $entry) { - $indiv = $entry['indiv']; + $indiv = $entry['individual']; $appointment = $entry['appointment']; $location = $entry['location']; if($location == "") { $supervisor = $entry['supervisor']; $supervisor_array = explode(",", $individ2name[$supervisor]); $supervisor_last_name = $supervisor_array[0]; - $sql = "SELECT * FROM tc_individual where indiv='$supervisor'"; + $sql = "SELECT * FROM tc_individual where individual='$supervisor'"; $this->db2->query($sql,__LINE__,__FILE__); if($this->db2->next_record()) { $mls_indiv_id = $this->db2->f('mls_indiv_id'); @@ -1733,12 +1733,12 @@ class tc //print "indiv: $indiv appointment: $appointment
"; //Only perform a database update if we have made a change to this appointment - $sql = "SELECT * FROM tc_appointment where appointment='$appointment' and indiv='$indiv' and location='$location'"; + $sql = "SELECT * FROM tc_appointment where appointment='$appointment' and individual='$indiv' and location='$location'"; $this->db->query($sql,__LINE__,__FILE__); if(!$this->db->next_record()) { // Perform database save actions here $this->db->query("UPDATE tc_appointment set " . - " indiv='" . $indiv . "'" . + " individual='" . $indiv . "'" . ",location='" . $location . "'" . " WHERE appointment=" . $appointment,__LINE__,__FILE__); // Email the appointment @@ -1759,7 +1759,7 @@ class tc $this->db->query("UPDATE tc_individual set " . " hti_notes='" . $hti_notes . "'" . ",hti_pri='" . $hti_pri . "'" . - " WHERE indiv=" . $individual,__LINE__,__FILE__); + " WHERE individual=" . $individual,__LINE__,__FILE__); } $take_me_to_url = $GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.int_sched'); @@ -1803,7 +1803,7 @@ class tc $supervisor = $districts[$d]['supervisor']; $supervisor_array = explode(",", $supervisor); $supervisor_last_name = $supervisor_array[0]; - $sql = "SELECT * FROM tc_individual where indiv='$supervisor'"; + $sql = "SELECT * FROM tc_individual where individual='$supervisor'"; $this->db2->query($sql,__LINE__,__FILE__); if($this->db2->next_record()) { $mls_indiv_id = $this->db2->f('mls_indiv_id'); @@ -1825,7 +1825,7 @@ class tc while ($this->db->next_record()) { $appointment = $this->db->f('appointment'); - $indiv = $this->db->f('indiv'); + $indiv = $this->db->f('individual'); $location = $this->db->f('location'); if(($location == "") && ($indiv > 0)) { $location = "$supervisor_last_name"." home ($supervisor_address)"; } @@ -1842,7 +1842,7 @@ class tc $appt_table_data.= "$day_string"; $appt_table_data.= "$time_string"; - $appt_table_data.= ''; $appt_table_data.= ''; for ($i=0; $i < count($individual_data); $i++) { $id = $individual_data[$i]; @@ -1894,12 +1894,12 @@ class tc $total_comps++; while ($this->db->next_record()) { // Get this companions information - $individual = $this->db->f('indiv'); + $individual = $this->db->f('individual'); - $sql = "SELECT * FROM tc_individual where indiv='$individual'"; + $sql = "SELECT * FROM tc_individual where individual='$individual'"; $this->db2->query($sql,__LINE__,__FILE__); if($this->db2->next_record()) { - $individual = $this->db2->f('indiv'); + $individual = $this->db2->f('individual'); $indiv_name = $this->db2->f('name'); $indiv_phone[$individual] = $this->db2->f('phone'); $indiv_hti_pri[$individual] = $this->db2->f('hti_pri'); @@ -1927,11 +1927,11 @@ class tc } // If this companionship has had a hometeaching interview this quarter, don't show them on the schedule list - $sql = "SELECT * FROM tc_interview WHERE date >= '$quarter_start' AND date < '$quarter_end' AND indiv='$id'"; + $sql = "SELECT * FROM tc_interview WHERE date >= '$quarter_start' AND date < '$quarter_end' AND individual='$id'"; $this->db2->query($sql,__LINE__,__FILE__); if(!$this->db2->next_record()) { - $sql = "SELECT * FROM tc_interview WHERE indiv='$id' ORDER BY date DESC"; + $sql = "SELECT * FROM tc_interview WHERE individual='$id' ORDER BY date DESC"; $this->db3->query($sql,__LINE__,__FILE__); if($this->db3->next_record()) { $date = $this->db3->f('date'); @@ -1939,7 +1939,7 @@ class tc $date = ""; } $link_data['menuaction'] = 'tc.tc.int_update'; - $link_data['indiv'] = $id; + $link_data['individual'] = $id; $link_data['name'] = $name; $link_data['interview'] = ''; $link_data['action'] = 'add'; @@ -1969,7 +1969,7 @@ class tc } else { $link_data['menuaction'] = 'tc.tc.int_update'; $link_data['interviewer'] = $this->db2->f('interviewer'); - $link_data['indiv'] = $this->db2->f('indiv'); + $link_data['individual'] = $this->db2->f('individual'); $link_data['name'] = $name; $link_data['interview'] = $this->db2->f('interview'); $link_data['action'] = 'view'; @@ -2001,7 +2001,7 @@ class tc $this->t->set_var('completed_header_row',$completed_header_row); $this->t->set_var('completed_table_width',$completed_table_width); $this->t->set_var('completed',$completed_data); - $this->t->fp('indivlist','indiv_list',True); + $this->t->fp('indivlist','individual_list',True); } // End for each district loop @@ -2380,7 +2380,7 @@ class tc $this->db->query($sql,__LINE__,__FILE__); if($this->db->next_record()) { $president_name = $this->db->f('name'); - $interviewer = $this->db->f('indiv'); + $interviewer = $this->db->f('individual'); $interview_type = 'ppi'; } else { print "

-E- Unable to locate President in tc_presidency table

"; @@ -2390,11 +2390,11 @@ class tc $this->t->set_var('district_name',$president_name); // TODO: changed this so it picks the quorum dynamically - $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY indiv ASC"; + $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY individual ASC"; $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_name[$i] = $this->db->f('name'); $indiv_phone[$individual[$i]] = $this->db->f('phone'); $indiv_ppi_pri[$individual[$i]] = $this->db->f('ppi_pri'); @@ -2436,7 +2436,7 @@ class tc $year = date('Y') - $m; $year_start = $year - 1 . "-12-31"; $year_end = $year + 1 . "-01-01"; $sql = "SELECT * FROM tc_interview WHERE date > '$year_start' AND date < '$year_end' ". - "AND indiv=" . $id . " AND interview_type='ppi'"; + "AND individual=" . $id . " AND interview_type='ppi'"; $this->db2->query($sql,__LINE__,__FILE__); if(!$total_ppis[$m]) { $total_ppis[$m] = 0; } @@ -2503,7 +2503,7 @@ class tc $sql = "SELECT * FROM tc_presidency where valid=1 and (president=1 or counselor=1 or secretary=1)"; $this->db2->query($sql,__LINE__,__FILE__); while ($this->db2->next_record()) { - $indiv = $this->db2->f('indiv'); + $indiv = $this->db2->f('individual'); $interviewer_name = $this->db2->f('name'); if($indiv == $interviewer) { $this->t->set_var('interviewer',$interviewer . ' selected'); @@ -2520,7 +2520,7 @@ class tc $this->db->query("UPDATE tc_interview set " . " interview='" . $interview . "'" . ", interviewer='" . $interviewer . "'" . - ", indiv='" . $indiv . "'" . + ", individual='" . $indiv . "'" . ", date='" . $date . "'" . ", notes='" . $notes . "'" . ", interview_type='" . $interview_type . "'" . @@ -2531,7 +2531,7 @@ class tc if($action == 'insert') { $notes = get_var('notes',array('POST')); - $this->db->query("INSERT INTO tc_interview (interviewer,indiv,date,notes,interview_type) " . + $this->db->query("INSERT INTO tc_interview (interviewer,individual,date,notes,interview_type) " . "VALUES ('" . $interviewer . "','" . $indiv . "','" . $date . "','" . $notes . "','" . $interview_type ."')",__LINE__,__FILE__); $this->ppi_view(); @@ -2643,11 +2643,11 @@ class tc $i++; } - $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY indiv ASC"; + $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY individual ASC"; $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_name[$i] = $this->db->f('name'); $indiv_phone[$individual[$i]] = $this->db->f('phone'); $i++; @@ -2689,7 +2689,7 @@ class tc // Get this companions information $num_indivs++; $companionship = $this->db->f('companionship'); - $individual = $this->db->f('indiv'); + $individual = $this->db->f('individual'); $name = $indivs[$individual]; $phone = $indiv_phone[$individual]; $link_data['menuaction'] = 'tc.tc.int_update'; @@ -2717,7 +2717,7 @@ class tc $month_end = "$year"."-"."$month"."-"."31"; $month = "$month"."/"."$year"; $sql = "SELECT * FROM tc_interview WHERE date >= '$month_start' AND date <= '$month_end' ". - "AND indiv=" . $individual; + "AND individual=" . $individual; $this->db2->query($sql,__LINE__,__FILE__); $header_row .= "$month"; @@ -2826,7 +2826,7 @@ class tc $sql = "SELECT * FROM tc_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()) { - $indiv = $this->db2->f('indiv'); + $indiv = $this->db2->f('individual'); $interviewer_name = $this->db2->f('name'); if($indiv == $interviewer) { $this->t->set_var('interviewer',$interviewer . ' selected'); @@ -2842,7 +2842,7 @@ class tc $this->db->query("UPDATE tc_interview set " . " interview='" . $interview . "'" . ", interviewer='" . $interviewer . "'" . - ", indiv='" . $indiv . "'" . + ", individual='" . $indiv . "'" . ", date='" . $date . "'" . ", notes='" . $notes . "'" . ", interview_type='" . $interview_type . "'" . @@ -2853,7 +2853,7 @@ class tc if($action == 'insert') { $notes = get_var('notes',array('POST')); - $this->db->query("INSERT INTO tc_interview (interviewer,indiv,date,notes,interview_type) " . + $this->db->query("INSERT INTO tc_interview (interviewer,individual,date,notes,interview_type) " . "VALUES ('" . $interviewer . "','" . $indiv . "','" . $date . "','" . $notes ."','" . $interview_type . "')",__LINE__,__FILE__); $this->int_view(); @@ -2881,7 +2881,7 @@ class tc $this->t->set_var('interview',$interview); $this->t->set_var('name',$name); $this->t->set_var('interviewer', $this->db->f('interviewer')); - $this->t->set_var('indiv',$this->db->f('indiv')); + $this->t->set_var('indiv',$this->db->f('individual')); $this->t->set_var('date',$this->db->f('date')); $this->t->set_var('notes',$this->db->f('notes')); if($this->db->f('interview_type') == 1) { $this->t->set_var('interview_type_checked','checked'); } @@ -3133,7 +3133,7 @@ class tc $this->t->set_block('att_view_t','month_list','list1'); $this->t->set_block('att_view_t','header_list','list2'); - $this->t->set_block('att_view_t','indiv_list','list3'); + $this->t->set_block('att_view_t','individual_list','list3'); $this->t->set_var('linkurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.att_view')); $num_quarters = get_var('num_quarters',array('GET','POST')); @@ -3158,11 +3158,11 @@ class tc $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $indiv_name[$i] = $this->db->f('name'); - $individual[$i] = $this->db->f('indiv'); + $individual_name[$i] = $this->db->f('name'); + $individual[$i] = $this->db->f('individual'); $i++; } - array_multisort($indiv_name, $individual); + array_multisort($individual_name, $individual); // Create a list of sunday dates for a window of 3 months back and current month $i=0; @@ -3188,7 +3188,7 @@ class tc if($found_sunday) { $i++; $found_sunday=0; } } - $total_indivs = count($individual); + $total_individuals = count($individual); $old_month=$sunday_list[0]['month']; $span=0; for ($i=0; $i < count($sunday_list); $i++) { $date = $sunday_list[$i]['date']; @@ -3213,10 +3213,10 @@ class tc } $span++; } - $this->t->set_var('total_indivs',$total_indivs); + $this->t->set_var('total_individuals',$total_individuals); $this->t->set_var('header_row',$header_row); - $indiv_width=200; $att_width=25; $total_width=$indiv_width; + $individual_width=200; $att_width=25; $total_width=$individual_width; for ($i=0; $i < count($sunday_list); $i++) { $link_data['menuaction'] = 'tc.tc.att_update'; $link_data['month'] = $sunday_list[$i]['month']; @@ -3237,14 +3237,14 @@ class tc for ($i=0; $i < count($individual); $i++) { $att_table = ""; $this->nextmatchs->template_alternate_row_color(&$this->t); - $this->t->set_var('indiv_name',$indiv_name[$i]); - #print "checking for indiv: " . $individual[$i] . "
"; + $this->t->set_var('individual_name',$individual_name[$i]); + #print "checking for individual: " . $individual[$i] . "
"; for ($j=0; $j < count($sunday_list); $j++) { #print "checking for date: " . $sunday_list[$j]['date'] . "
"; #print "SELECT * FROM tc_attendance WHERE date='" - # . $sunday_list[$j]['date'] . "' AND indiv=" . $individual[$i] . "
"; + # . $sunday_list[$j]['date'] . "' AND individual=" . $individual[$i] . "
"; $sql = "SELECT * FROM tc_attendance WHERE date='" . - $sunday_list[$j]['date'] . "' AND indiv=" . $individual[$i]; + $sunday_list[$j]['date'] . "' AND individual=" . $individual[$i]; $this->db->query($sql,__LINE__,__FILE__); if($this->db->next_record()) { $cur_month = $sunday_list[$j]['month']; @@ -3258,10 +3258,10 @@ class tc } } $this->t->set_var('att_table',$att_table); - $this->t->fp('list3','indiv_list',True); + $this->t->fp('list3','individual_list',True); } $this->t->set_var('total_width',$total_width); - $this->t->set_var('indiv_width',$indiv_width); + $this->t->set_var('individual_width',$individual_width); $this->t->set_var('att_width',$att_width); # Now calculate attendance for these months @@ -3275,17 +3275,17 @@ class tc foreach($attendance as $att => $value) { $total_attended = $attendance[$att]; $ave_total_attended += $attendance[$att]; $num_months++; - $percent = ceil(($total_attended / $total_indivs)*100); + $percent = ceil(($total_attended / $total_individuals)*100); $attendance_str.="$total_attended ($percent%)"; - $total_nonattended = $total_indivs - $total_attended; - $percent = ceil(($total_nonattended / $total_indivs)*100); + $total_nonattended = $total_individuals - $total_attended; + $percent = ceil(($total_nonattended / $total_individuals)*100); $nonattendance_str.="$total_nonattended ($percent%)"; $total_attended = ceil(($ave_total_attended / $num_months)); - $percent = ceil(($total_attended / $total_indivs)*100); + $percent = ceil(($total_attended / $total_individuals)*100); $aveattendance_str .= "$total_attended ($percent%)"; - $total_attended = $total_indivs - ceil(($ave_total_attended / $num_months)); - $percent = ceil(($total_attended / $total_indivs)*100); + $total_attended = $total_individuals - ceil(($ave_total_attended / $num_months)); + $percent = ceil(($total_attended / $total_individuals)*100); $avenonattendance_str .= "$total_attended ($percent%)"; } @@ -3309,7 +3309,7 @@ class tc $this->t->set_block('form','month_list','list1'); $this->t->set_block('form','header_list','list2'); - $this->t->set_block('form','indiv_list','list3'); + $this->t->set_block('form','individual_list','list3'); $this->t->set_var('done_action',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.att_view')); @@ -3320,7 +3320,7 @@ class tc $date = get_var('date',array('GET','POST')); if($action == 'save_month' || $action == 'save_day') { - $new_data = get_var('indivs_attended',array('POST')); + $new_data = get_var('individuals_attended',array('POST')); $month = $monthnum[$month]; if($month < 10) { $month = "0" . $month; } if($action == 'save_month') { @@ -3335,7 +3335,7 @@ class tc $data_array = explode("-",$data); $indiv = $data_array[0]; $date = "$data_array[1]-$data_array[2]-$data_array[3]"; - $this->db->query("INSERT INTO tc_attendance (indiv,date) " . + $this->db->query("INSERT INTO tc_attendance (individual,date) " . "VALUES (" . $indiv . ",'". $date . "')",__LINE__,__FILE__); } @@ -3349,7 +3349,7 @@ class tc $i=0; while ($this->db->next_record()) { $indiv_name[$i] = $this->db->f('name'); - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_attending[$individual[$i]] = $this->db->f('attending'); $i++; } @@ -3417,22 +3417,22 @@ class tc for ($i=0; $i < count($individual); $i++) { $att_table = ""; $this->nextmatchs->template_alternate_row_color(&$this->t); - $this->t->set_var('indiv_name',$indiv_name[$i]); + $this->t->set_var('individual_name',$indiv_name[$i]); for ($j=0; $j < count($sunday_list); $j++) { $sql = "SELECT * FROM tc_attendance WHERE date='" . - $sunday_list[$j]['date'] . "' AND indiv=" . $individual[$i]; + $sunday_list[$j]['date'] . "' AND individual=" . $individual[$i]; $this->db->query($sql,__LINE__,__FILE__); $value = $individual[$i] . "-" . $sunday_list[$j]['date']; if($this->db->next_record()) { - $att_table .= ''; + $att_table .= ''; } else if($indiv_attending[$individual[$i]] == 1) { - $att_table .= ''; + $att_table .= ''; } else { - $att_table .= ''; + $att_table .= ''; } } $this->t->set_var('att_table',$att_table); - $this->t->fp('list3','indiv_list',True); + $this->t->fp('list3','individual_list',True); } $this->t->set_var('lang_done', 'Cancel'); @@ -3454,7 +3454,7 @@ class tc $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $parent[$i]['id'] = $this->db->f('indiv'); + $parent[$i]['id'] = $this->db->f('individual'); $parent[$i]['name'] = $this->db->f('name'); $parent[$i]['phone'] = $this->db->f('phone'); $parent[$i]['address'] = $this->db->f('address'); @@ -3570,15 +3570,15 @@ class tc $header_row.= "Location"; $table_data = ""; - $sql = "SELECT * FROM tc_presidency where valid=1 GROUP BY indiv ORDER BY name ASC"; + $sql = "SELECT * FROM tc_presidency where valid=1 GROUP BY individual ORDER BY name ASC"; $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { $presidency_data[$i]['id'] = $this->db->f('presidency'); $presidency_data[$i]['name'] = $this->db->f('name'); - $presidency_data[$i]['indiv'] = $this->db->f('indiv'); + $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]['indiv']; + $presidency2indiv[$presidency_data[$i]['id']] = $presidency_data[$i]['individual']; $i++; } @@ -3609,7 +3609,7 @@ class tc $hour = $entry['hour']; $minute = $entry['minute']; $pm = $entry['pm']; - $indiv = $entry['indiv']; + $indiv = $entry['individual']; $family = $entry['family']; $location = $entry['location']; if($pm) { $hour = $hour + 12; } @@ -3626,7 +3626,7 @@ class tc } else if($indiv > 0) { $supervisor_name_array = explode(",",$presidency2name[$presidency]); $supervisor_last_name = $supervisor_name_array[0]; - $sql = "SELECT * FROM tc_individual where indiv='$presidency2indiv[$presidency]'"; + $sql = "SELECT * FROM tc_individual where individual='$presidency2indiv[$presidency]'"; $this->db2->query($sql,__LINE__,__FILE__); if($this->db2->next_record()) { $mls_indiv_id = $this->db2->f('mls_indiv_id'); @@ -3656,7 +3656,7 @@ class tc $sql = "SELECT * FROM tc_appointment where " . "appointment='$appointment'" . " and presidency='$presidency'" . - " and indiv='$indiv'" . + " and individual='$indiv'" . " and family='$family'" . " and date='$date'" . " and time='$time'" . @@ -3667,7 +3667,7 @@ class tc $old_time = $this->db->f('time'); $this->db2->query("UPDATE tc_appointment set" . " family=" . $family . - " ,indiv=" . $indiv . + " ,individual=" . $indiv . " ,date='" . $date . "'" . " ,time='" . $time . "'" . " ,location='" . $location . "'" . @@ -3682,15 +3682,15 @@ class tc // Add a new appointment else if(($appointment >= $this->max_appointments) && ($date != "") && ($time != "")) { - //print "adding entry: appt=$appointment date: $date time: $time indiv: $indiv family: $family
"; - $this->db2->query("INSERT INTO tc_appointment (appointment,presidency,family,indiv,date,time,location,uid) " . + //print "adding entry: appt=$appointment date: $date time: $time individual: $indiv family: $family
"; + $this->db2->query("INSERT INTO tc_appointment (appointment,presidency,family,individual,date,time,location,uid) " . "VALUES (NULL,'" . $presidency . "','" . $family . "','" . $indiv . "','" . $date . "','" . $time . "','" . $location . "','" . $uid ."')",__LINE__,__FILE__); // Now reselect this entry from the database to see if we need // to send an appointment out for it. $sql = "SELECT * FROM tc_appointment where " . - "indiv='$indiv'" . + "individual='$indiv'" . " and family='$family'" . " and presidency='$presidency'" . " and date='$date'" . @@ -3713,11 +3713,11 @@ class tc } // TODO: changed this so it picks the quorum dynamically - $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY indiv ASC"; + $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY individual ASC"; $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_name[$i] = $this->db->f('name'); $indiv_phone[$individual[$i]] = $this->db->f('phone'); $i++; @@ -3726,7 +3726,7 @@ class tc for ($i=0; $i < count($presidency_data); $i++) { $presidency = $presidency_data[$i]['id']; - $interviewer = $presidency_data[$i]['indiv']; + $interviewer = $presidency_data[$i]['individual']; $name = $presidency_data[$i]['name']; $this->t->set_var('presidency_name',$name); $table_data=""; @@ -3738,7 +3738,7 @@ class tc // Prefill any existing appointment slots while ($this->db->next_record()) { $appointment = $this->db->f('appointment'); - $indiv = $this->db->f('indiv'); + $indiv = $this->db->f('individual'); $family = $this->db->f('family'); $location = $this->db->f('location'); @@ -3751,7 +3751,7 @@ class tc } else if($indiv > 0) { $supervisor_name_array = explode(",",$presidency2name[$presidency]); $supervisor_last_name = $supervisor_name_array[0]; - $sql = "SELECT * FROM tc_individual where indiv='$presidency2indiv[$presidency]'"; + $sql = "SELECT * FROM tc_individual where individual='$presidency2indiv[$presidency]'"; $this->db2->query($sql,__LINE__,__FILE__); if($this->db2->next_record()) { $mls_indiv_id = $this->db2->f('mls_indiv_id'); @@ -3890,7 +3890,7 @@ class tc function email() { $this->t->set_file(array('email_t' => 'email.tpl')); - $this->t->set_block('email_t','indiv_list','list'); + $this->t->set_block('email_t','individual_list','list'); $action = get_var('action',array('GET','POST')); @@ -3935,11 +3935,11 @@ class tc $this->t->pfp('out','admin_t'); // TODO: changed this so it picks the quorum dynamically - $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY indiv ASC"; + $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY individual ASC"; $this->db->query($sql,__LINE__,__FILE__); $i=0; while ($this->db->next_record()) { - $individual[$i] = $this->db->f('indiv'); + $individual[$i] = $this->db->f('individual'); $indiv_name[$i] = $this->db->f('name'); $indiv2name[$individual[$i]] = $indiv_name[$i]; $i++; @@ -4079,7 +4079,7 @@ class tc if($id < $this->max_presidency_members) { //print "Updating Existing Entry
"; $this->db2->query("UPDATE tc_presidency set" . - " indiv=" . $indiv . + " individual=" . $indiv . " ,district=" . $district . " ,name='" . $name . "'" . " ,email='" . $email . "'" . @@ -4089,7 +4089,7 @@ class tc " WHERE presidency=" . $id,__LINE__,__FILE__); } else { //print "Adding New Entry
"; - $this->db2->query("INSERT INTO tc_presidency (presidency,indiv,district,name," . + $this->db2->query("INSERT INTO tc_presidency (presidency,individual,district,name," . "email,president,counselor,secretary,valid) " . "VALUES (NULL,'" . $indiv . "','" . $district . "','" . $name . "','" . $email . "','" . $president . "','" . @@ -4123,7 +4123,7 @@ class tc while ($this->db->next_record()) { // Extract the data for each presidency record $id = $this->db->f('presidency'); - $indiv = $this->db->f('indiv'); + $indiv = $this->db->f('individual'); $name = $this->db->f('name'); $district = $this->db->f('district'); $name = $this->db->f('name'); @@ -4156,7 +4156,7 @@ class tc while ($this->db->next_record()) { // Extract the data for each presidency record $id = $this->db->f('presidency'); - $indiv = $this->db->f('indiv'); + $indiv = $this->db->f('individual'); $district = $this->db->f('district'); $name = $this->db->f('name'); $email = $this->db->f('email'); @@ -4298,7 +4298,7 @@ class tc $location = $this->db->f('location'); $interviewer = ""; $email = ""; - $indiv = $this->db->f('indiv'); + $indiv = $this->db->f('individual'); $indiv_name = ""; $family = $this->db->f('family'); $family_name = ""; @@ -4330,7 +4330,7 @@ class tc $from = $email; if($indiv > 0) { - $sql = "SELECT * FROM tc_individual where indiv='$indiv'"; + $sql = "SELECT * FROM tc_individual where individual='$indiv'"; $this->db2->query($sql,__LINE__,__FILE__); if($this->db2->next_record()) { $indiv_name = $this->db2->f('name'); @@ -4348,7 +4348,7 @@ class tc $phone = $this->db2->f('phone'); $individual = $this->db2->f('individual'); $appt_name = $family_name . " Family Visit"; - $sql = "SELECT * FROM tc_individual where indiv='$individual'"; + $sql = "SELECT * FROM tc_individual where individual='$individual'"; $this->db3->query($sql,__LINE__,__FILE__); if($this->db3->next_record()) { $phone = $this->db3->f('phone'); diff --git a/templates/default/act_update.tpl b/templates/default/act_update.tpl index 4550f00..f35c108 100644 --- a/templates/default/act_update.tpl +++ b/templates/default/act_update.tpl @@ -25,9 +25,9 @@ - -
Individuals Attending
{indiv_name}{table_sep} - + + {individual_name}{table_sep} +
diff --git a/templates/default/act_view.tpl b/templates/default/act_view.tpl index 522a70c..f99e37e 100644 --- a/templates/default/act_view.tpl +++ b/templates/default/act_view.tpl @@ -29,7 +29,7 @@ Individuals Attending - {indiv_name}{table_sep} + {individual_name}{table_sep} diff --git a/templates/default/att_update.tpl b/templates/default/att_update.tpl index 62219b5..2abc926 100644 --- a/templates/default/att_update.tpl +++ b/templates/default/att_update.tpl @@ -21,15 +21,15 @@ - Individual + Individual {day} - - {indiv_name}{att_table} - + + {individual_name}{att_table} + diff --git a/templates/default/att_view.tpl b/templates/default/att_view.tpl index f7a4ea9..18b39a9 100644 --- a/templates/default/att_view.tpl +++ b/templates/default/att_view.tpl @@ -30,21 +30,21 @@ - Individual + Individual {day} - - {indiv_name}{att_table} - + + {individual_name}{att_table} +
- {header_row} + {header_row} {attendance} diff --git a/templates/default/int_sched.tpl b/templates/default/int_sched.tpl index 2fc2415..1ddbae2 100644 --- a/templates/default/int_sched.tpl +++ b/templates/default/int_sched.tpl @@ -12,7 +12,7 @@

- +
{total_indivs} Total Individuals
{total_individuals} Total Individuals
Individuals Attending:
@@ -57,7 +57,7 @@
- +
diff --git a/templates/default/int_update.tpl b/templates/default/int_update.tpl index 2f846fa..8f5b87d 100644 --- a/templates/default/int_update.tpl +++ b/templates/default/int_update.tpl @@ -3,7 +3,7 @@
- +
diff --git a/templates/default/par_view.tpl b/templates/default/par_view.tpl index ebf9a2c..e1bf9f4 100644 --- a/templates/default/par_view.tpl +++ b/templates/default/par_view.tpl @@ -10,16 +10,16 @@
- + - - {part_table} - + + {part_table} +
Individual
Individual
{assignment_name}
Participated
{indiv_name}
{individual_name}
diff --git a/templates/default/ppi_sched.tpl b/templates/default/ppi_sched.tpl index 432a1dc..2fe611f 100644 --- a/templates/default/ppi_sched.tpl +++ b/templates/default/ppi_sched.tpl @@ -12,7 +12,7 @@

- +
@@ -57,7 +57,7 @@
- +
diff --git a/templates/default/ppi_update.tpl b/templates/default/ppi_update.tpl index 70469b8..73e2ac6 100644 --- a/templates/default/ppi_update.tpl +++ b/templates/default/ppi_update.tpl @@ -3,7 +3,7 @@
- +
diff --git a/templates/default/willing_update.tpl b/templates/default/willing_update.tpl index 6970815..b3751cb 100644 --- a/templates/default/willing_update.tpl +++ b/templates/default/willing_update.tpl @@ -13,7 +13,7 @@
{header_row} diff --git a/templates/default/willing_view.tpl b/templates/default/willing_view.tpl index 2c50379..f4fc736 100644 --- a/templates/default/willing_view.tpl +++ b/templates/default/willing_view.tpl @@ -22,15 +22,15 @@
- Individual: {indiv_name} + Individual: {individual_name}
- + - - {willing_table} - + + {willing_table} + {stat_table}
Individual
Individual
{assignment_name}
{indiv_name}
{individual_name}