AlaK4X
Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64



Your IP : 3.138.134.77


Current Path : /var/www/lhjmq-records.qc.ca/public_html/administration/includes/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/administration/includes/module_audit_func.php

<?php
// 20171013 simon
require("fix_php54.php");

/*This function takes in action and description
==> Action is a string that should usually be passed a specific action
    as explained in the technical documentation
==> Description is a text that describes what happened when this action occurs.
*/
function audit_add($mysql_link, $userid, $moduleclassid, $action, $description){
	//Get the time
	$dateresolve = date("Y-m-d H:i:s");
	//Get the module
	if(!isset($moduleclassid)){
		//Create a class id using the user module
		$moduleclassid = "{1gnt-1yx2rq1}-(es79ms8-24sz9it)";
	}
	//Add the audit
	$query = "INSERT INTO secur_audit (id_usager, fonction, description, dateresolve, moduleclassid) VALUES ($userid, '$action', '$description', '$dateresolve', '$moduleclassid')";
	mysql_query("$query", $mysql_link);
	if(mysql_error($mysql_link)){
		//Error occured
		echo "<p>An MySQL error occured:<BR>" . mysql_error($mysql_link) . "<p>$query";
		//exit
		exit("<p>Terminated process");
	}
}
?>