function getRealIP() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) return $_SERVER['HTTP_CLIENT_IP']; if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) return $_SERVER['HTTP_X_FORWARDED_FOR']; return $_SERVER['REMOTE_ADDR']; } function save_log($module,$event,$notes) { if ($event) { global $conexion; $ip=getRealIP(); $platform='admin'; $user_id=$_SESSION['superadmin_login']; //$user_id=$_SESSION['user_id']; $url= $_SERVER["REQUEST_URI"]; $insertarSQL = sprintf("INSERT INTO eventslog (user_id,platform,module,event,notes,url,ip) VALUES ('$user_id','$platform','$module','$event','$notes','$url','$ip')"); $Result = mysqli_query($conexion, $insertarSQL) or die(mysqli_error($conexion)); } return; }; ?>