######################################################################
-# 3RD_INDIV
+# TC_INDIVIDUAL
#+----------------------+------------------+------+-----+---------+----------------+
#| Field | Type | Null | Key | Default | Extra |
#+----------------------+------------------+------+-----+---------+----------------+
$sth->finish();
}
-# 3RD_CALLING
+# TC_CALLING
#+--------------+------------------+------+-----+---------+-------+
#| Field | Type | Null | Key | Default | Extra |
#+--------------+------------------+------+-----+---------+-------+
-#| indiv_id | int(16) unsigned | YES | | NULL | |
#| name | varchar(30) | YES | | NULL | |
#| organization | varchar(30) | YES | | NULL | |
#| position | varchar(30) | YES | | NULL | |
-#| sequence | int(16) unsigned | YES | | NULL | |
#| sustained | date | YES | | NULL | |
#+--------------+------------------+------+-----+---------+-------+
sub update_tc_calling_table()
foreach $index (keys %organization_data)
{
- $indiv_id = $organization_data{$index}{'Indiv ID'};
$name = $organization_data{$index}{'Indiv Name'};
$name =~ s/\'/\\'/g; #'
$organization = $organization_data{$index}{'Organization'};
$organization_by_name{$name} = $organization;
$organization_by_id{$indiv_id} = $organization;
$position = $organization_data{$index}{'Position'};
- $sequence = $organization_data{$index}{'Org Seq'};
$sustained = $organization_data{$index}{'Sustained'};
$sustained =~ /(\S+) (\d+)/; $month=$1; $year=$2;
if($name eq "") { next; }
print " Adding new Calling: $name -> $position\n";
- $sth = $dbh->prepare("insert into tc_calling values ('$indiv_id','$name','$organization','$position','$sequence','$month $year')");
+ $sth = $dbh->prepare("insert into tc_calling values ('$name','$organization','$position','$month $year')");
$sth->execute or die "-E- DB error: $DBI::errstr\n";
}
}
-# 3RD_DISTRICT
+# TC_DISTRICT
#+------------+------------------+------+-----+---------+-------+
#| Field | Type | Null | Key | Default | Extra |
#+------------+------------------+------+-----+---------+-------+
$sth->finish();
}
-# 3RD_COMPANIONSHIP
+# TC_COMPANIONSHIP
#+----------------------+------------------+------+-----+---------+-------+
#| Field | Type | Null | Key | Default | Extra |
#+----------------------+------------------+------+-----+---------+-------+
}
}
-# 3RD_FAMILY
+# TC_FAMILY
#+----------------------+------------------+------+-----+---------+-------+
#| Field | Type | Null | Key | Default | Extra |
#+----------------------+------------------+------+-----+---------+-------+
}
}
-# 3RD_VISIT
+# TC_VISIT
#+----------------+------------------+------+-----+---------+-------+
#| Field | Type | Null | Key | Default | Extra |
#+----------------+------------------+------+-----+---------+-------+
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $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');
}
# Display a list ordered by organization
- $sql = "SELECT * FROM tc_calling ORDER BY sequence ASC";
+ $sql = "SELECT * FROM tc_calling ORDER BY organization ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
- $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');
-- Table structure for table `tc_calling`
--
CREATE TABLE `tc_calling` (
- `indiv_id` int(16) unsigned default NULL,
`name` varchar(30) default NULL,
`organization` varchar(30) default NULL,
`position` varchar(30) default NULL,
- `sequence` int(16) unsigned default NULL,
`sustained` varchar(30) default NULL,
- KEY `indiv_id` (`indiv_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--