for ($i=0; $i < count($names); $i++) {
//$this->nextmatchs->template_alternate_row_color(&$this->t);
- $this->t->set_var('indiv_name',$names[$i]);
+ $this->t->set_var('individual_name',$names[$i]);
if(($i+1) % 3 == 0) {
$this->t->set_var('table_sep',"</td></tr><tr>");
} else {
// Re-add the individuals who are checked as having participated in this activity
$indivs = get_var('individual_name',array('POST'));
if(is_array($indivs)) { // Only do the foreach loop if we have a valid array of indivs to work with
- foreach ($indivs as $indiv) {
+ foreach ($indivs as $individual) {
$this->db->query("INSERT INTO tc_participation (individual,activity) " .
"VALUES (" . $individual . ",". $activity['activity'] . ")",__LINE__,__FILE__);
}
}
$indivs = get_var('individual_name',array('POST'));
- foreach ($indivs as $indiv)
+ foreach ($indivs as $individual)
{
$this->db->query("INSERT INTO tc_participation (individual,activity) " .
"VALUES (" . $individual . ",". $activity['activity'] . ")",__LINE__,__FILE__);
$this->t->set_var('assignment_data',$assignment_data);
// Create individual selection boxes
- $sql = "SELECT * FROM tc_individual";
+ $sql = "SELECT * FROM tc_individual WHERE steward='$this->default_stewardship'";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$this->t->set_block('par_view_t','header_list','list1');
$this->t->set_block('par_view_t','individual_list','list2');
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1";
+ $sql = "SELECT * FROM tc_individual where steward='$this->default_stewardship' and valid=1";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
}
$this->t->set_var('filter_input',$filter_input);
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1";
+ $sql = "SELECT * FROM tc_individual where steward='$this->default_stewardship' and valid=1";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
}
// create the individual id -> individual name mapping
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual where valid=1 and steward='Elder' ORDER BY name ASC";
+ $sql = "SELECT * FROM tc_individual where valid=1 and steward='$this->default_stewardship' ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
$individual = NULL;
$this->t->set_var('appt_table_width',$appt_table_width);
// PPI SCHEDULING TABLE
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual AS ti JOIN tc_scheduling_priority AS tsp WHERE ti.scheduling_priority=tsp.scheduling_priority AND steward='Elder' AND valid=1 ORDER BY tsp.priority ASC, ti.name ASC";
+ $sql = "SELECT * FROM tc_individual AS ti JOIN tc_scheduling_priority AS tsp WHERE ti.scheduling_priority=tsp.scheduling_priority AND steward='$this->default_stewardship' AND valid=1 ORDER BY tsp.priority ASC, ti.name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
//print "year: $year month: $month quarter_start: $quarter_start quarter_end: $quarter_end<br>";
// create the individual id -> individual name mapping
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY name ASC";
+ $sql = "SELECT * FROM tc_individual where steward='$this->default_stewardship' and valid=1 ORDER BY name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
$individual_data = NULL;
$year = date('Y');
// create the family id -> family name mapping
- $sql = "SELECT * FROM tc_family AS tf JOIN tc_individual AS ti WHERE tf.individual=ti.individual AND tf.valid=1 AND tf.individual != 0 AND tf.companionship != 0 ORDER BY ti.name ASC";
+ $sql = "SELECT * FROM tc_family AS tf JOIN tc_individual AS ti WHERE tf.individual=ti.individual AND tf.valid=1 AND tf.individual != 0 AND tf.companionship != 0 AND ti.steward='$this->default_stewardship' ORDER BY ti.name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
$family_id = NULL;
foreach ($new_data as $entry) {
$visit_notes = $entry['notes'];
$family = $entry['family_id'];
- $visit_pri = $entry['pri'];
-
+ $visit_pri = $entry['pri'];
// Perform database save actions here
$this->db->query("SELECT * FROM tc_family WHERE family='$family'",__LINE__,__FILE__);
if ($this->db->next_record()) {
$scheduling_priority = $this->db->f('scheduling_priority');
- //$this->logToFile("vis_sched", "UPDATE tc_scheduling_priority SET priority='$visit_pri', notes=\"$visit_notes\" WHERE scheduling_priority='$scheduling_priority'");
$this->db2->query("UPDATE tc_scheduling_priority SET priority='$visit_pri', notes=\"$visit_notes\" WHERE scheduling_priority='$scheduling_priority'", __LINE__, __FILE__);
}
}
// VISIT SCHEDULING TABLE
- $sql = "SELECT * FROM tc_family AS tf JOIN (tc_scheduling_priority AS tsp, tc_individual as ti) WHERE tf.scheduling_priority=tsp.scheduling_priority AND tf.individual=ti.individual AND tf.valid=1 AND tf.individual != 0 AND tf.companionship != 0 ORDER BY tsp.priority ASC, ti.name ASC";
+ $sql = "SELECT * FROM tc_family AS tf JOIN (tc_scheduling_priority AS tsp, tc_individual as ti) WHERE tf.scheduling_priority=tsp.scheduling_priority AND tf.individual=ti.individual AND tf.valid=1 AND tf.individual != 0 AND tf.companionship != 0 AND ti.steward='$this->default_stewardship' ORDER BY tsp.priority ASC, ti.name ASC";
$this->db->query($sql,__LINE__,__FILE__);
$total_families=0; $families_with_yearly_visit=0;
$table_data.= "<tr bgcolor=". $this->t->get_var('tr_color') ."><td title=\"$phone\"><a href=$link>$name Family</a></td>";
$table_data.= "<td align=center>$phone</td>";
$table_data.= "<td align=center>";
- $table_data.= '<select name=vis_notes['.$i.'][pri]>';
+ $table_data.= '<select name=vis_notes['.$id.'][pri]>';
foreach(range(0,6) as $num) {
if($num == 0) { $num = 1; } else {$num = $num*5; }
if($vis_pri == $num) {
}
$table_data.= '</select></td>';
$table_data.= "<td align=center>$date</td>";
- $table_data.= '<td><input type=text size="50" maxlength="128" name="vis_notes['.$i.'][notes]" value="'.$vis_notes.'">';
- $table_data.= '<input type=hidden name="vis_notes['.$i.'][family_id]" value="'.$id.'">';
- $table_data.= '<input type=hidden name="vis_notes['.$i.'][family_name]" value="'.$name.'">';
+ $table_data.= '<td><input type=text size="50" maxlength="128" name="vis_notes['.$id.'][notes]" value="'.$vis_notes.'">';
+ $table_data.= '<input type=hidden name="vis_notes['.$id.'][family_id]" value="'.$id.'">';
+ $table_data.= '<input type=hidden name="vis_notes['.$id.'][family_name]" value="'.$name.'">';
$table_data.= '</td>';
$table_data.= '</tr>';
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
$this->t->set_var('district_number','*');
$this->t->set_var('district_name',$president_name);
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual AS ti JOIN tc_scheduling_priority as tsp where ti.scheduling_priority=tsp.scheduling_priority and ti.steward='Elder' and ti.valid=1 ORDER BY ti.individual ASC";
+ $sql = "SELECT * FROM tc_individual AS ti JOIN tc_scheduling_priority as tsp where ti.scheduling_priority=tsp.scheduling_priority and ti.steward='$this->default_stewardship' and ti.valid=1 ORDER BY ti.individual ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
for ($i=0; $i < count($visit_list); $i++) {
$this->nextmatchs->template_alternate_row_color(&$this->t);
- $sql = "SELECT * FROM tc_family AS tf JOIN tc_individual AS ti WHERE tf.individual=ti.individual AND tf.family=".$visit_list[$i]['family'];
+ $sql = "SELECT * FROM tc_family AS tf JOIN tc_individual AS ti WHERE tf.individual=ti.individual AND tf.family=".$visit_list[$i]['family']." AND ti.steward='$this->default_stewardship'";
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
}
// List the families that are available to record a visit against
- $sql = "SELECT * FROM tc_family AS tf JOIN tc_individual AS ti WHERE tf.individual=ti.individual AND tf.companionship != 0 and tf.valid=1";
+ $sql = "SELECT * FROM tc_family AS tf JOIN tc_individual AS ti WHERE tf.individual=ti.individual AND tf.companionship != 0 AND tf.valid=1 AND ti.steward='$this->default_stewardship'";
$this->db->query($sql,__LINE__,__FILE__);
$total_records = $this->db->num_rows();
else if($current_month >= 7 && $current_month <= 9) { $current_month=9; }
else if($current_month >= 10 && $current_month <= 12) { $current_month=12; }
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1";
+ $sql = "SELECT * FROM tc_individual where steward='$this->default_stewardship' and valid=1";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
return false;
}
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1";
+ $sql = "SELECT * FROM tc_individual where steward='$this->default_stewardship' and valid=1";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
//Header('Location: ' . $take_me_to_url);
}
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY individual ASC";
+ $sql = "SELECT * FROM tc_individual where steward='$this->default_stewardship' and valid=1 ORDER BY individual ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {
$this->t->pfp('out','admin_t');
- // TODO: changed this so it picks the quorum dynamically
- $sql = "SELECT * FROM tc_individual where steward='Elder' and valid=1 ORDER BY individual ASC";
+ $sql = "SELECT * FROM tc_individual where steward='$this->default_stewardship' and valid=1 ORDER BY individual ASC";
$this->db->query($sql,__LINE__,__FILE__);
$i=0;
while ($this->db->next_record()) {