$this->db->query("UPDATE tc_activity set " .
" assignment='" . $activity['assignment'] .
"', date='" . $activity['date'] . "'" .
- ", notes='" . $activity['notes'] . "'" .
+ ", notes=\"" . $activity['notes'] . "\"" .
" WHERE activity=" . $activity['activity'],__LINE__,__FILE__);
// Delete all the individuals who have particiapted in this activity
$activity['notes']= get_var('notes',array('POST'));
$this->db->query("INSERT INTO tc_activity (assignment,date,notes) " .
"VALUES ('" . $activity['assignment'] . "','" .
- $activity['date'] . "','" . $activity['notes'] . "')",__LINE__,__FILE__);
+ $activity['date'] . "',\"" . $activity['notes'] . "\")",__LINE__,__FILE__);
$sql = "SELECT * FROM tc_activity WHERE assignment='".$activity['assignment']."' " .
- " AND date='".$activity['date']."' AND notes='".$activity['notes']."'";
+ " AND date='".$activity['date']."' AND notes=\"".$activity['notes']."\"";
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) {
//print "activity: " . $this->db->f('activity') . "<br>";
// If this individual has had a yearly PPI this year, don't show him on the schedule list
$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' ".
- "AND individual=" . $id . " AND interview_type='ppi'";
+ "AND individual=" . $id . " AND interview_type='ppi' ORDER BY date DESC";
$this->db2->query($sql,__LINE__,__FILE__);
if(!$this->db2->next_record()) {
}
// If this companionship has had a hometeaching interview this quarter, don't show them on the schedule list
- $sql = "SELECT * FROM tc_interview WHERE date >= '$quarter_start' AND date < '$quarter_end' AND individual='$id'";
+ $sql = "SELECT * FROM tc_interview WHERE date >= '$quarter_start' AND date < '$quarter_end' AND individual='$id' AND interview_type='hti'";
$this->db2->query($sql,__LINE__,__FILE__);
if(!$this->db2->next_record()) {
- $sql = "SELECT * FROM tc_interview WHERE individual='$id' ORDER BY date DESC";
+ $sql = "SELECT * FROM tc_interview WHERE individual='$id' AND interview_type='hti' ORDER BY date DESC";
$this->db3->query($sql,__LINE__,__FILE__);
if($this->db3->next_record()) {
$date = $this->db3->f('date');
$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' ".
- "AND individual=" . $id . " AND interview_type='ppi'";
+ "AND individual=" . $id . " AND interview_type='ppi' ORDER BY date DESC";
$this->db2->query($sql,__LINE__,__FILE__);
if(!$total_ppis[$m]) { $total_ppis[$m] = 0; }
", interviewer='" . $interviewer . "'" .
", individual='" . $individual . "'" .
", date='" . $date . "'" .
- ", notes='" . $notes . "'" .
+ ", notes=\"" . $notes . "\"" .
", interview_type='" . $interview_type . "'" .
" WHERE interview=" . $interview,__LINE__,__FILE__);
$this->ppi_view();
$notes = get_var('notes',array('POST'));
$this->db->query("INSERT INTO tc_interview (interviewer,individual,date,notes,interview_type) " .
"VALUES ('" . $interviewer . "','" . $individual . "','" .
- $date . "','" . $notes . "','" . $interview_type ."')",__LINE__,__FILE__);
+ $date . "',\"" . $notes . "\",'" . $interview_type ."')",__LINE__,__FILE__);
$this->ppi_view();
return false;
}
}
if($action == 'edit' || $action == 'view') {
- $sql = "SELECT * FROM tc_interview WHERE interview=".$interview;
+ $sql = "SELECT * FROM tc_interview WHERE interview=" . $interview . " AND interview_type='ppi'";
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$this->t->set_var('interview',$interview);
$month_end = "$year"."-"."$month"."-"."31";
$month = "$month"."/"."$year";
$sql = "SELECT * FROM tc_interview WHERE date >= '$month_start' AND date <= '$month_end' ".
- "AND individual=" . $individual;
+ "AND individual=" . $individual . " AND interview_type='hti' ORDER BY date DESC";
$this->db2->query($sql,__LINE__,__FILE__);
$header_row .= "<th width=$int_width><font size=-2>$month</th>";
", interviewer='" . $interviewer . "'" .
", individual='" . $individual . "'" .
", date='" . $date . "'" .
- ", notes='" . $notes . "'" .
+ ", notes=\"" . $notes . "\"" .
", interview_type='" . $interview_type . "'" .
" WHERE interview=" . $interview,__LINE__,__FILE__);
$this->int_view();
$notes = get_var('notes',array('POST'));
$this->db->query("INSERT INTO tc_interview (interviewer,individual,date,notes,interview_type) " .
"VALUES ('" . $interviewer . "','" . $individual . "','" .
- $date . "','" . $notes ."','" . $interview_type . "')",__LINE__,__FILE__);
+ $date . "',\"" . $notes ."\",'" . $interview_type . "')",__LINE__,__FILE__);
$this->int_view();
return false;
}
}
if($action == 'edit' || $action == 'view') {
- $sql = "SELECT * FROM tc_interview WHERE interview=".$interview;
+ $sql = "SELECT * FROM tc_interview WHERE interview=" . $interview . " AND interview_type='hti'";
$this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$this->t->set_var('interview',$interview);
$notes = get_var('notes',array('POST'));
$this->db->query("UPDATE tc_visit set " .
" date='" . $date . "'" .
- ", notes='" . $notes . "'" .
+ ", notes=\"" . $notes . "\"" .
" WHERE visit=" . $visit,__LINE__,__FILE__);
$this->vis_view();
return false;
$notes = get_var('notes',array('POST'));
$this->db->query("INSERT INTO tc_visit (family,companionship,date,notes) " .
"VALUES ('" . $family . "','" . $companionship . "','" .
- $date . "','" . $notes . "')",__LINE__,__FILE__);
+ $date . "',\"" . $notes . "\")",__LINE__,__FILE__);
$this->vis_view();
return false;
}