$_SERVER["REMOTE_ADDR"], 'data_reg' => date('Y-m-d H:i:s')]); if ($token == $_SESSION['SSTokenPrivacidade'] && $prv == 1 && $ajax) { $query = "UPDATE pbx_usuarios SET termo_uso_privacidade = 1, termo_uso_log = '$infoLog' WHERE id = '{$_SESSION["SSidUser"]}' AND matricula = '{$_SESSION["SSmatriculaUser"]}';"; if(pg_query($dbcon, $query)){ $_SESSION["SSTermoUsoPrivacidade"] = 1; echo 'OK'; } else { echo 'ERROR'; } exit(); } $smarty->assign("token", $_SESSION['SSTokenPrivacidade']); $smarty->display('termoUsoPrivacidade.tpl'); function downloadPrv(){ $file = __DIR__ . '/doc/lgpd/TERMO_DE_USO_E_PRIVACIDADE_APLICACAO_SIMPLES.pdf'; $fsize = filesize($file); header('Content-Description: File Transfer'); header('Content-Transfer-Encoding: binary'); header('Content-Type: ' . GetMimeContentType($file)); if ($fsize) header('Content-Length: ' . $fsize); header('Content-Disposition: attachment; filename="TERMO_DE_USO_E_PRIVACIDADE_APLICACAO_SIMPLES.pdf"'); header('Connection: close'); readfile($file); exit; }