-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrespostas.php
68 lines (43 loc) · 2.01 KB
/
respostas.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
</head>
<body style="padding-left: 20%;padding-right: 20%;padding-top:3%">
<?php
$arquivo = $_GET['arquivo'];
$arquivo = "$arquivo.json";
$data = $_POST;
$data = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_LINE_TERMINATORS);
file_put_contents("/tmp/".$arquivo, $data);
$hostname=$_SERVER['SERVER_NAME'];
if ($arquivo == "extra.json") {
exit("<div class='alert alert-success text-center'>
<strong>Parabéns, Você finalizou a prova!!!</strong>
</div>");
} else {
$url = "http://$_SERVER[HTTP_HOST]/perguntas/download.php?arquivo=$arquivo";
echo "
<div class='alert alert-success text-center'>
Parabéns, Você finalizou a prova!!! <br><strong>Adicione o arquivo de respostas em seu GITHUB junto com:</strong>
<br><br>
<ul class=\"list-unstyled pl-5\">
<li class='text-center'>Script para instalação</li>
<li class='text-center'>Documentação simples</li>
<li class='text-center'>Referências técnicas utilizadas</li>
<li class='text-center'>Arquivos de resposta</li>
</ul>
</div>";
echo "<a href=\"$url\" class=\"btn btn-lg btn-success btn-block\">Baixar Arquivo</a>";
}
?>
</body>
</html>