query($insert); } public function get_logs($context) { global $database; $table = $context['table']; $foreign_id = $context['id']; $user_db = $context['user_db']; $get_notes = " SELECT * FROM $table WHERE foreign_id = '$foreign_id' ORDER BY date_submitted DESC"; $results = $database->getAll($get_notes); $final_results = array(); if(count($results) > 0) { foreach($results AS $result) { $description = nl2br( stripslashes( htmlentities( $result['description'], ENT_QUOTES, 'UTF-8' ) ) ); $submitter = common_users::full_name($result['submitter']); $date = $result['date_submitted']; $id = $result['id']; $date = dates::change_date_time($date); $final_results[] = array( "description" => $description, "submitter" => $submitter, "date" => $date, "id" => $id ); } } return $final_results; } public function show_logs($context) { global $database; $table = $context['table']; $foreign_id = $context['id']; $user_db = $context['user_db']; $get_notes = " SELECT * FROM $table WHERE foreign_id = '$foreign_id' ORDER BY date_submitted DESC"; $results = $database->getAll($get_notes); $final_results = array(); if(count($results) > 0) { foreach($results AS $result) { $description = nl2br( stripslashes( htmlentities( $result['description'], ENT_QUOTES, 'UTF-8' ) ) ); $submitter = common_users::full_name($result['submitter']); $date = $result['date_submitted']; $id = $result['id']; $date = dates::change_date_time($date); echo $description." BY ".$submitter." on ".$date."

"; } } else { echo "No History Available!"; } } } ?>