+ $date_part="";
+ $sql = "SELECT * FROM eq_activity where "
+ . " assignment=". $assignment_list[$j]['assignment']
+ . " ORDER by date DESC";
+ $this->db2->query($sql,__LINE__,__FILE__);
+ if($this->db2->next_record()) {
+ $activity = $this->db2->f('activity');
+ $date = $this->db2->f('date');
+ $sql = "SELECT * FROM eq_participation where "
+ . " activity=" . $activity
+ . " AND elder=". $elder_id[$i];
+ $this->db3->query($sql,__LINE__,__FILE__);
+ if($this->db3->next_record()) {
+ $date_part = $date;
+ }
+ }
+