<?php
	if ( !isset ( $_SESSION["max"]["id"] ) ) {
		echo "<script>location.href='sair';</script>";
		exit;
	}

	$data = date("Y-m-d H:i:s");
	$ip = getenv("REMOTE_ADDR");
	$cliente_id = $_SESSION["max"]["id"];
	$descricao = $param[0];
	$arquivo_id = NULL;

	$sql = "insert into acesso values (NULL, ?, ?, ?, ?, ?)";
	$consulta = $db->prepare( $sql );
	$consulta->bindParam( 1, $ip );
	$consulta->bindParam( 2, $data );
	$consulta->bindParam( 3, $cliente_id );
	$consulta->bindParam( 4, $arquivo_id );
	$consulta->bindParam( 5, $descricao );
	if (!$consulta->execute()) echo $consulta->errorInfo()[2];