-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddLote.php
103 lines (75 loc) · 3.38 KB
/
addLote.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
require_once 'includes/config.php';
require_once 'header.php';
?>
<script type="text/javascript">
function gravar() {
if($("#customForm").validationEngine('validate')) {
var action = '/actions/atualizarLote.php';
var form_data = {
idLote: $("#idLote").val(),
nmLote: $("#nmLote").val()
};
$.ajax({
type: "POST",
url: action,
data: form_data,
success: function(response)
{
alert("Gravado com sucesso");
window.location = "lotes.php";
}
});
}
}
function cancelar() {
window.location = "lotes.php";
}
</script>
<div class="main">
<div class="speedbar">
<div class="speedbar-nav">Cadastro Famílias</div>
</div>
<?php
if(isset($_REQUEST['id'])) {
$idLote = $_REQUEST['id'];
$sql = 'select * from lote where idLote = ' . $idLote;
$result = $db->query($sql);
$row = $result->fetch_assoc();
} ?>
<!--Form-->
<div class="grid-1">
<div class="title-grid">Cadastrar Novo Lote</div>
<div class="content-gird">
<div class="form">
<form method="post" id="customForm" action="#">
<?php if(isset($idLote)) { ?>
<div class="elem">
<label>Código Lote: </label>
<div class="indent">
<input type="hidden" id="idLote" name="idLote" value="<?=$row['idLote']?>"> <?=$row['idLote']?>
</div>
</div>
<?php } ?>
<div class="elem">
<label>Nome Lote: </label>
<div class="indent">
<input type="text" id="nmLote" name="nmLote" maxlength="100" value="<?=$row['nmLote']?>" class="medium validate[required] text-input">
</div>
</div>
<div class="elem">
<div class="indent">
<input id="gravarM" name="gravarM" onclick="gravar();" type="button" class="button-a gray" value="Gravar" />
<input id="cancelarM" name="cancelarM" onclick="cancelar();" type="button" class="button-a gray" value="Cancelar" />
</div>
</div>
</form>
<div class="clear"> </div>
</div>
</div>
</div>
<!--Form end-->
</div><!-- END MAIN-->
<?php
require_once 'barralateral.php';
require_once 'footer.php';