-
Notifications
You must be signed in to change notification settings - Fork 0
/
certificado.php
70 lines (68 loc) · 1.53 KB
/
certificado.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
69
70
<html>
<head>
<meta charset="UTF-8">
<script language="javascript">
function add_error(msg) {
var obj = document.getElementById('error_msg');
if (obj != null) {
var html = obj.innerHTML
if (html == null)
html = ""
html = html + '<p style="color:#d00">'+msg+'</p>'
obj.innerHTML = html
}
}
function validate_form(form)
{
var ok = true
var namevalue = form.name.value
var codevalue = form.code.value
if ((namevalue == null && codevalue == null) ||
(namevalue == "" && codevalue == ""))
{
add_error("Preencha o nome ou o código.")
ok = false
}
return ok
}
</script>
<style>
label {
display: inline-block;
min-width: 10em;
text-align: right;
}
#submit-button-div {
width: 30em;
text-align: center;
margin-top: 10px;
}
.dbentry {
display: inline-block;
width: 32%;
}
</style>
</head>
<body>
<p>Digite seu nome ou o código do certificado a ser validado.</p>
<form action="certificates/generate.php" method="POST" onsubmit="return validate_form(this)">
<label>Nome Completo</label>
<input type="text" name="name" size="50" />
<br />
<label>Código do Certificado</label>
<input type="text" name="code" size="50" />
<br />
<div id="submit-button-div">
<input id="submit-button" type="submit" value="Requisitar Certificado." />
</div>
<div id="error_msg"></div>
</form>
<hr />
<div>
<?php
if (include('certificates/db.php'))
list_table('participantes', array("nome"), "nome");
?>
</div>
</body>
</html>