wrapped in double quotes so we can have single quotes in the notes themselves
authorOwen Leonard <owen@balawis.leonard.fam>
Sat, 2 Oct 2010 04:05:13 +0000 (22:05 -0600)
committerOwen Leonard <owen@balawis.leonard.fam>
Sat, 2 Oct 2010 04:05:13 +0000 (22:05 -0600)
inc/class.tc.inc.php

index 7dea31762c1808d7d497a940997f2b17f755bcc0..a1bdaf28b1a16f47670299291f073856c1d1bd7d 100644 (file)
@@ -725,7 +725,7 @@ class tc
                        $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
@@ -750,10 +750,10 @@ class tc
                        $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>";
@@ -2473,7 +2473,7 @@ class tc
                                         ", interviewer='" . $interviewer . "'" .
                                         ", individual='" . $individual . "'" .
                                         ", date='" . $date . "'" .
-                                        ", notes='" . $notes . "'" .
+                                        ", notes=\"" . $notes . "\"" .
                                         ", interview_type='" . $interview_type . "'" .
                                         " WHERE interview=" . $interview,__LINE__,__FILE__);
                        $this->ppi_view();
@@ -2484,7 +2484,7 @@ class tc
                        $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;
                }
@@ -2797,7 +2797,7 @@ class tc
                                         ", interviewer='" . $interviewer . "'" .
                                         ", individual='" . $individual . "'" .
                                         ", date='" . $date . "'" .
-                                        ", notes='" . $notes . "'" .
+                                        ", notes=\"" . $notes . "\"" .
                                         ", interview_type='" . $interview_type . "'" .
                                         " WHERE interview=" . $interview,__LINE__,__FILE__);
                        $this->int_view();
@@ -2808,7 +2808,7 @@ class tc
                        $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;
                }
@@ -3004,7 +3004,7 @@ class tc
                        $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;
@@ -3014,7 +3014,7 @@ class tc
                        $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;
                }