}
// Save any changes made to the int notes table
- $new_data = get_var('int_notes',array('POST'));
+ $new_data = get_var('hti_notes',array('POST'));
foreach ($new_data as $entry) {
- $int_notes = $entry['notes'];
+ $hti_notes = $entry['notes'];
$indiv_id = $entry['indiv_id'];
$indiv_name = $entry['indiv_name'];
- $int_pri = $entry['pri'];
- //print "int_notes: $int_notes indiv_name: $indiv_name <Br>";
+ $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 " .
- " int_notes='" . $int_notes . "'" .
- ",int_pri='" . $int_pri . "'" .
+ " hti_notes='" . $hti_notes . "'" .
+ ",hti_pri='" . $hti_pri . "'" .
" WHERE indiv=" . $indiv_id,__LINE__,__FILE__);
}
$indiv_id = $this->db2->f('indiv');
$indiv_name = $this->db2->f('name');
$indiv_phone[$indiv_id] = $this->db2->f('phone');
- $indiv_int_pri[$indiv_id] = $this->db2->f('int_pri');
- $indiv_int_notes[$indiv_id] = $this->db2->f('int_notes');
+ $indiv_hti_pri[$indiv_id] = $this->db2->f('hti_pri');
+ $indiv_hti_notes[$indiv_id] = $this->db2->f('hti_notes');
}
$id = $indiv_id;
$name = $indiv_name;
$phone = $indiv_phone[$id];
- $int_pri = $indiv_int_pri[$id];
- $int_notes = $indiv_int_notes[$id];
+ $hti_pri = $indiv_hti_pri[$id];
+ $hti_notes = $indiv_hti_notes[$id];
// If the companionship has already had its quarterly interview,
// Skip the other companion in the companionship.
$completed_data.= "<tr bgcolor=". $this->t->get_var('tr_color2') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
$completed_data.= "<td align=center>$phone</td>";
$completed_data.= "<td align=center><a href=".$link.">$date</a></td>";
- $completed_data.= "<td align=left>$int_notes</td>";
+ $completed_data.= "<td align=left>$hti_notes</td>";
$completed_data.= '</tr>';
$tr_color2 = $this->nextmatchs->alternate_row_color($tr_color2);
$this->t->set_var('tr_color2',$tr_color2);
$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>";
$table_data.= "<td align=center>";
- $table_data.= '<select name=int_notes['.$i.'][pri]>';
+ $table_data.= '<select name=hti_notes['.$i.'][pri]>';
foreach(range(0,6) as $num) {
if($num == 0) { $num = 1; } else {$num = $num*5; }
- if($int_pri == $num) {
+ if($hti_pri == $num) {
$selected[$num] = 'selected="selected"';
} else {
$selected[$num] = '';
}
$table_data.= '</select></td>';
$table_data.= "<td align=center>$date</td>";
- $table_data.= '<td><input type=text size="50" maxlength="128" name="int_notes['.$i.'][notes]" value="'.$int_notes.'">';
- $table_data.= '<input type=hidden name="int_notes['.$i.'][indiv_id]" value="'.$id.'">';
- $table_data.= '<input type=hidden name="int_notes['.$i.'][indiv_name]" value="'.$name.'">';
+ $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.'][indiv_name]" value="'.$name.'">';
$table_data.= '</td>';
$table_data.= '</tr>'."\n";
$i++;
$comps_with_quarterly_int++;
$int_completed=1;
$date = $this->db2->f('date');
- $int_notes = $this->db2->f('notes');
- if(strlen($int_notes) > 40) { $int_notes = substr($int_notes,0,40) . "..."; }
+ $hti_notes = $this->db2->f('notes');
+ if(strlen($hti_notes) > 40) { $hti_notes = substr($hti_notes,0,40) . "..."; }
$completed_data.= "<tr bgcolor=". $this->t->get_var('tr_color2') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
$completed_data.= "<td align=center>$phone</td>";
$completed_data.= "<td align=center><a href=".$link.">$date</a></td>";
- $completed_data.= "<td align=left>$int_notes</td>";
+ $completed_data.= "<td align=left>$hti_notes</td>";
$completed_data.= '</tr>';
}
}
$appt_table_data = "";
// Find out what the EQ Presidency ID is
- $sql = "SELECT * FROM tc_presidency where eqpres=1 and valid=1";
+ $sql = "SELECT * FROM tc_presidency where president=1 and valid=1";
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
$presidency_name = $this->db->f('name');
}
// List the families that are available to record a visit against
- $sql = "SELECT * FROM tc_family WHERE valid=1";
+ $sql = "SELECT * FROM tc_family WHERE companionship != 0 and valid=1";
$this->db->query($sql,__LINE__,__FILE__);
$total_records = $this->db->num_rows();
$header_row.= "<th width=$location_width><font size=-2>Location</th>";
$table_data = "";
- $sql = "SELECT * FROM tc_presidency where valid=1";
+ $sql = "SELECT * FROM tc_presidency where valid=1 GROUP BY indiv ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$president = $entry['president'];
$counselor = $entry['counselor'];
$secretary = $entry['secretary'];
- $eqpresidency = $entry['eqpresidency'];
- // Set the individual id to 0 for EQ Presidency tagged entry
- if($eqpresidency == 1) { $indiv="0"; }
- // Re-look up the individual name for the ID if we aren't an EQ Presidency tagged entry
- else { $name = $indiv2name[$indiv]; }
+ // look up the individual name for the ID
+ $name = $indiv2name[$indiv];
//print "id=$id indiv=$indiv name=$name email=$email district=$district president=$president ";
- //print "counselor=$counselor secretary=$secretary eqpres=$eqpresidency<br>";
+ //print "counselor=$counselor secretary=$secretary<br>";
if(($indiv > 0) || ($name != "")) {
if($id < $this->max_presidency_members) {
" ,president='" . $president . "'" .
" ,counselor='" . $counselor . "'" .
" ,secretary='" . $secretary . "'" .
- " ,eqpres='" . $eqpresidency . "'" .
" WHERE presidency=" . $id,__LINE__,__FILE__);
} else {
//print "Adding New Entry<br>";
$this->db2->query("INSERT INTO tc_presidency (presidency,indiv,district,name," .
- "email,president,counselor,secretary,eqpres,valid) " .
+ "email,president,counselor,secretary,valid) " .
"VALUES (NULL,'" . $indiv . "','" . $district . "','" .
$name . "','" . $email . "','" . $president . "','" .
- $counselor . "','" . $secretary . "','" . $eqpres . "','1'" .
+ $counselor . "','" . $secretary . "','1'" .
")",__LINE__,__FILE__);
}
} else {
$sql = "SELECT * FROM tc_presidency where valid=1";
$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><th>Presidency</th>";
+ $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()) {
// Extract the data for each presidency record
$id = $this->db->f('presidency');
$president = $this->db->f('president');
$counselor = $this->db->f('counselor');
$secretary = $this->db->f('secretary');
- $eqpresidency = $this->db->f('eqpres');
// Create the forms needed in the table
$table_data .= "<tr bgcolor=". $this->t->get_var('tr_color') .">";
else { $table_data .= '<option value=0 selected="selected">0</option><option value=1>1</option>'; }
$table_data.='</select></td>';
- // Presidency
- $table_data.= '<td align=center><select name="eqpres['.$id.'][eqpresidency]">';
- if($eqpresidency == 1) { $table_data .= '<option value=0>0</option><option value=1 selected="selected">1</option>'; }
- else { $table_data .= '<option value=0 selected="selected">0</option><option value=1>1</option>'; }
- $table_data.='</select></td>';
-
// End of ROW
$table_data .= "</tr>\n";
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$table_data.= '<td align=center><select name="eqpres['.$id.'][secretary]">';
$table_data.= '<option value=0>0</option><option value=1>1</option>';
$table_data.='</select></td>';
- // Presidency
- $table_data.= '<td align=center><select name="eqpres['.$id.'][eqpresidency]">';
- $table_data.= '<option value=0>0</option><option value=1>1</option>';
- $table_data.='</select></td>';
// End of ROW
$table_data .= "</tr>\n";
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);