-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform_labo.php
64 lines (49 loc) · 2.06 KB
/
form_labo.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
<?php include("sc_login_comum.php"); ?>
<!doctype html>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="css/site.css">
<link rel="stylesheet" type="text/css" href="css/menuadm.css">
<link rel="stylesheet" type="text/css" href="css/form.css">
<link rel="stylesheet" type="text/css" href="css/buttons.css">
<link rel="stylesheet" type="text/css" href="css/tables.css">
<?php
$labo_id = filter_input(INPUT_GET,'labo_id',FILTER_SANITIZE_NUMBER_INT);
if(isset($labo_id))//Se for update
{
$consulta_sql = "SELECT labo_id,
labo_tipo,
labo_alt,
labo_lar,
labo_obs
FROM tb_labo WHERE labo_id = '$labo_id'";
require_once("DBConnection.php");
$result = mysqli_query($conn, $consulta_sql);
$registro = mysqli_fetch_array($result);
mysqli_close($conn);
}
?>
<section id="index_adm">
<form method="POST" action="labo_crud.php" id="sem_margim_top" enctype="multipart/form-data">
<fieldset>
<?php if(isset($labo_id)) { ?>
<legend>Atualizar laboratório </legend>
<input type="hidden" name="labo_id" value="<?php echo isset($labo_id)? $labo_id : "";?>">
<?php }else{ ?>
<legend>Cadastrar laboratório </legend>
<?php }; ?>
<label>Tipo: </label>
<input type="text" name="labo_tipo" value="<?php echo isset($labo_id)? $registro['labo_tipo'] : "";?>">
<label>Altura: </label>
<input type="text" name="labo_alt" value="<?php echo isset($labo_id)? $registro['labo_alt'] : "";?>">
<label>Largura: </label>
<input type="text" name="labo_lar" value="<?php echo isset($labo_id)? $registro['labo_lar'] : "";?>">
<label>Observações: </label>
<textarea class="float_right" rows="9" cols="27" name="labo_obs"><?php echo isset($labo_id)? $registro['labo_obs'] : "";?></textarea>
<div id="btns">
<a href="Administracao.php?pagina=laboratoriosCadastrados.php"><input type="button" value="Voltar"></a>
<input type="reset" value="Limpar">
<input type="submit" value="Salvar" name="Salvar">
</div>
</fieldset>
</form>
</section>