<?php
/* Logs events as they occur. Assumes that a db connection is already in place
*/
class EventLogger{
	const sys_src="Internal System";
	const sys_type="System Sort";
	
	public $source;
	public $type;
	public $description;
	public $info;
	
	function __construct(){}
	
	function log($source, $type, $description, $info = ""){
		$this->source=$source;
		$this->type=$type;
		$this->description=$description;
		$this->info=$info;
		
		mysqli_query("insert into eventlog (source, type, description, info, date_occurred) values ('{$source}','{$type}','{$description}','{$info}',NOW())");
	}

}
?>