#| Field | Type | Null | Key | Default | Extra |
#+-------------+------------------+------+-----+---------+----------------+
#| indiv | int(16) unsigned | | PRI | NULL | auto_increment |
-#| indiv_id | int(16) unsigned | | | NULL | |
+#| mls_indiv_id| int(16) unsigned | | | NULL | |
#| name | varchar(60) | YES | | NULL | |
#| phone | varchar(12) | YES | | NULL | |
#| email | varchar(120) | YES | | NULL | |
#| attending | tinyint(1) | YES | | 0 | |
#| valid | tinyint(1) | YES | | NULL | |
#+-------------+------------------+------+-----+---------+----------------+
-sub update_tc_indiv_table
+sub update_tc_individual_table
{
- print "\n-> Updating tc_indiv table\n";
+ print "\n-> Updating tc_individual table\n";
# Set all records to be invalid. Only mark them as valid if they appear on the new list.
- $sth = $dbh->prepare("update tc_indiv set valid=0");
+ $sth = $dbh->prepare("update tc_individual set valid=0");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
foreach $index (keys %membership_data)
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_indiv where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("select * from tc_individual where name=\"$indiv_name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
my @data = ();
while($sqlhashref = $sth->fetchrow_hashref) { push(@data, $sqlhashref); }
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_indiv values (NULL,'$id',\"$indiv_name\",'$address','$phone','$email','','$hhposition','$priesthood','','$default_interview_pri','','$default_interview_pri','',$attending,1)");
+ $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)");
$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_indiv set valid=1 where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set valid=1 where name=\"$indiv_name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
if($phone ne "") {
- $sth = $dbh->prepare("update tc_indiv set phone='$phone' where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set phone='$phone' where name=\"$indiv_name\"");
} else {
- $sth = $dbh->prepare("update tc_indiv set phone=NULL where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set phone=NULL where name=\"$indiv_name\"");
}
$sth->execute or die "-E- DB error: $DBI::errstr\n";
if($address ne "") {
- $sth = $dbh->prepare("update tc_indiv set address='$address' where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set address='$address' where name=\"$indiv_name\"");
} else {
- $sth = $dbh->prepare("update tc_indiv set address=NULL where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set address=NULL where name=\"$indiv_name\"");
}
$sth->execute or die "-E- DB error: $DBI::errstr\n";
- $sth = $dbh->prepare("update tc_indiv set attending='$attending' where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set attending='$attending' where name=\"$indiv_name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
- $sth = $dbh->prepare("update tc_indiv set indiv_id='$id' where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set mls_indiv_id='$id' where name=\"$indiv_name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
- $sth = $dbh->prepare("update tc_indiv set priesthood='$priesthood' where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set priesthood='$priesthood' where name=\"$indiv_name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
- $sth = $dbh->prepare("update tc_indiv set email='$email' where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set email='$email' where name=\"$indiv_name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
- $sth = $dbh->prepare("update tc_indiv set hh_position='$hhposition' where name=\"$indiv_name\"");
+ $sth = $dbh->prepare("update tc_individual set hh_position='$hhposition' where name=\"$indiv_name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
} else {
# More than one record was found. Error! This shouldn't happen.
while($sqlhashref = $sth->fetchrow_hashref) {
$supervisor_name = $sqlhashref->{name};
$district = $sqlhashref->{district};
- $sth2 = $dbh->prepare("select * from tc_indiv where name='$supervisor_name'");
+ $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};
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_indiv where name='$indiv_name'");
+ $sth2 = $dbh->prepare("select * from tc_individual where name='$indiv_name'");
$sth2->execute or die "-E- DB error: $DBI::errstr\n";
$sqlhashref2 = $sth2->fetchrow_hashref;
$indiv = $sqlhashref2->{indiv};
#| hofh_id | int(16) unsigned | YES | | NULL | |
#| name | varchar(30) | YES | | NULL | |
#| name_id | varchar(30) | YES | | NULL | |
-#| indiv_id | int(16) unsigned | YES | | NULL | |
+#| individual | int(16) unsigned | YES | | NULL | |
#| companionship | int(16) unsigned | YES | | NULL | |
#| visit_pri | int(10) unsigned | YES | | 1 | |
#| visit_notes | varchar(128) | YES | | NULL | |
print " -E- More than one record found ($rows) for family name: $family_name\n";
}
- # Now update the indiv_id field for this family
- $sth = $dbh->prepare("select * from tc_indiv WHERE name='$family_name'");
+ # Now update the individual field for this family
+ $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) {
- $indiv_id = $sqlhashref->{indiv};
- print " Updating family indiv_id: $family_name -> $indiv_id\n";
- $sth = $dbh->prepare("update tc_family set indiv_id=$indiv_id where name_id='$name_id'");
+ $individual = $sqlhashref->{indiv};
+ 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";
}
foreach $oldindex (keys %$oldhashref)
{
- $indiv_id = $oldhashref->{$oldindex}{'Indiv ID'};
+ $mls_indiv_id = $oldhashref->{$oldindex}{'Indiv ID'};
$hofh_id = $oldhashref->{$oldindex}{'HofH ID'};
$full_name = $oldhashref->{$oldindex}{'Full Name'};
$hh_position = $oldhashref->{$oldindex}{'HH Position'};
foreach $newindex (keys %$newhashref)
{
if($newhashref->{$newindex}{'Full Name'} eq $full_name &&
- $indiv_id != $newhashref->{$newindex}{'Indiv ID'})
+ $mls_indiv_id != $newhashref->{$newindex}{'Indiv ID'})
{
- print "-W- Indiv ID for $full_name changed from $indiv_id to $newhashref->{$newindex}{'Indiv ID'}\n";
+ print "-W- Indiv ID for $full_name changed from $mls_indiv_id to $newhashref->{$newindex}{'Indiv ID'}\n";
$found_problem = 1;
}
return $found_problem;
}
-sub update_family_in_tc_indiv_table
+sub update_family_in_tc_individual_table
{
- print "\n-> Updating family info in tc_indiv table\n";
+ print "\n-> Updating family info in tc_individual table\n";
foreach $index (keys %membership_data)
{
print " Updating family data for: $name\n";
- # write the family id to the individual's data in tc_indiv
- $sth = $dbh->prepare("update tc_indiv set family='$family_id' where name=\"$name\"");
+ # write the family id to the individual's data in tc_individual
+ $sth = $dbh->prepare("update tc_individual set family='$family_id' where name=\"$name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
} else {
$family_id = 0;
sub update_organization_class_data
{
- print "\n-> Updating organization class info in tc_indiv table\n";
+ print "\n-> Updating organization class info in tc_individual table\n";
foreach $index (keys %organization_class_data)
{
if ($org_class =~ m/Elder/i) {
#print " $name: Elder\n";
- $sth = $dbh->prepare("update tc_indiv set steward='Elder' where name=\"$name\"");
+ $sth = $dbh->prepare("update tc_individual set steward='Elder' where name=\"$name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
}
if ($org_class =~ m/High Priest/i) {
#print " $name: High Priest\n";
- $sth = $dbh->prepare("update tc_indiv set steward='High Priest' where name=\"$name\"");
+ $sth = $dbh->prepare("update tc_individual set steward='High Priest' where name=\"$name\"");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
}
}
# Now update the various eq DB tables
&update_tc_calling_table();
-&update_tc_indiv_table();
+&update_tc_individual_table();
&update_tc_district_table();
&update_tc_companionship_table();
&update_tc_family_table();
&update_tc_visit_table();
-&update_family_in_tc_indiv_table();
+&update_family_in_tc_individual_table();
&update_organization_class_data();
print "\n-> Import Successful! DONE...\n";
$i++;
}
- $sql = "SELECT * FROM tc_indiv where valid=1 ORDER BY indiv ASC";
+ $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY indiv ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$indiv_name[$i] = $this->db->f('name');
- $indiv_phone[$indiv_id[$i]] = $this->db->f('phone');
+ $indiv_phone[$individual[$i]] = $this->db->f('phone');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
- // Make an array mapping indiv_ids to indiv_names
- for($i=0; $i < count($indiv_id); $i++) {
- $id = $indiv_id[$i];
+ // Make an array mapping individuals to indiv_names
+ for($i=0; $i < count($individual); $i++) {
+ $id = $individual[$i];
$indivs[$id] = $indiv_name[$i];
}
// Get this companions information
if($companion_table_entry != "") { $companion_table_entry .= "<td> / </td>"; }
$companionship = $this->db->f('companionship');
- $indiv_id = $this->db->f('indiv');
- $name = $indivs[$indiv_id];
- $phone = $indiv_phone[$indiv_id];
+ $individual = $this->db->f('indiv');
+ $name = $indivs[$individual];
+ $phone = $indiv_phone[$individual];
$companion_table_entry .= "<td title=\"$phone\"><b>$name</b></td>";
}
$table_data.= "<tr bgcolor=#d3dce3><td colspan=20><table><tr>$companion_table_entry</tr></table><hr></td></tr>";
return false;
}
- $sql = "SELECT * FROM tc_indiv where valid=1 ORDER BY indiv ASC";
+ $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY indiv ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$indiv_name[$i] = $this->db->f('name');
- $indiv_phone[$indiv_id[$i]] = $this->db->f('phone');
+ $indiv_phone[$individual[$i]] = $this->db->f('phone');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
- // Make an array mapping indiv_ids to indiv_names
- for($i=0; $i < count($indiv_id); $i++) {
- $id = $indiv_id[$i];
+ // Make an array mapping individuals to indiv_names
+ for($i=0; $i < count($individual); $i++) {
+ $id = $individual[$i];
$indivs[$id] = $indiv_name[$i];
}
// Get this companions information
if($companion_table_entry != "") { $companion_table_entry .= "<td> / </td>"; }
$companionship = $this->db->f('companionship');
- $indiv_id = $this->db->f('indiv');
- $name = $indivs[$indiv_id];
- $phone = $indiv_phone[$indiv_id];
+ $individual = $this->db->f('indiv');
+ $name = $indivs[$individual];
+ $phone = $indiv_phone[$individual];
$companion_table_entry .= "<td title=\"$phone\"><b>$name</b></td>";
}
$table_data.= "<tr bgcolor=#d3dce3><td colspan=20><table><tr>$companion_table_entry</tr></table><hr></td></tr>";
}
for ($i=0; $i < count($part_list); $i++) {
- $sql = "SELECT * FROM tc_indiv WHERE indiv=" . $part_list[$i]['indiv'];
+ $sql = "SELECT * FROM tc_individual WHERE indiv=" . $part_list[$i]['indiv'];
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$names[$i] = $this->db->f('name');
$this->t->set_var('assignment_data',$assignment_data);
// Create individual selection boxes
- $sql = "SELECT * FROM tc_indiv";
+ $sql = "SELECT * FROM tc_individual";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
if($this->db->f('valid') == 1 || $action != 'add') {
$indiv_name[$i] = $this->db->f('name');
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$indiv_valid[$i] = $this->db->f('valid');
$i++;
}
}
- array_multisort($indiv_name, $indiv_id, $indiv_valid);
+ array_multisort($indiv_name, $individual, $indiv_valid);
$j=0;
- for ($i=0; $i < count($indiv_id); $i++) {
+ 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=" . $indiv_id[$i];
+ $sql = "SELECT * FROM tc_participation where activity=". $activity['activity'] . " AND indiv=" . $individual[$i];
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$this->t->set_var('checked','checked');
}
if($checked || $indiv_valid[$i] == 1) {
$this->t->set_var('indiv_name',$indiv_name[$i]);
- $this->t->set_var('indiv',$indiv_id[$i]);
+ $this->t->set_var('indiv',$individual[$i]);
if(($j+1) % 3 == 0) {
$this->t->set_var('table_sep',"</td></tr><tr>");
} else {
$this->t->set_block('par_view_t','indiv_list','list2');
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1";
+ $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');
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
$sql = "SELECT * FROM tc_activity ORDER BY date DESC";
$this->db->query($sql,__LINE__,__FILE__);
$total_width += $assignment_width;
}
- for ($i=0; $i < count($indiv_id); $i++) {
+ 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]);
if($assignment_list[$j]['assignment'] == $activity_list[$k]['assignment']) {
$sql = "SELECT * FROM tc_participation where " .
" activity=" . $activity_list[$k]['activity'] .
- " AND indiv=" . $indiv_id[$i];
+ " AND indiv=" . $individual[$i];
$this->db->query($sql,__LINE__,__FILE__);
while($this->db->next_record()) {
if($activity_list[$k]['date'] > $date) {
$this->t->set_var('filter_input',$filter_input);
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1";
+ $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');
- $indiv_id[$i] = $this->db->f('indiv');
- $indiv_phone[$indiv_id[$i]] = $this->db->f('phone');
+ $individual[$i] = $this->db->f('indiv');
+ $indiv_phone[$individual[$i]] = $this->db->f('phone');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
$sql = "SELECT * FROM tc_assignment ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$total_willing[$i] = 0;
}
- for ($i=0; $i < count($indiv_id); $i++) {
+ 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[$indiv_id[$i]]);
- $this->t->set_var('editurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.willing_update&indiv_id=' .
- $indiv_id[$i] . '&action=' . 'edit'));
+ $this->t->set_var('indiv_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=" . $indiv_id[$i];
+ " AND indiv=" . $individual[$i];
$this->db->query($sql,__LINE__,__FILE__);
while($this->db->next_record()) {
$found_willingness=1;
$date = $this->db2->f('date');
$sql = "SELECT * FROM tc_participation where " .
" activity=" . $activity .
- " AND indiv=". $indiv_id[$i];
+ " AND indiv=". $individual[$i];
$this->db3->query($sql,__LINE__,__FILE__);
if($this->db3->next_record()) {
$date_part = $date;
$this->t->set_block('willing_update_t','assignment_list','list');
$this->t->set_block('willing_update_t','save','savehandle');
- $indiv_id = get_var('indiv_id',array('GET','POST'));
- $this->t->set_var('indiv_id',$indiv_id);
+ $individual = get_var('individual',array('GET','POST'));
+ $this->t->set_var('individual',$individual);
$action = get_var('action',array('GET','POST'));
$this->t->set_var('done_action',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.willing_view'));
if($action == 'save') {
// Delete all the previous willingness entries for this individual
- $this->db->query("DELETE from tc_willingness where indiv=" . $indiv_id ,__LINE__,__FILE__);
+ $this->db->query("DELETE from tc_willingness where indiv=" . $individual ,__LINE__,__FILE__);
// Now, add the assignment willingness that is checked for this individual
$new_data = get_var('willingness',array('POST'));
$data_array = explode("/",$data);
$assignment = $data_array[0];
$willing = $data_array[1];
- //print "indiv_id: $indiv_id assignment: $assignment willing: $willing<br>";
+ //print "individual: $individual assignment: $assignment willing: $willing<br>";
$this->db->query("INSERT INTO tc_willingness (indiv,assignment,willing) " .
- "VALUES (" . $indiv_id .",". $assignment .",'". $willing . "')",__LINE__,__FILE__);
+ "VALUES (" . $individual .",". $assignment .",'". $willing . "')",__LINE__,__FILE__);
}
$this->willing_view();
return false;
$table_data="";
// Find out the individual's name
- $sql = "SELECT * FROM tc_indiv WHERE indiv=".$indiv_id." AND valid=1";
+ $sql = "SELECT * FROM tc_individual WHERE indiv=".$individual." AND valid=1";
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$indiv_name = $this->db->f('name');
$table_data.="<tr bgcolor=". $this->t->get_var('tr_color') ."><td>$assignment_name</td>";
$header_row="<th width=$comp_width><font size=-2>Assignments</th><th>Willingness</th>";
- $sql = "SELECT * FROM tc_willingness WHERE indiv=".$indiv_id." AND assignment=".$assignment;
+ $sql = "SELECT * FROM tc_willingness WHERE indiv=".$individual." AND assignment=".$assignment;
$this->db2->query($sql,__LINE__,__FILE__);
$value = $assignment;
$interviewer = $this->db->f('indiv');
$district_number = '*';
$district_name = $president_name;
- $sql = "SELECT * FROM tc_indiv where indiv='$president_id'";
+ $sql = "SELECT * FROM tc_individual where indiv='$president_id'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
- $indiv_id = $this->db2->f('indiv_id');
+ $mls_indiv_id = $this->db2->f('mls_indiv_id');
}
- $sql = "SELECT * FROM tc_indiv where indiv_id='$indiv_id'";
+ $sql = "SELECT * FROM tc_individual where mls_indiv_id='$mls_indiv_id'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$president_address = $this->db2->f('address');
$new_data = get_var('ppi_notes',array('POST'));
foreach ($new_data as $entry) {
$ppi_notes = $entry['notes'];
- $indiv_id = $entry['indiv_id'];
+ $individual = $entry['individual'];
$ppi_pri = $entry['pri'];
// Perform database save actions here
- $this->db->query("UPDATE tc_indiv set " .
+ $this->db->query("UPDATE tc_individual set " .
" ppi_notes='" . $ppi_notes . "'" .
",ppi_pri='" . $ppi_pri . "'" .
- " WHERE indiv=" . $indiv_id,__LINE__,__FILE__);
+ " WHERE indiv=" . $individual,__LINE__,__FILE__);
}
// create the individual id -> individual name mapping
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where valid=1 and steward='Elder' ORDER BY name ASC";
+ $sql = "SELECT * FROM tc_individual where valid=1 and steward='Elder' ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
- $indiv_id = NULL;
+ $individual = NULL;
$indiv_name = NULL;
while ($this->db->next_record()) {
$indiv_name[$i] = $this->db->f('name');
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
// APPOINTMENT TABLE
$date_width=250; $time_width=100; $indiv_width=200; $location_width=100;
$appt_table_data.= '<td align=center><select name=appt_notes['.$appointment.'][indiv]>';
$appt_table_data.= '<option value=0></option>';
- for ($i=0; $i < count($indiv_id); $i++) {
- $id = $indiv_id[$i];
+ for ($i=0; $i < count($individual); $i++) {
+ $id = $individual[$i];
$name = $indiv_name[$i];
- if($indiv_id[$i] == $indiv) {
+ if($individual[$i] == $indiv) {
$selected[$id] = 'selected="selected"';
} else {
$selected[$id] = '';
// PPI SCHEDULING TABLE
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where valid=1 and steward='Elder' ORDER BY ppi_pri ASC, name ASC";
+ $sql = "SELECT * FROM tc_individual where valid=1 and steward='Elder' ORDER BY ppi_pri ASC, name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
- $indiv_id = NULL;
+ $individual = NULL;
while ($this->db->next_record()) {
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$indiv_name[$i] = $this->db->f('name');
- $indiv_phone[$indiv_id[$i]] = $this->db->f('phone');
- $indiv_ppi_pri[$indiv_id[$i]] = $this->db->f('ppi_pri');
- $indiv_ppi_notes[$indiv_id[$i]] = $this->db->f('ppi_notes');
+ $indiv_phone[$individual[$i]] = $this->db->f('phone');
+ $indiv_ppi_pri[$individual[$i]] = $this->db->f('ppi_pri');
+ $indiv_ppi_notes[$individual[$i]] = $this->db->f('ppi_notes');
$i++;
$total_indivs++;
}
- $max = count($indiv_id);
+ $max = count($individual);
for($i=0; $i < $max; $i++) {
- $id = $indiv_id[$i];
+ $id = $individual[$i];
$name = $indiv_name[$i];
$phone = $indiv_phone[$id];
$ppi_pri = $indiv_ppi_pri[$id];
$table_data.= '</select></td>';
$table_data.= "<td align=center>$date</td>";
$table_data.= '<td><input type=text size="50" maxlength="128" name="ppi_notes['.$i.'][notes]" value="'.$ppi_notes.'">';
- $table_data.= '<input type=hidden name="ppi_notes['.$i.'][indiv_id]" value="'.$id.'">';
+ $table_data.= '<input type=hidden name="ppi_notes['.$i.'][individual]" value="'.$id.'">';
$table_data.= '<input type=hidden name="ppi_notes['.$i.'][indiv_name]" value="'.$name.'">';
$table_data.= '</td>';
$table_data.= '</tr>';
// create the individual id -> individual name mapping
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1 ORDER BY name ASC";
+ $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
- $indiv_id_data = NULL;
+ $individual_data = NULL;
$indiv_name_data = NULL;
while ($this->db->next_record()) {
$indiv_name_data[$i] = $this->db->f('name');
- $indiv_id_data[$i] = $this->db->f('indiv');
- $individ2name[$indiv_id_data[$i]] = $indiv_name_data[$i];
+ $individual_data[$i] = $this->db->f('indiv');
+ $individ2name[$individual_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";
+ $tmp_individual = $this->db->f('indiv');
+ $sql = "Select * FROM tc_individual where indiv='$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');
- $indiv_id_data[$i] = $this->db2->f('indiv');
- $individ2name[$indiv_id_data[$i]] = $indiv_name_data[$i];
+ $individual_data[$i] = $this->db2->f('indiv');
+ $individ2name[$individual_data[$i]] = $indiv_name_data[$i];
$i++;
}
}
- array_multisort($indiv_name_data, $indiv_id_data);
+ array_multisort($indiv_name_data, $individual_data);
if($action == 'save') {
// Save any changes made to the appointment table
$supervisor = $entry['supervisor'];
$supervisor_array = explode(",", $individ2name[$supervisor]);
$supervisor_last_name = $supervisor_array[0];
- $sql = "SELECT * FROM tc_indiv where indiv='$supervisor'";
+ $sql = "SELECT * FROM tc_individual where indiv='$supervisor'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
- $indiv_id = $this->db2->f('indiv_id');
+ $mls_indiv_id = $this->db2->f('mls_indiv_id');
}
- $sql = "SELECT * FROM tc_indiv where indiv_id='$indiv_id'";
+ $sql = "SELECT * FROM tc_individual where mls_indiv_id='$mls_indiv_id'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$supervisor_address = $this->db2->f('address');
$new_data = get_var('hti_notes',array('POST'));
foreach ($new_data as $entry) {
$hti_notes = $entry['notes'];
- $indiv_id = $entry['indiv_id'];
+ $individual = $entry['individual'];
$indiv_name = $entry['indiv_name'];
$hti_pri = $entry['pri'];
//print "hti_notes: $hti_notes indiv_name: $indiv_name <Br>";
// Perform database save actions here
- $this->db->query("UPDATE tc_indiv set " .
+ $this->db->query("UPDATE tc_individual set " .
" hti_notes='" . $hti_notes . "'" .
",hti_pri='" . $hti_pri . "'" .
- " WHERE indiv=" . $indiv_id,__LINE__,__FILE__);
+ " WHERE indiv=" . $individual,__LINE__,__FILE__);
}
$take_me_to_url = $GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.int_sched');
$supervisor = $districts[$d]['supervisor'];
$supervisor_array = explode(",", $supervisor);
$supervisor_last_name = $supervisor_array[0];
- $sql = "SELECT * FROM tc_indiv where indiv='$supervisor'";
+ $sql = "SELECT * FROM tc_individual where indiv='$supervisor'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
- $indiv_id = $this->db2->f('indiv_id');
+ $mls_indiv_id = $this->db2->f('mls_indiv_id');
}
- $sql = "SELECT * FROM tc_indiv where indiv_id='$indiv_id'";
+ $sql = "SELECT * FROM tc_individual where mls_indiv_id='$mls_indiv_id'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$supervisor_address = $this->db2->f('address');
$appt_table_data.= '<td align=center><select name=appt_notes['.$appointment.'][indiv]>';
$appt_table_data.= '<option value=0></option>';
- for ($i=0; $i < count($indiv_id_data); $i++) {
- $id = $indiv_id_data[$i];
+ for ($i=0; $i < count($individual_data); $i++) {
+ $id = $individual_data[$i];
$name = $indiv_name_data[$i];
- if($indiv_id_data[$i] == $indiv) {
+ if($individual_data[$i] == $indiv) {
$selected[$id] = 'selected="selected"';
} else {
$selected[$id] = '';
$total_comps++;
while ($this->db->next_record()) {
// Get this companions information
- $indiv_id = $this->db->f('indiv');
+ $individual = $this->db->f('indiv');
- $sql = "SELECT * FROM tc_indiv where indiv='$indiv_id'";
+ $sql = "SELECT * FROM tc_individual where indiv='$individual'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
- $indiv_id = $this->db2->f('indiv');
+ $individual = $this->db2->f('indiv');
$indiv_name = $this->db2->f('name');
- $indiv_phone[$indiv_id] = $this->db2->f('phone');
- $indiv_hti_pri[$indiv_id] = $this->db2->f('hti_pri');
- $indiv_hti_notes[$indiv_id] = $this->db2->f('hti_notes');
+ $indiv_phone[$individual] = $this->db2->f('phone');
+ $indiv_hti_pri[$individual] = $this->db2->f('hti_pri');
+ $indiv_hti_notes[$individual] = $this->db2->f('hti_notes');
}
- $id = $indiv_id;
+ $id = $individual;
$name = $indiv_name;
$phone = $indiv_phone[$id];
$hti_pri = $indiv_hti_pri[$id];
$table_data.= '</select></td>';
$table_data.= "<td align=center>$date</td>";
$table_data.= '<td><input type=text size="50" maxlength="128" name="hti_notes['.$i.'][notes]" value="'.$hti_notes.'">';
- $table_data.= '<input type=hidden name="hti_notes['.$i.'][indiv_id]" value="'.$id.'">';
+ $table_data.= '<input type=hidden name="hti_notes['.$i.'][individual]" value="'.$id.'">';
$table_data.= '<input type=hidden name="hti_notes['.$i.'][indiv_name]" value="'.$name.'">';
$table_data.= '</td>';
$table_data.= '</tr>'."\n";
$year = date('Y');
// create the family id -> family name mapping
- $sql = "SELECT * FROM tc_family where valid=1 and indiv_id != 0 and companionship != 0 ORDER BY name ASC";
+ $sql = "SELECT * FROM tc_family where valid=1 and individual != 0 and companionship != 0 ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
$family_id = NULL;
$family_id[$i] = $this->db->f('family');
$family_name[$i] = $this->db->f('name');
$familyid2name[$family_id[$i]] = $family_name[$i];
- $sql = "SELECT * FROM tc_indiv where family='$family_id[$i]'";
+ $sql = "SELECT * FROM tc_individual where family='$family_id[$i]'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$familyid2address[$family_id[$i]] = $this->db2->f('address');
// VISIT SCHEDULING TABLE
- $sql = "SELECT * FROM tc_family where valid=1 and indiv_id != 0 and companionship != 0 ORDER BY visit_pri ASC, name ASC";
+ $sql = "SELECT * FROM tc_family where valid=1 and individual != 0 and companionship != 0 ORDER BY visit_pri ASC, name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$total_families=0; $families_with_yearly_visit=0;
$total_families++;
}
- $sql = "SELECT * FROM tc_indiv where valid=1";
+ $sql = "SELECT * FROM tc_individual where valid=1";
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$family = $this->db->f('family');
$this->t->set_var('district_name',$president_name);
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1 ORDER BY indiv ASC";
+ $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY indiv ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$indiv_name[$i] = $this->db->f('name');
- $indiv_phone[$indiv_id[$i]] = $this->db->f('phone');
- $indiv_ppi_pri[$indiv_id[$i]] = $this->db->f('ppi_pri');
- $indiv_ppi_notes[$indiv_id[$i]] = $this->db->f('ppi_notes');
+ $indiv_phone[$individual[$i]] = $this->db->f('phone');
+ $indiv_ppi_pri[$individual[$i]] = $this->db->f('ppi_pri');
+ $indiv_ppi_notes[$individual[$i]] = $this->db->f('ppi_notes');
$i++;
}
$total_indivs=$i;
- array_multisort($indiv_name, $indiv_id);
- //var_dump($indiv_name); print "<br><br>"; var_dump($indiv_id);
+ array_multisort($indiv_name, $individual);
+ //var_dump($indiv_name); print "<br><br>"; var_dump($individual);
$header_row="<th width=$comp_width><font size=-2>Individual Name</th>";
$ppis[$m] = 0;
}
- for ($j=0; $j < count($indiv_id); $j++) {
- $id = $indiv_id[$j];
+ for ($j=0; $j < count($individual); $j++) {
+ $id = $individual[$j];
$name = $indiv_name[$j];
$phone = $indiv_phone[$id];
$i++;
}
- $sql = "SELECT * FROM tc_indiv where valid=1 ORDER BY indiv ASC";
+ $sql = "SELECT * FROM tc_individual where valid=1 ORDER BY indiv ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$indiv_name[$i] = $this->db->f('name');
- $indiv_phone[$indiv_id[$i]] = $this->db->f('phone');
+ $indiv_phone[$individual[$i]] = $this->db->f('phone');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
- for($i=0; $i < count($indiv_id); $i++) {
- $id = $indiv_id[$i];
+ array_multisort($indiv_name, $individual);
+ for($i=0; $i < count($individual); $i++) {
+ $id = $individual[$i];
$indivs[$id] = $indiv_name[$i];
}
// Get this companions information
$num_indivs++;
$companionship = $this->db->f('companionship');
- $indiv_id = $this->db->f('indiv');
- $name = $indivs[$indiv_id];
- $phone = $indiv_phone[$indiv_id];
+ $individual = $this->db->f('indiv');
+ $name = $indivs[$individual];
+ $phone = $indiv_phone[$individual];
$link_data['menuaction'] = 'tc.tc.int_update';
$link_data['companionship'] = $companionship;
$link_data['interviewer'] = $supervisor;
- $link_data['indiv'] = $indiv_id;
+ $link_data['indiv'] = $individual;
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['action'] = 'add';
$month_end = "$year"."-"."$month"."-"."31";
$month = "$month"."/"."$year";
$sql = "SELECT * FROM tc_interview WHERE date >= '$month_start' AND date <= '$month_end' ".
- "AND indiv=" . $indiv_id;
+ "AND indiv=" . $individual;
$this->db2->query($sql,__LINE__,__FILE__);
$header_row .= "<th width=$int_width><font size=-2>$month</th>";
$link_data['menuaction'] = 'tc.tc.int_update';
$link_data['companionship'] = $companionship;
$link_data['interviewer'] = $this->db2->f('interviewer');
- $link_data['indiv'] = $indiv_id;
+ $link_data['indiv'] = $individual;
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['action'] = 'view';
else if($current_month >= 10 && $current_month <= 12) { $current_month=12; }
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1";
+ $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');
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
// Create a list of sunday dates for a window of 3 months back and current month
$i=0;
if($found_sunday) { $i++; $found_sunday=0; }
}
- $total_indivs = count($indiv_id);
+ $total_indivs = count($individual);
$old_month=$sunday_list[0]['month']; $span=0;
for ($i=0; $i < count($sunday_list); $i++) {
$date = $sunday_list[$i]['date'];
$attendance[$monthnum[$sunday_list[$i]['month']]]=0;
}
- for ($i=0; $i < count($indiv_id); $i++) {
+ 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: " . $indiv_id[$i] . "<br>";
+ #print "checking for indiv: " . $individual[$i] . "<br>";
for ($j=0; $j < count($sunday_list); $j++) {
#print "checking for date: " . $sunday_list[$j]['date'] . "<br>";
#print "SELECT * FROM tc_attendance WHERE date='"
- # . $sunday_list[$j]['date'] . "' AND indiv=" . $indiv_id[$i] . "<br>";
+ # . $sunday_list[$j]['date'] . "' AND indiv=" . $individual[$i] . "<br>";
$sql = "SELECT * FROM tc_attendance WHERE date='" .
- $sunday_list[$j]['date'] . "' AND indiv=" . $indiv_id[$i];
+ $sunday_list[$j]['date'] . "' AND indiv=" . $individual[$i];
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$cur_month = $sunday_list[$j]['month'];
}
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1";
+ $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');
- $indiv_id[$i] = $this->db->f('indiv');
- $indiv_attending[$indiv_id[$i]] = $this->db->f('attending');
+ $individual[$i] = $this->db->f('indiv');
+ $indiv_attending[$individual[$i]] = $this->db->f('attending');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
if($action == 'update_month') {
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.att_update&action=save_month'));
$this->t->fp('list2','header_list',True);
}
- for ($i=0; $i < count($indiv_id); $i++) {
+ 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]);
for ($j=0; $j < count($sunday_list); $j++) {
$sql = "SELECT * FROM tc_attendance WHERE date='" .
- $sunday_list[$j]['date'] . "' AND indiv=" . $indiv_id[$i];
+ $sunday_list[$j]['date'] . "' AND indiv=" . $individual[$i];
$this->db->query($sql,__LINE__,__FILE__);
- $value = $indiv_id[$i] . "-" . $sunday_list[$j]['date'];
+ $value = $individual[$i] . "-" . $sunday_list[$j]['date'];
if($this->db->next_record()) {
$att_table .= '<td align=center><input type="checkbox" name="indivs_attended[]" value="'.$value.'" checked></td>';
- } else if($indiv_attending[$indiv_id[$i]] == 1) {
+ } else if($indiv_attending[$individual[$i]] == 1) {
$att_table .= '<td align=center><input type="checkbox" name="indivs_attended[]" value="'.$value.'" checked></td>';
} else {
$att_table .= '<td align=center><input type="checkbox" name="indivs_attended[]" value="'.$value.'"></td>';
$this->t->set_file(array('dir_view_t' => 'dir_view.tpl'));
$this->t->set_block('dir_view_t','dir_list','list');
- $sql = "SELECT * FROM tc_indiv where valid=1 and hh_position='Head of Household' ORDER BY name ASC";
+ $sql = "SELECT * FROM tc_individual where valid=1 and hh_position='Head of Household' ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $calling[$i]['id'] = $this->db->f('indiv_id');
+ $calling[$i]['id'] = $this->db->f('individual');
$calling[$i]['name'] = $this->db->f('name');
$calling[$i]['position'] = $this->db->f('position');
$calling[$i]['sustained'] = $this->db->f('sustained');
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $calling[$i]['id'] = $this->db->f('indiv_id');
+ $calling[$i]['id'] = $this->db->f('individual');
$calling[$i]['name'] = $this->db->f('name');
$calling[$i]['position'] = $this->db->f('position');
$calling[$i]['sustained'] = $this->db->f('sustained');
$i++;
}
- $sql = "SELECT * FROM tc_family where valid=1 and indiv_id != 0 ORDER BY name ASC";
+ $sql = "SELECT * FROM tc_family where valid=1 and individual != 0 ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$family_id[$i] = $this->db->f('family');
$family_name[$i] = $this->db->f('name');
$familyid2name[$family_id[$i]] = $family_name[$i];
- $sql = "SELECT * FROM tc_indiv where family='$family_id[$i]' and hh_position='Head of Household'";
+ $sql = "SELECT * FROM tc_individual where family='$family_id[$i]' and hh_position='Head of Household'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$familyid2address[$family_id[$i]] = $this->db2->f('address');
} else if($indiv > 0) {
$supervisor_name_array = explode(",",$presidency2name[$presidency]);
$supervisor_last_name = $supervisor_name_array[0];
- $sql = "SELECT * FROM tc_indiv where indiv='$presidency2indiv[$presidency]'";
+ $sql = "SELECT * FROM tc_individual where indiv='$presidency2indiv[$presidency]'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
- $indiv_id = $this->db2->f('indiv_id');
+ $mls_indiv_id = $this->db2->f('mls_indiv_id');
}
- $sql = "SELECT * FROM tc_indiv where indiv_id='$indiv_id'";
+ $sql = "SELECT * FROM tc_individual where mls_indiv_id='$mls_indiv_id'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$supervisor_address = $this->db2->f('address');
}
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1 ORDER BY indiv ASC";
+ $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY indiv ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$indiv_name[$i] = $this->db->f('name');
- $indiv_phone[$indiv_id[$i]] = $this->db->f('phone');
+ $indiv_phone[$individual[$i]] = $this->db->f('phone');
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
for ($i=0; $i < count($presidency_data); $i++) {
$presidency = $presidency_data[$i]['id'];
} else if($indiv > 0) {
$supervisor_name_array = explode(",",$presidency2name[$presidency]);
$supervisor_last_name = $supervisor_name_array[0];
- $sql = "SELECT * FROM tc_indiv where indiv='$presidency2indiv[$presidency]'";
+ $sql = "SELECT * FROM tc_individual where indiv='$presidency2indiv[$presidency]'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
- $indiv_id = $this->db2->f('indiv_id');
+ $mls_indiv_id = $this->db2->f('mls_indiv_id');
}
- $sql = "SELECT * FROM tc_indiv where indiv_id='$indiv_id'";
+ $sql = "SELECT * FROM tc_individual where mls_indiv_id='$mls_indiv_id'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$supervisor_address = $this->db2->f('address');
// individual drop down list (for PPIs)
$table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][indiv] STYLE="font-size : 8pt">';
$table_data.= '<option value=0></option>';
- for ($j=0; $j < count($indiv_id); $j++) {
- $id = $indiv_id[$j];
+ for ($j=0; $j < count($individual); $j++) {
+ $id = $individual[$j];
$name = $indiv_name[$j];
- if($indiv_id[$j] == $indiv) {
+ if($individual[$j] == $indiv) {
$selected[$id] = 'selected="selected"';
} else {
$selected[$id] = '';
// Family drop down list (for Visits)
$table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][family] STYLE="font-size : 8pt">';
$table_data.= '<option value=0></option>';
- for ($j=0; $j < count($indiv_id); $j++) {
+ for ($j=0; $j < count($individual); $j++) {
$id = $family_id[$j];
$name = $family_name[$j];
if($family_id[$j] == $family) {
// individual drop down list
$table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][indiv] STYLE="font-size : 8pt">';
$table_data.= '<option value=0></option>';
- for ($j=0; $j < count($indiv_id); $j++) {
- $id = $indiv_id[$j];
+ for ($j=0; $j < count($individual); $j++) {
+ $id = $individual[$j];
$name = $indiv_name[$j];
$table_data.= '<option value='.$id.'>'.$name.'</option>';
}
// Family drop down list
$table_data.= '<td align=center><select name=sched['.$presidency.']['.$appointment.'][family] STYLE="font-size : 8pt">';
$table_data.= '<option value=0></option>';
- for ($j=0; $j < count($indiv_id); $j++) {
+ for ($j=0; $j < count($individual); $j++) {
$id = $family_id[$j];
$name = $family_name[$j];
$table_data.= '<option value='.$id.'>'.$name.' Family</option>';
$this->t->pfp('out','admin_t');
// TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_indiv where steward='Elder' and valid=1 ORDER BY indiv ASC";
+ $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY indiv ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $indiv_id[$i] = $this->db->f('indiv');
+ $individual[$i] = $this->db->f('indiv');
$indiv_name[$i] = $this->db->f('name');
- $indiv2name[$indiv_id[$i]] = $indiv_name[$i];
+ $indiv2name[$individual[$i]] = $indiv_name[$i];
$i++;
}
- array_multisort($indiv_name, $indiv_id);
+ array_multisort($indiv_name, $individual);
if($action == 'upload') {
$target_path = $this->upload_target_path . '/' . basename( $_FILES['uploadedfile']['name']);
if($eqpresidency == 0) {
$table_data.= '<td align=center><select name="eqpres['.$id.'][indiv]">';
$table_data.= '<option value=0></option>';
- for ($j=0; $j < count($indiv_id); $j++) {
- $tmp_id = $indiv_id[$j];
+ for ($j=0; $j < count($individual); $j++) {
+ $tmp_id = $individual[$j];
$name = $indiv_name[$j];
- if($indiv_id[$j] == $indiv) {
+ if($individual[$j] == $indiv) {
$indivname = $name;
$selected = 'selected="selected"';
} else {
// individual
$table_data.= '<td align=center><select name="eqpres['.$id.'][indiv]">';
$table_data.= '<option value=0></option>';
- for ($j=0; $j < count($indiv_id); $j++) {
- $tmp_id = $indiv_id[$j];
+ for ($j=0; $j < count($individual); $j++) {
+ $tmp_id = $individual[$j];
$name = $indiv_name[$j];
$table_data.= '<option value='.$tmp_id.'>'.$name.'</option>';
}
$from = $email;
if($indiv > 0) {
- $sql = "SELECT * FROM tc_indiv where indiv='$indiv'";
+ $sql = "SELECT * FROM tc_individual where indiv='$indiv'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$indiv_name = $this->db2->f('name');
if($this->db2->next_record()) {
$family_name = $this->db2->f('name');
$phone = $this->db2->f('phone');
- $indiv_id = $this->db2->f('indiv_id');
+ $individual = $this->db2->f('individual');
$appt_name = $family_name . " Family Visit";
- $sql = "SELECT * FROM tc_indiv where indiv='$indiv_id'";
+ $sql = "SELECT * FROM tc_individual where indiv='$individual'";
$this->db3->query($sql,__LINE__,__FILE__);
if($this->db3->next_record()) {
$phone = $this->db3->f('phone');