-
Notifications
You must be signed in to change notification settings - Fork 0
/
retirar_campo_form2.php
49 lines (37 loc) · 1.22 KB
/
retirar_campo_form2.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
<html>
<body>
<h2>Bloco de Notas</h2>
<h3>Retirar Campo</h3>
<?php
include 'functions.php';
session_start();
echo("<h5>Sessão de {$_SESSION['nome']} </h5>");
$connection=createConnection();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION['aux'] = test_input($_POST["tipo_reg_count"]);
}
$sql = "SELECT nome, campocnt FROM campo where userid = ".$_SESSION['id']." AND ativo=1 AND typecnt=".$_SESSION['aux']."";
$result = $connection->query($sql);
$rows = $result->fetchAll();
if (count($rows) == 0){
die('Operacao invalida: este tipo de registo nao possui campos');
}
?>
<form method="post" action="retirar_campo.php">
Nome do campo: <select name = "campo_id">
<?php
foreach ($rows as $row) { ?>
<option value="<?php echo($row[campocnt]); ?> "> <?php echo($row[nome]); ?> </option>
<?php } ?>
</select>
<br><br>
<input type="submit" value="Remover">
</form>
<?php
echo("<br></br>");
echo("<p><a href=\"retirar_campo_form.php?\">Retroceder</a></p>");
buttons();
$connection->close();
?>
</body>
</html>