$this->jquery_tablesorter_url = $GLOBALS['phpgw']->link('inc/jquery/jquery.tablesorter.js');
$this->script_path = "$this->application_path"."/bin";
$this->jquery_tablesorter_url = $GLOBALS['phpgw']->link('inc/jquery/jquery.tablesorter.js');
$this->script_path = "$this->application_path"."/bin";
$this->t->set_var('ht_sandbox_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ht_sandbox'));
$this->t->set_var('ht_sandbox_link_title','Hometeaching Sandbox');
$this->t->set_var('ht_sandbox_link',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.ht_sandbox'));
$this->t->set_var('ht_sandbox_link_title','Hometeaching Sandbox');
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$districts[$i]['district'] = $this->db->f('district');
$districts[$i]['name'] = $this->db->f('name');
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$districts[$i]['district'] = $this->db->f('district');
$districts[$i]['name'] = $this->db->f('name');
for ($i=0; $i < count($districts); $i++) {
$this->t->set_var('district_number',$districts[$i]['district']);
$this->t->set_var('district_name',$districts[$i]['name']);
for ($i=0; $i < count($districts); $i++) {
$this->t->set_var('district_number',$districts[$i]['district']);
$this->t->set_var('district_name',$districts[$i]['name']);
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$district = $this->db->f('district');
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$district = $this->db->f('district');
- $supervisor = $this->db->f('supervisor');
- $sql = "INSERT INTO tc_district_sandbox (district,supervisor) VALUES (\"$district\",\"$supervisor\")";
+ $leader = $this->db->f('leader');
+ $sql = "INSERT INTO tc_district_sandbox (district,leader) VALUES (\"$district\",\"$leader\")";
$this->db2->query($sql,__LINE__,__FILE__);
}
# populate family, companion, and companionship tables
$this->db2->query($sql,__LINE__,__FILE__);
}
# populate family, companion, and companionship tables
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$companionship = $this->db->f('companionship');
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$companionship = $this->db->f('companionship');
$email_contents = "Please review the following changes to home teaching.\r\n\r\n";
// list all companionships deleted
$email_contents .= "Removed Companionships\r\n\r\n";
$email_contents = "Please review the following changes to home teaching.\r\n\r\n";
// list all companionships deleted
$email_contents .= "Removed Companionships\r\n\r\n";
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$companionship = $this->db->f('companionship');
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$companionship = $this->db->f('companionship');
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$companionship = $this->db->f('companionship');
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$companionship = $this->db->f('companionship');
- // email changes to presidency
- $sql = "SELECT DISTINCT tp.email AS email1, ti.email AS email2 FROM tc_presidency AS tp JOIN tc_individual AS ti WHERE tp.individual=ti.individual AND (tp.president=1 OR tp.counselor=1 OR tp.secretary=1) AND tp.valid=1";
+ // email changes to leader
+ $sql = "SELECT DISTINCT tp.email AS email1, ti.email AS email2 FROM tc_leader AS tl JOIN tc_individual AS ti WHERE tl.individual=ti.individual AND (tl.president=1 OR tl.counselor=1 OR tl.secretary=1) AND tl.valid=1";
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$email = "";
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$email = "";
$this->db->query($sql,__LINE__,__FILE__);
if ($this->db->next_record()) {
if ($this->db->f('email1') != "") {
$this->db->query($sql,__LINE__,__FILE__);
if ($this->db->next_record()) {
if ($this->db->f('email1') != "") {
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record()) {
for ($j=0; $j < count($unique_companionships); $j++) {
$companion_table_entry = "";
// Select all the companions in each companionship
for ($j=0; $j < count($unique_companionships); $j++) {
$companion_table_entry = "";
// Select all the companions in each companionship
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$indiv = $entry['individual'];
$appointment = $entry['appointment'];
$location = $entry['location'];
$indiv = $entry['individual'];
$appointment = $entry['appointment'];
$location = $entry['location'];
- $presidency_location = $entry['presidency_location'];
- if($location == "") { $location = $presidency_location; }
+ $leader_location = $entry['leader_location'];
+ if($location == "") { $location = $leader_location; }
if($indiv == 0) { $location = ""; }
//Only perform a database update if we have made a change to this appointment
if($indiv == 0) { $location = ""; }
//Only perform a database update if we have made a change to this appointment
- $sql = "SELECT * FROM tc_presidency AS tp JOIN tc_individual AS ti where tp.individual=ti.individual AND tp.valid=1 AND ";
- if($this->yearly_ppi_interviewer == 1) { $sql .= " (tp.president=1)"; }
- if($this->yearly_ppi_interviewer == 2) { $sql .= " (tp.president=1 OR tp.counselor=1)"; }
- if($this->yearly_ppi_interviewer == 3) { $sql .= " (tp.president=1 OR tp.counselor=1 OR tp.secretary=1)"; }
+ $sql = "SELECT * FROM tc_leader AS tl JOIN tc_individual AS ti where tl.individual=ti.individual AND tl.valid=1 AND ";
+ if($this->yearly_ppi_interviewer == 1) { $sql .= " (tl.president=1)"; }
+ if($this->yearly_ppi_interviewer == 2) { $sql .= " (tl.president=1 OR tl.counselor=1)"; }
+ if($this->yearly_ppi_interviewer == 3) { $sql .= " (tl.president=1 OR tl.counselor=1 OR tl.secretary=1)"; }
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
- $presidency_name = $this->db->f('name');
- $presidency_name_array = explode(",",$presidency_name);
- $presidency_last_name = $presidency_name_array[0];
- $presidency_id = $this->db->f('presidency');
- $presidency_address = $this->db->f('address');
- $presidency_location = "$presidency_last_name"." home ($presidency_address)";
+ $leader_name = $this->db->f('name');
+ $leader_name_array = explode(",",$leader_name);
+ $leader_last_name = $leader_name_array[0];
+ $leader_id = $this->db->f('leader');
+ $leader_address = $this->db->f('address');
+ $leader_location = "$leader_last_name"." home ($leader_address)";
$this->t->set_var('not_completed_table_title',$not_completed_table_title);
$this->t->set_var('appt_table_title',$appt_table_title);
// query the database for all the appointments
$this->t->set_var('not_completed_table_title',$not_completed_table_title);
$this->t->set_var('appt_table_title',$appt_table_title);
// query the database for all the appointments
$this->db2->query($sql,__LINE__,__FILE__);
while ($this->db2->next_record()) {
$appointment = $this->db2->f('appointment');
$indiv = $this->db2->f('individual');
$location = $this->db2->f('location');
$this->db2->query($sql,__LINE__,__FILE__);
while ($this->db2->next_record()) {
$appointment = $this->db2->f('appointment');
$indiv = $this->db2->f('individual');
$location = $this->db2->f('location');
$date = $this->db2->f('date');
$date_array = explode("-",$date);
$date = $this->db2->f('date');
$date_array = explode("-",$date);
}
$this->t->set_var('appt_table_data',$appt_table_data);
$this->t->set_var('appt_header_row',$appt_header_row);
}
$this->t->set_var('appt_table_data',$appt_table_data);
$this->t->set_var('appt_header_row',$appt_header_row);
$year_start = $year . "-" . $start_of_period . "-01";
$year_end = $year . "-" . $end_of_period . "-31";
$sql = "SELECT * FROM tc_interview WHERE date >= '$year_start' AND date <= '$year_end' ".
$year_start = $year . "-" . $start_of_period . "-01";
$year_end = $year . "-" . $end_of_period . "-31";
$sql = "SELECT * FROM tc_interview WHERE date >= '$year_start' AND date <= '$year_end' ".
$this->db2->query($sql,__LINE__,__FILE__);
if(!$this->db2->next_record()) {
$this->db2->query($sql,__LINE__,__FILE__);
if(!$this->db2->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$date = $this->db->f('date');
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$date = $this->db->f('date');
$link_data['individual'] = $id;
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['individual'] = $id;
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['action'] = 'add';
$link_data['interviewer'] = $interviewer;
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$link_data['action'] = 'add';
$link_data['interviewer'] = $interviewer;
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$link_data['individual'] = $this->db2->f('individual');
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['individual'] = $this->db2->f('individual');
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['action'] = 'view';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$indivs_with_yearly_ppi++;
$link_data['action'] = 'view';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$indivs_with_yearly_ppi++;
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$tmp_individual = $this->db->f('individual');
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$tmp_individual = $this->db->f('individual');
- $supervisor = $entry['supervisor'];
- $supervisor_array = explode(",", $individ2name[$supervisor]);
- $supervisor_last_name = $supervisor_array[0];
- $sql = "SELECT * FROM tc_individual where individual='$supervisor'";
+ $leader = $entry['leader'];
+ $leader_array = explode(",", $individ2name[$leader]);
+ $leader_last_name = $leader_array[0];
+ $sql = "SELECT * FROM tc_individual where individual='$leader'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$district = $this->db->f('district');
$districts[$i]['district'] = $this->db->f('district');
$districts[$i]['name'] = $this->db->f('name');
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$district = $this->db->f('district');
$districts[$i]['district'] = $this->db->f('district');
$districts[$i]['name'] = $this->db->f('name');
- $districts[$i]['supervisor'] = $this->db->f('supervisor');
- $districts[$i]['presidency'] = $this->db->f('presidency');
+ $districts[$i]['leader'] = $this->db->f('leader');
+ $districts[$i]['leader'] = $this->db->f('leader');
$table_data=""; $appt_table_data="";
$this->t->set_var('district_number',$districts[$d]['district']);
$this->t->set_var('district_name',$districts[$d]['name']);
$table_data=""; $appt_table_data="";
$this->t->set_var('district_number',$districts[$d]['district']);
$this->t->set_var('district_name',$districts[$d]['name']);
- $supervisor = $districts[$d]['supervisor'];
- $supervisor_array = explode(",", $supervisor);
- $supervisor_last_name = $supervisor_array[0];
- $sql = "SELECT * FROM tc_individual where individual='$supervisor'";
+ $leader = $districts[$d]['leader'];
+ $leader_array = explode(",", $leader);
+ $leader_last_name = $leader_array[0];
+ $sql = "SELECT * FROM tc_individual where individual='$leader'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$table_title = "District ".$districts[$d]['district'].": ".$districts[$d]['name'].": All Individuals with Interviews Not Completed";
$appt_table_title = "District ".$districts[$d]['district'].": ".$districts[$d]['name'].": Interview Appointment Slots";
$this->t->set_var('table_title',$table_title);
$this->t->set_var('appt_table_title',$appt_table_title);
// query the database for all the appointments
$table_title = "District ".$districts[$d]['district'].": ".$districts[$d]['name'].": All Individuals with Interviews Not Completed";
$appt_table_title = "District ".$districts[$d]['district'].": ".$districts[$d]['name'].": Interview Appointment Slots";
$this->t->set_var('table_title',$table_title);
$this->t->set_var('appt_table_title',$appt_table_title);
// query the database for all the appointments
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$appointment = $this->db->f('appointment');
$indiv = $this->db->f('individual');
$location = $this->db->f('location');
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$appointment = $this->db->f('appointment');
$indiv = $this->db->f('individual');
$location = $this->db->f('location');
$date = $this->db->f('date');
$date_array = explode("-",$date);
$date = $this->db->f('date');
$date_array = explode("-",$date);
$appt_table_data.= 'name="appt_notes['.$appointment.'][location]" value="'.$location.'">';
$appt_table_data.= '<input type=hidden name="appt_notes['.$appointment.'][appointment]" value="'.$appointment.'">';
$appt_table_data.= 'name="appt_notes['.$appointment.'][location]" value="'.$location.'">';
$appt_table_data.= '<input type=hidden name="appt_notes['.$appointment.'][appointment]" value="'.$appointment.'">';
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$this->t->set_var('tr_color',$tr_color);
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$this->t->set_var('tr_color',$tr_color);
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record())
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record())
$this->db2->query($sql,__LINE__,__FILE__);
if(!$this->db2->next_record()) {
$this->db2->query($sql,__LINE__,__FILE__);
if(!$this->db2->next_record()) {
$this->db3->query($sql,__LINE__,__FILE__);
if($this->db3->next_record()) {
$date = $this->db3->f('date');
$this->db3->query($sql,__LINE__,__FILE__);
if($this->db3->next_record()) {
$date = $this->db3->f('date');
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['action'] = 'add';
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['action'] = 'add';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$table_data.= "<tr bgcolor=". $this->t->get_var('tr_color') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
$table_data.= "<td align=center>$phone</td>";
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$table_data.= "<tr bgcolor=". $this->t->get_var('tr_color') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
$table_data.= "<td align=center>$phone</td>";
$link_data['individual'] = $this->db2->f('individual');
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['individual'] = $this->db2->f('individual');
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['action'] = 'view';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$comps_with_quarterly_int++;
$link_data['action'] = 'view';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$comps_with_quarterly_int++;
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$president_name = $this->db->f('name');
$interviewer = $this->db->f('individual');
} else {
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$president_name = $this->db->f('name');
$interviewer = $this->db->f('individual');
} else {
$link_data['individual'] = $id;
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['individual'] = $id;
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['action'] = 'add';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$this->nextmatchs->template_alternate_row_color(&$this->t);
$link_data['action'] = 'add';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$this->nextmatchs->template_alternate_row_color(&$this->t);
$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' ".
$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' ".
$this->db2->query($sql,__LINE__,__FILE__);
if(!$total_ppis[$m]) { $total_ppis[$m] = 0; }
$this->db2->query($sql,__LINE__,__FILE__);
if(!$total_ppis[$m]) { $total_ppis[$m] = 0; }
$link_data['indiv'] = $id;
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['indiv'] = $id;
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['action'] = 'view';
$date = $this->db2->f('date');
$date_array = explode("-",$date);
$link_data['action'] = 'view';
$date = $this->db2->f('date');
$date_array = explode("-",$date);
$individual = get_var('individual',array('GET','POST'));
$date = get_var('date',array('GET','POST'));
$notes = get_var('notes',array('GET','POST'));
$individual = get_var('individual',array('GET','POST'));
$date = get_var('date',array('GET','POST'));
$notes = get_var('notes',array('GET','POST'));
- $sql = "SELECT * FROM tc_presidency AS tp JOIN tc_individual AS ti WHERE tp.individual=ti.individual AND tp.valid=1 AND ";
- if($this->yearly_ppi_interviewer == 1) { $sql .= " (tp.president=1)"; }
- if($this->yearly_ppi_interviewer == 2) { $sql .= " (tp.president=1 OR tp.counselor=1)"; }
- if($this->yearly_ppi_interviewer == 3) { $sql .= " (tp.president=1 OR tp.counselor=1 OR tp.secretary=1)"; }
+ $sql = "SELECT * FROM tc_leader AS tl JOIN tc_individual AS ti WHERE tl.individual=ti.individual AND tl.valid=1 AND ";
+ if($this->yearly_ppi_interviewer == 1) { $sql .= " (tl.president=1)"; }
+ if($this->yearly_ppi_interviewer == 2) { $sql .= " (tl.president=1 OR tl.counselor=1)"; }
+ if($this->yearly_ppi_interviewer == 3) { $sql .= " (tl.president=1 OR tl.counselor=1 OR tl.secretary=1)"; }
$this->db2->query($sql,__LINE__,__FILE__);
while ($this->db2->next_record()) {
$indiv = $this->db2->f('individual');
$this->db2->query($sql,__LINE__,__FILE__);
while ($this->db2->next_record()) {
$indiv = $this->db2->f('individual');
", individual='" . $individual . "'" .
", date='" . $date . "'" .
", notes=\"" . $notes . "\"" .
", individual='" . $individual . "'" .
", date='" . $date . "'" .
", notes=\"" . $notes . "\"" .
if($action == 'insert') {
$notes = get_var('notes',array('POST'));
if($action == 'insert') {
$notes = get_var('notes',array('POST'));
- $this->db->query("INSERT INTO tc_interview (interviewer,individual,date,notes,interview_type) " .
+ $this->db->query("INSERT INTO tc_interview (interviewer,individual,date,notes,type) " .
- $date . "',\"" . $notes . "\",'" . $interview_type ."')",__LINE__,__FILE__);
+ $date . "',\"" . $notes . "\",'" . $type ."')",__LINE__,__FILE__);
$this->t->set_var('individual',$individual);
$this->t->set_var('date','');
$this->t->set_var('notes','');
$this->t->set_var('individual',$individual);
$this->t->set_var('date','');
$this->t->set_var('notes','');
$this->t->set_var('eqpresppi_checked','checked');
$this->t->set_var('lang_done','Cancel');
$this->t->set_var('lang_action','Adding New PPI');
$this->t->set_var('eqpresppi_checked','checked');
$this->t->set_var('lang_done','Cancel');
$this->t->set_var('lang_action','Adding New PPI');
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$this->t->set_var('interview',$interview);
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$this->t->set_var('interview',$interview);
$this->t->set_var('individual',$this->db->f('individual'));
$this->t->set_var('date',$this->db->f('date'));
$this->t->set_var('notes',$this->db->f('notes'));
$this->t->set_var('individual',$this->db->f('individual'));
$this->t->set_var('date',$this->db->f('date'));
$this->t->set_var('notes',$this->db->f('notes'));
- $this->t->set_var('interview_type',$this->db->f('interview_type'));
- if($this->db->f('interview_type') == 'ppi') { $this->t->set_var('eqpresppi_checked','checked'); }
+ $this->t->set_var('type',$this->db->f('type'));
+ if($this->db->f('type') == 'P') { $this->t->set_var('eqpresppi_checked','checked'); }
else if($current_month >= 7 && $current_month <= 9) { $current_month=9; }
else if($current_month >= 10 && $current_month <= 12) { $current_month=12; }
else if($current_month >= 7 && $current_month <= 9) { $current_month=9; }
else if($current_month >= 10 && $current_month <= 12) { $current_month=12; }
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$districts[$i]['district'] = $this->db->f('district');
$districts[$i]['name'] = $this->db->f('name');
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$districts[$i]['district'] = $this->db->f('district');
$districts[$i]['name'] = $this->db->f('name');
for ($i=0; $i < count($districts); $i++) {
$this->t->set_var('district_number',$districts[$i]['district']);
$this->t->set_var('district_name',$districts[$i]['name']);
for ($i=0; $i < count($districts); $i++) {
$this->t->set_var('district_number',$districts[$i]['district']);
$this->t->set_var('district_name',$districts[$i]['name']);
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
$j=0; $unique_companionships = '';
while ($this->db->next_record()) {
$phone = $indiv_phone[$individual];
$link_data['menuaction'] = 'tc.tc.int_update';
$link_data['companionship'] = $companionship;
$phone = $indiv_phone[$individual];
$link_data['menuaction'] = 'tc.tc.int_update';
$link_data['companionship'] = $companionship;
$link_data['individual'] = $individual;
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['individual'] = $individual;
$link_data['name'] = $name;
$link_data['interview'] = '';
$link_data['action'] = 'add';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$table_data.= "<tr bgcolor=". $this->t->get_var('tr_color') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
$link_data['action'] = 'add';
$link = $GLOBALS['phpgw']->link('/tc/index.php',$link_data);
$table_data.= "<tr bgcolor=". $this->t->get_var('tr_color') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
$month_end = "$year"."-"."$month"."-"."31";
$month = "$month"."/"."$year";
$sql = "SELECT * FROM tc_interview WHERE date >= '$month_start' AND date <= '$month_end' ".
$month_end = "$year"."-"."$month"."-"."31";
$month = "$month"."/"."$year";
$sql = "SELECT * FROM tc_interview WHERE date >= '$month_start' AND date <= '$month_end' ".
$this->db2->query($sql,__LINE__,__FILE__);
$header_row .= "<th width=$int_width><font size=-2>$month</th>";
$this->db2->query($sql,__LINE__,__FILE__);
$header_row .= "<th width=$int_width><font size=-2>$month</th>";
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['action'] = 'view';
$link_data['name'] = $name;
$link_data['interview'] = $this->db2->f('interview');
$link_data['action'] = 'view';
$date = $this->db2->f('date');
$date_array = explode("-",$date);
$month = $date_array[1];
$date = $this->db2->f('date');
$date_array = explode("-",$date);
$month = $date_array[1];
$individual = get_var('individual',array('GET','POST'));
$date = get_var('date',array('GET','POST'));
$notes = get_var('notes',array('GET','POST'));
$individual = get_var('individual',array('GET','POST'));
$date = get_var('date',array('GET','POST'));
$notes = get_var('notes',array('GET','POST'));
$this->db2->query($sql,__LINE__,__FILE__);
while ($this->db2->next_record()) {
$indiv = $this->db2->f('individual');
$this->db2->query($sql,__LINE__,__FILE__);
while ($this->db2->next_record()) {
$indiv = $this->db2->f('individual');
", individual='" . $individual . "'" .
", date='" . $date . "'" .
", notes=\"" . $notes . "\"" .
", individual='" . $individual . "'" .
", date='" . $date . "'" .
", notes=\"" . $notes . "\"" .
if($action == 'insert') {
$notes = get_var('notes',array('POST'));
if($action == 'insert') {
$notes = get_var('notes',array('POST'));
- $this->db->query("INSERT INTO tc_interview (interviewer,individual,date,notes,interview_type) " .
+ $this->db->query("INSERT INTO tc_interview (interviewer,individual,date,notes,type) " .
- $date . "',\"" . $notes ."\",'" . $interview_type . "')",__LINE__,__FILE__);
+ $date . "',\"" . $notes ."\",'" . $type . "')",__LINE__,__FILE__);
$this->t->set_var('individual',$individual);
$this->t->set_var('date','');
$this->t->set_var('notes','');
$this->t->set_var('individual',$individual);
$this->t->set_var('date','');
$this->t->set_var('notes','');
$this->t->set_var('lang_done','Cancel');
$this->t->set_var('lang_action','Adding New Interview');
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.int_update&interview=' .
$this->t->set_var('lang_done','Cancel');
$this->t->set_var('lang_action','Adding New Interview');
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.int_update&interview=' .
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$this->t->set_var('interview',$interview);
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$this->t->set_var('interview',$interview);
$this->t->set_var('individual',$this->db->f('individual'));
$this->t->set_var('date',$this->db->f('date'));
$this->t->set_var('notes',$this->db->f('notes'));
$this->t->set_var('individual',$this->db->f('individual'));
$this->t->set_var('date',$this->db->f('date'));
$this->t->set_var('notes',$this->db->f('notes'));
- $this->t->set_var('interview_type',$this->db->f('interview_type'));
- if($this->db->f('interview_type') == 'ppi') { $this->t->set_var('eqpresppi_checked','checked'); }
+ $this->t->set_var('type',$this->db->f('type'));
+ if($this->db->f('type') == 'P') { $this->t->set_var('eqpresppi_checked','checked'); }
$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()) {
- $presidency_data[$i]['id'] = $this->db->f('presidency');
- $presidency_data[$i]['name'] = $this->db->f('name');
- $presidency_data[$i]['indiv'] = $this->db->f('individual');
- $presidency2name[$presidency_data[$i]['id']] = $presidency_data[$i]['name'];
- $presidency2indiv[$presidency_data[$i]['id']] = $presidency_data[$i]['indiv'];
+ $leader_data[$i]['id'] = $this->db->f('leader');
+ $leader_data[$i]['name'] = $this->db->f('name');
+ $leader_data[$i]['indiv'] = $this->db->f('individual');
+ $leader2name[$leader_data[$i]['id']] = $leader_data[$i]['name'];
+ $leader2indiv[$leader_data[$i]['id']] = $leader_data[$i]['indiv'];
- foreach ($new_data as $presidency_array) {
- foreach ($presidency_array as $entry) {
- $presidency = $entry['presidency'];
+ foreach ($new_data as $leader_array) {
+ foreach ($leader_array as $entry) {
+ $leader = $entry['leader'];
$family_address = $familyid2address[$family];
$location = "$family_last_name"." home ($family_address)";
} else if($indiv > 0) {
$family_address = $familyid2address[$family];
$location = "$family_last_name"." home ($family_address)";
} else if($indiv > 0) {
- $supervisor_name_array = explode(",",$presidency2name[$presidency]);
- $supervisor_last_name = $supervisor_name_array[0];
- #print "presidency2indiv: $presidency $presidency2indiv[$presidency]<br>";
- $sql = "SELECT * FROM tc_individual where individual='$presidency2indiv[$presidency]'";
+ $leader_name_array = explode(",",$leader2name[$leader]);
+ $leader_last_name = $leader_name_array[0];
+ #print "leader2indiv: $leader $leader2indiv[$leader]<br>";
+ $sql = "SELECT * FROM tc_individual where individual='$leader2indiv[$leader]'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
//Only perform a database update if we have made a change to this appointment
$sql = "SELECT * FROM tc_appointment where " .
"appointment='$appointment'" .
//Only perform a database update if we have made a change to this appointment
$sql = "SELECT * FROM tc_appointment where " .
"appointment='$appointment'" .
" ,date='" . $date . "'" .
" ,time='" . $time . "'" .
" ,location='" . $location . "'" .
" ,date='" . $date . "'" .
" ,time='" . $time . "'" .
" ,location='" . $location . "'" .
else if(($appointment >= $this->max_appointments) && ($date != "") && ($time != ""))
{
//print "adding entry: appt=$appointment date: $date time: $time individual: $indiv family: $family<br>";
else if(($appointment >= $this->max_appointments) && ($date != "") && ($time != ""))
{
//print "adding entry: appt=$appointment date: $date time: $time individual: $indiv family: $family<br>";
- $this->db2->query("INSERT INTO tc_appointment (appointment,presidency,family,individual,date,time,location,uid) " .
- "VALUES (NULL,'" . $presidency . "','" . $family . "','" . $indiv . "','" .
+ $this->db2->query("INSERT INTO tc_appointment (appointment,leader,family,individual,date,time,location,uid) " .
+ "VALUES (NULL,'" . $leader . "','" . $family . "','" . $indiv . "','" .
$date . "','" . $time . "','" . $location . "','" . $uid ."')",__LINE__,__FILE__);
// Now reselect this entry from the database to see if we need
$date . "','" . $time . "','" . $location . "','" . $uid ."')",__LINE__,__FILE__);
// Now reselect this entry from the database to see if we need
- for ($i=0; $i < count($presidency_data); $i++) {
- $presidency = $presidency_data[$i]['id'];
- $interviewer = $presidency_data[$i]['individual'];
- $name = $presidency_data[$i]['name'];
- $this->t->set_var('presidency_name',$name);
+ for ($i=0; $i < count($leader_data); $i++) {
+ $leader = $leader_data[$i]['id'];
+ $interviewer = $leader_data[$i]['individual'];
+ $name = $leader_data[$i]['name'];
+ $this->t->set_var('leader_name',$name);
$this->db->query($sql,__LINE__,__FILE__);
// Prefill any existing appointment slots
$this->db->query($sql,__LINE__,__FILE__);
// Prefill any existing appointment slots
$family_address = $familyid2address[$family];
$location = "$family_last_name"." home ($family_address)";
} else if($indiv > 0) {
$family_address = $familyid2address[$family];
$location = "$family_last_name"." home ($family_address)";
} else if($indiv > 0) {
- $supervisor_name_array = explode(",",$presidency2name[$presidency]);
- $supervisor_last_name = $supervisor_name_array[0];
- $sql = "SELECT * FROM tc_individual where individual='$presidency2indiv[$presidency]'";
+ $leader_name_array = explode(",",$leader2name[$leader]);
+ $leader_last_name = $leader_name_array[0];
+ $sql = "SELECT * FROM tc_individual where individual='$leader2indiv[$leader]'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
- $table_data.= $this->jscal->input('sched['.$presidency.']['.$appointment.'][date]',$date,'','','','','',$this->cal_options);
+ $table_data.= $this->jscal->input('sched['.$leader.']['.$appointment.'][date]',$date,'','','','','',$this->cal_options);
- $table_data .= $this->get_time_selection_form($hour, $minute, $pm, $presidency, $appointment);
+ $table_data .= $this->get_time_selection_form($hour, $minute, $pm, $leader, $appointment);
- $table_data.= '<input type=hidden name="sched['.$presidency.']['.$appointment.'][appointment]" value="'.$appointment.'">';
- $table_data.= '<input type=hidden name="sched['.$presidency.']['.$appointment.'][presidency]" value="'.$presidency.'">';
+ $table_data.= '<input type=hidden name="sched['.$leader.']['.$appointment.'][appointment]" value="'.$appointment.'">';
+ $table_data.= '<input type=hidden name="sched['.$leader.']['.$appointment.'][leader]" value="'.$leader.'">';
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$this->t->set_var('tr_color',$tr_color);
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$this->t->set_var('tr_color',$tr_color);
- $table_data.= $this->jscal->input('sched['.$presidency.']['.$appointment.'][date]','','','','','','',$this->cal_options);
+ $table_data.= $this->jscal->input('sched['.$leader.']['.$appointment.'][date]','','','','','','',$this->cal_options);
- $table_data .= $this->get_time_selection_form(0, 0, 0, $presidency, $appointment);
+ $table_data .= $this->get_time_selection_form(0, 0, 0, $leader, $appointment);
- $table_data.= '<input type=hidden name="sched['.$presidency.']['.$appointment.'][appointment]" value="'.$appointment.'">';
- $table_data.= '<input type=hidden name="sched['.$presidency.']['.$appointment.'][presidency]" value="'.$presidency.'">';
+ $table_data.= '<input type=hidden name="sched['.$leader.']['.$appointment.'][appointment]" value="'.$appointment.'">';
+ $table_data.= '<input type=hidden name="sched['.$leader.']['.$appointment.'][leader]" value="'.$leader.'">';
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$this->t->set_var('tr_color',$tr_color);
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$this->t->set_var('tr_color',$tr_color);
$this->t->set_var('table_data',$table_data);
$this->t->set_var('header_row',$header_row);
$this->t->set_var('table_width',$table_width);
$this->t->set_var('table_data',$table_data);
$this->t->set_var('header_row',$header_row);
$this->t->set_var('table_width',$table_width);
$this->t->set_block('admin_t','upload','uploadhandle');
$this->t->set_block('admin_t','admin','adminhandle');
$this->t->set_block('admin_t','cmd','cmdhandle');
$this->t->set_block('admin_t','upload','uploadhandle');
$this->t->set_block('admin_t','admin','adminhandle');
$this->t->set_block('admin_t','cmd','cmdhandle');
$this->t->set_var('upload_action',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.admin&action=upload'));
$this->t->set_var('upload_action',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.admin&action=upload'));
- $this->t->set_var('presidency_action',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.admin&action=presidency'));
+ $this->t->set_var('leader_action',$GLOBALS['phpgw']->link('/tc/index.php','menuaction=tc.tc.admin&action=leader'));
$this->t->set_var('uploadstatus',$uploadstatus);
$this->t->pfp('uploadhandle','upload',True);
}
$this->t->set_var('uploadstatus',$uploadstatus);
$this->t->pfp('uploadhandle','upload',True);
}
$new_data = get_var('eqpres',array('POST'));
foreach ($new_data as $entry) {
$id = $entry['id'];
$new_data = get_var('eqpres',array('POST'));
foreach ($new_data as $entry) {
$id = $entry['id'];
" individual=" . $indiv .
" ,district=" . $district .
" ,email='" . $email . "'" .
" ,president='" . $president . "'" .
" ,counselor='" . $counselor . "'" .
" ,secretary='" . $secretary . "'" .
" individual=" . $indiv .
" ,district=" . $district .
" ,email='" . $email . "'" .
" ,president='" . $president . "'" .
" ,counselor='" . $counselor . "'" .
" ,secretary='" . $secretary . "'" .
- $this->db2->query("INSERT INTO tc_presidency (presidency,individual,district," .
+ $this->db2->query("INSERT INTO tc_leader (leader,individual,district," .
"email,president,counselor,secretary,valid) " .
"VALUES (NULL,'" . $indiv . "','" . $district . "','" .
$email . "','" . $president . "','" .
"email,president,counselor,secretary,valid) " .
"VALUES (NULL,'" . $indiv . "','" . $district . "','" .
$email . "','" . $president . "','" .
"VALUES ('" . $district . "','" .
$indiv . "','" . $valid . "'" .
")",__LINE__,__FILE__);
"VALUES ('" . $district . "','" .
$indiv . "','" . $valid . "'" .
")",__LINE__,__FILE__);
- // Requery the tc_presidency table
- $sql = "SELECT * FROM tc_presidency AS tp JOIN tc_individual AS ti WHERE tp.individual=ti.individual AND tp.valid=1";
+ // Requery the tc_leader table
+ $sql = "SELECT * FROM tc_leader AS tl JOIN tc_individual AS ti WHERE tl.individual=ti.individual AND tl.valid=1";
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record()) {
$indiv = $this->db->f('individual');
$name = $this->db->f('name');
$district = $this->db->f('district');
$indiv = $this->db->f('individual');
$name = $this->db->f('name');
$district = $this->db->f('district');
"VALUES ('" . $district . "','" .
$indiv . "','" . $valid . "'" .
")",__LINE__,__FILE__);
"VALUES ('" . $district . "','" .
$indiv . "','" . $valid . "'" .
")",__LINE__,__FILE__);
$this->db->query($sql,__LINE__,__FILE__);
$table_data = "";
$header_row = "<th>Individual</th><th>Email</th><th>District</th><th>President</th><th>Counselor</th><th>Secretary</th>";
while ($this->db->next_record()) {
$this->db->query($sql,__LINE__,__FILE__);
$table_data = "";
$header_row = "<th>Individual</th><th>Email</th><th>District</th><th>President</th><th>Counselor</th><th>Secretary</th>";
while ($this->db->next_record()) {
$indiv = $this->db->f('individual');
$district = $this->db->f('district');
$name = $this->db->f('name');
$indiv = $this->db->f('individual');
$district = $this->db->f('district');
$name = $this->db->f('name');
// Create the forms needed in the table
$table_data .= "<tr bgcolor=". $this->t->get_var('tr_color') .">";
// Create the forms needed in the table
$table_data .= "<tr bgcolor=". $this->t->get_var('tr_color') .">";
$table_data.= '<td align=center><select name="eqpres['.$id.'][indiv]">';
$table_data.= '<option value=0></option>';
for ($j=0; $j < count($individual); $j++) {
$table_data.= '<td align=center><select name="eqpres['.$id.'][indiv]">';
$table_data.= '<option value=0></option>';
for ($j=0; $j < count($individual); $j++) {
$table_data.='</select></td>';
$table_data.='<input type=hidden name="eqpres['.$id.'][name]" value="'.$indivname.'">';
} else {
$table_data.='</select></td>';
$table_data.='<input type=hidden name="eqpres['.$id.'][name]" value="'.$indivname.'">';
} else {
- $table_data.= '<td align=left><input type=text size="20" name="eqpresname" value="Presidency"></td>';
- $table_data.= '<input type=hidden name="eqpres['.$id.'][name]" value="Presidency">';
+ $table_data.= '<td align=left><input type=text size="20" name="eqpresname" value="Leader"></td>';
+ $table_data.= '<input type=hidden name="eqpres['.$id.'][name]" value="Leader">';
$table_data .= '<input type=hidden name="eqpres['.$id.'][id]" value="'.$id.'">';
// individual
$table_data.= '<td align=center><select name="eqpres['.$id.'][indiv]">';
$table_data .= '<input type=hidden name="eqpres['.$id.'][id]" value="'.$id.'">';
// individual
$table_data.= '<td align=center><select name="eqpres['.$id.'][indiv]">';
$this->t->set_var('header_row',$header_row);
$this->t->set_var('table_data',$table_data);
$this->t->set_var('header_row',$header_row);
$this->t->set_var('table_data',$table_data);
$dtstart = gmdate("Ymd"."\T"."His"."\Z", mktime($hour,$minute,$seconds,$month,$day,$year));
$dtstartstr = date("l, F d, o g:i A", mktime($hour,$minute,$seconds,$month,$day,$year));
$dtstart = gmdate("Ymd"."\T"."His"."\Z", mktime($hour,$minute,$seconds,$month,$day,$year));
$dtstartstr = date("l, F d, o g:i A", mktime($hour,$minute,$seconds,$month,$day,$year));
- $sql = "SELECT tp.email AS email1, ti.email AS email2, ti.name AS name FROM tc_presidency AS tp JOIN tc_individual AS ti WHERE tp.individual=ti.individual AND tp.presidency='$presidency'";
+ $sql = "SELECT tl.email AS email1, ti.email AS email2, ti.name AS name FROM tc_leader AS tl JOIN tc_individual AS ti WHERE tl.individual=ti.individual AND tl.leader='$leader'";
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
if ($this->db2->f('email1') != "") {
$this->db2->query($sql,__LINE__,__FILE__);
if($this->db2->next_record()) {
if ($this->db2->f('email1') != "") {
mail($to, $subject, $message, $headers);
}
mail($to, $subject, $message, $headers);
}
- function get_time_selection_form($hour, $minute, $pm, $presidency, $appointment)
+ function get_time_selection_form($hour, $minute, $pm, $leader, $appointment)
if($blank == 1) { $form_data.= '<option value=""></option>'; }
foreach(range(1,12) as $num) {
if($hour == $num) {
if($blank == 1) { $form_data.= '<option value=""></option>'; }
foreach(range(1,12) as $num) {
if($hour == $num) {