-
Notifications
You must be signed in to change notification settings - Fork 0
/
setor_inserir_execucao.php
246 lines (187 loc) · 10.6 KB
/
setor_inserir_execucao.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<?php
//$id_os = $_GET['id_os'];
require_once("config/db.php");
$id_os = $_GET['id_os']; // tratar depois (não pode ver os dos outros)
$protocolo = $_GET['protocolo'];
if(!isset($_SESSION)){
session_start();
}
$usuario = $_SESSION['user_name'];
$link = new mysqli('localhost', 'root', '', 'help_desk_ecos');
$link->set_charset('utf8');
$query_escola = "SELECT * FROM ordem_servico o, escola e WHERE o.id_os = '$id_os' and o.fk_id_nome_escola = e.id_escola";
$result_escola = $link->query($query_escola) or die(mysqli_error($link));
$row_result = mysqli_fetch_object($result_escola);
$id_escola = $row_result->id_escola;
$query_serial = "SELECT * FROM escola e, biometrias bi WHERE e.id_escola = '$id_escola' AND e.fk_id_biometria = bi.id_biometria";
$result_serial = $link->query($query_serial);
if (mysqli_num_rows($result_serial) > 0) {
$serial = mysqli_fetch_object($result_serial)->serial_bio;
}else{
$serial = "Não possui...";
}
if(isset($usuario) && isset($id_os) && !is_numeric($usuario)){ // fazer condicao pra garantir que a escola sera do operador
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HELP-ECOS | Sistema de Apoio às Escolas</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="assets/materialize/css/materialize.min.css" media="screen,projection" />
<!-- Bootstrap Styles-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FontAwesome Styles-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- Morris Chart Styles-->
<link href="assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
<!-- Custom Styles-->
<link href="assets/css/custom-styles.css" rel="stylesheet" />
<!-- Google Fonts-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="assets/js/Lightweight-Chart/cssCharts.css">
</head>
<script type="text/javascript">
function verifica() {
if (document.getElementById('alterar').checked) {
document.getElementById('data').disabled = true;
document.getElementById('tecnico').disabled = true;
document.getElementById('local').disabled = true;
document.getElementById('servico').disabled = true;
document.getElementById('observacao').disabled = true;
document.getElementById('pendencias').disabled = true;
document.getElementById('salva_exec').disabled = true;
document.getElementById('alterar_s').style.display = "inline";
}else{
document.getElementById('data').disabled = false;
document.getElementById('tecnico').disabled = false;
document.getElementById('local').disabled = false;
document.getElementById('servico').disabled = false;
document.getElementById('observacao').disabled = false;
document.getElementById('pendencias').disabled = false;
document.getElementById('salva_exec').disabled = false;
document.getElementById('alterar_s').style.display = "none";
}
}
</script>
<body>
<?php include("setor_menu.php"); ?>
<!-- /. NAV SIDE -->
<div id="page-wrapper">
<div class="header">
<h1 class="page-header">
Adicionar Execução Diária <small>Protocolo: <?php echo $protocolo; ?></small>
</h1>
<ol class="breadcrumb">
<li>Aqui você adiciona os serviços descritos na folha de execução.</li>
</ol>
</div>
<div id="page-inner">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-action">
Dados da Execução:
</div>
<div class="card-content">
<form method="post" action="executions/grava_execucao.php" name="abrir_chamado">
<div class="row">
<div class="input-field col s3">
<input type="date" name="data" id="data" required disabled>
</div>
</div>
<div class="row">
<div class="input-field col s3">
<input type="text" name="tecnico" id="tecnico" placeholder='Nome do Técnico' required disabled>
</div>
</div>
<!-- <div class="row">
<div class="input-field col s3">
<input value="<?php echo $serial; ?>" type="text" name="serial" placeholder='Serial da Biometria'>
</div>
</div> -->
<div class="row">
<div class="input-field col s3">
<label><font size="4"> SERIAL: <?php echo $serial; ?></font></label>
</div>
<div class="input-field col s3">
<p>
<input type="radio" name="tipo" id="nalterar" value="nalterar" onclick="verifica();">
<label for="nalterar">Não Alterar</label>
<input type="radio" name="tipo" checked="checked" id="alterar" value="alterar" onclick="verifica();">
<label for="alterar">Alterar</label>
</p>
</div>
<div class="input-field col s3" id="alterar_s" name="alterar_s">
<input type="button" class="waves-effect waves-light btn" value="alterar" onclick="window.location.href='altera_serial.php?id_os=<?php echo $id_os; ?>'">
</div>
</div><br>
<div class="row">
<div class="input-field col s10">
<input type="text" id="local" name="local" placeholder='Local da Execução' required disabled>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea class="form-control" rows="5" id="servico" name="servico" placeholder="Serviço realizado:" maxlength="10000" required disabled></textarea>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea class="form-control" rows="5" id="observacao" name="observacao" placeholder="Observações:" maxlength="10000" disabled></textarea>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea class="form-control" rows="5" id="pendencias" name="pendencias" placeholder="Pendências:" maxlength="10000" disabled></textarea>
</div>
</div>
<div class="row">
<input type="hidden" name="id_os" id="id_os" value="<?php echo $id_os; ?>">
</div>
<div class="row">
<div class="col s6">
<div class="input-field col s3">
<button type="submit" id="salva_exec" name="salva_exec" class="waves-effect waves-light btn" onClick="return validarcampos()" disabled>Inserir Execucao</button>
</div>
<div class="input-field col s3">
<a href="setor_ver_os.php?id_os=<?php echo $id_os; ?>" class="waves-effect waves-light btn custom-back">Voltar</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- /. ROW -->
</div>
<!-- /. PAGE INNER -->
</div>
</div>
<!-- /. WRAPPER -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/materialize/js/materialize.min.js"></script>
<!-- Metis Menu Js -->
<script src="assets/js/jquery.metisMenu.js"></script>
<!-- Morris Chart Js -->
<script src="assets/js/morris/raphael-2.1.0.min.js"></script>
<script src="assets/js/morris/morris.js"></script>
<script src="assets/js/easypiechart.js"></script>
<script src="assets/js/easypiechart-data.js"></script>
<script src="assets/js/Lightweight-Chart/jquery.chart.js"></script>
<!-- Custom Js -->
<script src="assets/js/custom-scripts.js"></script>
</body>
</html>
<?php
}else{
header("location: ./index.php");
exit();
}
?>