-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.php
46 lines (35 loc) · 1.09 KB
/
edit.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
<?php
include 'config/Includes.php';
$TarTable->setTable("tabela");
$select = $TarTable->select(array(
"where" => array("id" => (int) $_GET['id']),
));
?>
<h1>Editar</h1>
<?php foreach($select as $value): ?>
<form action="update.php?id=<?php echo $value['id']; ?>" method="post">
<fieldset>
<legend>Novo</legend>
<label for="titulo">titulo</label>
<input type="text" id="titulo" name="titulo" value="<?php echo $value['titulo']; ?>" />
<br />
<label for="descricao">descricao</label>
<textarea id="descricao" name="descricao"><?php echo $value['descricao']; ?></textarea>
<br />
<label for="nivel">nivel</label>
<select id="nivel" name="nivel">
<?php
$niveis = $TarTable->select(array("table" => "nivel"));
foreach($niveis as $nivel):
?>
<option value="<?php echo $nivel['id']; ?>"<?php if($value['nivel'] == $nivel['id']): echo ' selected="selected"'; endif; ?>><?php echo $nivel['nome']; ?></option>
<?php endforeach; ?>
</select>
<br />
<button type="submit">Salvar</button>
</fieldset>
</form>
<?php endforeach; ?>
<?php
$TarTable->unsetBase();
?>