forked from rudineirossales/FTTH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cadastro.php
527 lines (293 loc) · 11.8 KB
/
cadastro.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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
<?php
include "conn.php";
session_start();
if(!isset($_SESSION["login"]) && !isset($_SESSION["senha"]) )
{
header("Location: index.html");
exit;
}
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<!-- FUNCAO COMPLETAR CAMPO TRECHO-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("select[name=causa]").change(function(){
$("select[name=sub]").html('<option value="0">Carregando...</option>');
$.post("causa.php",
{causa:$(this).val()},
function(valor){
$("select[name=sub]").html(valor);
}
)
})
$("select[name=cdo]").change(function(){
$("select[name=logradouro]").html('<option value="0">Carregando...</option>');
$.post("cdo.php",
{cdo:$(this).val()},
function(valor){
$("select[name=logradouro]").html(valor);
}
)
})
$("select[name=cdo]").change(function(){
$("select[name=fachada]").html('<option value="0">Carregando...</option>');
$.post("cdo.php",
{cdo:$(this).val()},
function(valor){
$("select[name=fachada]").html(valor);
}
)
})
})
</script>
<!-- FIM FUNCAO -->
<script type="text/javascript">
function completar_campos(){
document.getElementById("loading").style.display = "block";
var con_consulta;
if (window.XMLHttpRequest){
con_consulta = new XMLHttpRequest();
}else{
con_consulta = new ActiveXObject("Microsoft.XMLHTTP");
}
con_consulta.onreadystatechange = function(){
if(con_consulta.readyState == 4 && con_consulta.status == 200){
document.querySelector("#dinamico").innerHTML = con_consulta.responseText;
document.getElementById("loading").style.display = "none";
}
}
var id = document.getElementById("id").value;
con_consulta.open("GET","processar_id.php?id="+id,true);
con_consulta.send(null);
}
</script>
<meta charset="utf-8">
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.maskedinput.js"></script>
<script type="text/javascript" src="validacaoid.js"></script>
<script type="text/javascript" src="jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<link rel="icon" href="img/logo_serede.png">
<style>
footer {
background-color: #555;
color: white;
padding: 15px;
text-align:center;
}
.container-fluid
{
background-color: purple;
}
#realcar
{
background-color: grey;
}
#realcar2
{
background-color: #D3D3D3;
}
#loading
{
width:70px;
height:70px;
}
</style>
<title>TESTE FTTH</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"><?php echo $_SESSION["nome"] ;?></a>
</div>
<ul class="nav navbar-nav">
<li class="active" style="float:right"><a href="pesq_col.php">Busca Colaborador</a></li>
<li class="active" style="float:right"><a href="pesq_per.php">Busca Período</a></li>
<li class="active" style="float:right"><a href="logout.php">Logout</a></li>
<?php if ($_SESSION["acesso"] == 'ADM'){ ?>
<li class="active" style="float:right"><a href="dashboard.php">Voltar</a></li>
<?php } else { ?>
<?php } ?>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row content">
<div class="col-sm-10 " >
<form class="form" role="form" name="seachform" method="post" action="enviar.php " enctype="multipart/form-data" >
<div class="form-group">
<label for="cabo">BA:</label>
<input type="text" class="form-control" name="ba" required >
</div>
<div class="form-group">
<label for="cabo">CELULA:</label>
<input type="text" class="form-control" name="celula" required >
</div>
<div class="form-group">
<label for="cabo">NÚMERO:</label>
<input type="text" class="form-control" name="cdoe_i" required >
</div>
<div class="form-group">
<label for="email" >CDOE / I:</label> <br>
<select name="tipo2" required >
<option value="CDOE" >CDOE</option>
<option value="CDOI" >CDOI</option>
<option value="CDOI.A" >CDOI.A</option>
</select>
</div>
<div class="form-group">
<label for="cabo">ENDEREÇO:</label>
<input type="text" class="form-control" name="endereco" required >
</div>
<div class="form-group">
<label for="cabo">LOCALIDADE:</label>
<input type="text" class="form-control" name="local" maxlength="6" required >
</div>
<div class="form-group">
<label for="email" >CABO / MODELO:</label> <br>
<select name="cabo" required >
<option value="06 FO" >06 FO</option>
<option value="12 FO" >12 FO</option>
<option value="18 FO" >18 FO</option>
<option value="24 FO" >24 FO</option>
<option value="36 FO" >36 FO</option>
<option value="48 FO" >48 FO</option>
<option value="72 FO" >72 FO</option>
<option value="144 FO" >144 FO</option>
</select>
</div>
<div class="form-group">
<label for="cabo">METRAGEM CABO:</label>
<input type="text" class="form-control" name="cabo_metro" required >
</div>
<div class="form-group">
<label for="email" >USO DE CAIXA:</label> <br>
<select name="caixa" required >
<option value="NAO" >NÃO</option>
<option value="CEO" >CEO</option>
<option value="CDOE" >CDOE</option>
<option value="CDOI" >CDOI</option>
</select>
</div>
<img src="img/loading.gif" id="loading" style="display:none; width:50px;height:50px;" />
<div class="form-group" id="dinamico" >
<label for="cabo">ID TÉCNICO / EQUIPE:</label>
<input type="text" class="form-control" name="id" id="id" onblur="completar_campos();" required >
</div>
<div class="form-group">
<label for="email" >ATIVIDADE:</label> <br>
<select name="atv" required >
<option value="BD" >Aereo</option>
<option value="OS" >OS</option>
</select>
</div>
<div class="form-group">
<label for="data">
DATA DO TERMINO DA ATIVIDADE
</label>
<!-- Special version of Bootstrap that only affects content wrapped in .bootstrap-iso -->
<link rel="stylesheet" href="https://formden.com/static/cdn/bootstrap-iso.css" />
<!--Font Awesome (added because you use icons in your prepend/append)-->
<link rel="stylesheet" href="https://formden.com/static/cdn/font-awesome/4.4.0/css/font-awesome.min.css" />
<!-- Inline CSS based on choices in "Settings" tab -->
<style>.bootstrap-iso .formden_header h2, .bootstrap-iso .formden_header p, .bootstrap-iso form{font-family: Arial, Helvetica, sans-serif; color: black}.bootstrap-iso form button, .bootstrap-iso form button:hover{color: white !important;} .asteriskField{color: red;}</style>
<!-- HTML Form (wrapped in a .bootstrap-iso div) -->
<div class="bootstrap-iso">
<div class="row">
<div class="form-group ">
<div class="col-sm-10">
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-calendar">
</i>
</div>
<input class="form-control" id="date" name="date" autocomplete="off" placeholder="DD/MM/AAAA" type="text" />
</div>
</div>
</div>
</div>
</div>
<!-- Extra JavaScript/CSS added manually in "Settings" tab -->
<!-- Include jQuery -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<!-- Include Date Range Picker -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css" />
<script>
$(document).ready(function(){
var date_input=$('input[name="date"]'); //our date input has the name "date"
var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
date_input.datepicker({
format: 'yyyy-mm-dd',
container: container,
todayHighlight: true,
autoclose: true,
})
})
</script>
</div>
<div class="form-group">
<label for="pwd">AÇÃO:</label><br>
<textarea name="obs" cols="70" rows="5" maxlength="1000"></textarea>
</div>
<div class="form-group">
<label for="email" >CAUSA:</label> <br>
<select class="form-control" name="causa">
<option value="0" disabled="disabled" required >Escolha uma Causa</option>
<?php
$sql = "SELECT * FROM codigos group by causa order by cod";
$qr = mysql_query($sql) or die(mysql_error());
do {
echo '<option value="'.$ln['causa'].'">'.$ln['causa'].'</option>';
}while($ln = mysql_fetch_assoc($qr))
?>
</select>
</div>
<div class="form-group">
<label for="email" >SUB:</label> <br>
<select name="sub" required >
<option value="0" disabled="disabled" required>Escolha uma subcausa</option>
</select>
</div>
<div class="form-group">
<label for="email" >Serviço:</label> <br>
<select name="servico" required >
<option value="1- RECUPERADO" required>1- RECUPERADO</option>
<option value="2- PENDENTE" required>2- PENDENTE</option>
</select>
</div>
<div class="form-group">
<label for="email" >Tipo:</label> <br>
<select name="tipo" required >
<option value="PREVENTIVO" required>PREVENTIVO</option>
<option value="REPARO" required>REPARO</option>
<option value="BA" required>BA</option>
</select>
</div>
<div class="form-group">
<div class="form-group" >
<label for="email">Fotos:</label> <label style="font-size: 12px; color: red;" >(Permitido apenas fotos menores que 2MB)</label>
<input type="file" id="foto1" name="foto1" /><br>
</div>
<br><br><button type="submit" value="Enviar" class="btn btn-danger" id="enviar"> <strong>Enviar</strong> </button><br><br><br><br>
</form>
</div>
</div>
</body>
</html>