-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
83 lines (69 loc) · 2.48 KB
/
index.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
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<?php
$errors = array();
if (isset($_POST['nome'])) {
if (empty($_POST['nome'])) {
array_push($errors, '<spam style="color: red">Não foi inserido nenhum nome!</spam> <br/>');
}
if (!ctype_alpha($_POST['nome'])) {
array_push($errors, '<spam style="color: red">O nome possui caracteres inválidos!</spam> <br/>');
}
if (count($errors) == 0) {
echo 'SALVA AS COISAS NO BANCO POIS OS DADOS ESTÃO VÁLIDOS';
} else {
foreach ($errors as $e) {
echo $e;
}
}
}
?>
</div>
<form action="verificar.php" method="POST">
<?php
include('connect.php');
if(!$conexao) {
echo 'nao conectou';
} else{
echo 'conectou';
} echo '<br>';
$query = 'select * from usuarios';
$result = mysqli_query($conexao, $query);
$query2 = "select * from datas";
$result2= mysqli_query($conexao, $query2);
$query3 = "select * from horas";
$result3 = mysqli_query($conexao, $query3);
$query4 = 'select * from cabeleleiros';
$result4 = mysqli_query($conexao, $query4);
?>
<select name="usuario" id="">
<?php while($row = mysqli_fetch_array($result)):;?>
<option value="<?php echo $row[1];?>"><?php echo $row[1];?></option>
<?php endwhile;?>
</select>
<select name="data" id="">
<?php while($row2 = mysqli_fetch_array($result2)):;?>
<option value="<?php echo $row2[1];?>"><?php echo $row2[1];?></option>
<?php endwhile;?>
</select>
<select name="hora" id="">
<?php while($row3 = mysqli_fetch_array($result3)):;?>
<option value="<?php echo $row3[1];?>"><?php echo $row3[1];?></option>
<?php endwhile;?>
</select>
<select name="cabeleleiro" id="">
<?php while($row4 = mysqli_fetch_array($result4)):;?>
<option value="<?php echo $row4[1];?>"><?php echo $row4[1];?></option>
<?php endwhile;?>
</select>
<input type="submit">
</form>
</body>
</html>