Spaces:
Sleeping
Sleeping
File size: 31,008 Bytes
bce4323 |
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 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta charset="utf-8" />
<title>ATUALLI MOSAICO WEB</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Arial;
}
#logo {
width: 100%;
top: 10px;
z-index: 1;
}
.title_print, .reporting_period {
text-align: center;
}
.header {
text-align: center;
padding: 0.05%;
background: #053067;
color: white;
}
.row {
display: flex;
flex-wrap: wrap;
padding: 48px 0;
}
/* Create four equal columns that sits next to each other */
.column {
flex: 25%;
max-width: 25%;
padding: 0 2px;
}
.column img {
margin-top: 2px;
vertical-align: middle;
}
.column:active img {
-webkit-transform: scale(2);
transform: scale(2);
cursor: zoom-out;
}
/* Responsive layout - makes a two column-layout instead of four columns */
@media screen and (max-width: 800px) {
.column {
flex: 50%;
max-width: 50%;
}
}
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
.column {
flex: 100%;
max-width: 100%;
}
}
#popupbox {
margin: 0;
margin-left: 40%;
margin-right: 40%;
margin-top: 50px;
padding-top: 10px;
width: 20%;
height: 150px;
position: fixed;
background: #FBFBF0;
border: solid #000000 2px;
z-index: 9;
font-family: arial;
visibility: hidden;
}
#ocorrencia {
margin: 0;
margin-left: 25%;
margin-right: 25%;
margin-top: 12%;
padding-top: 10px;
width: 50%;
height: 50%;
position: fixed;
background: white;
border: solid black 2px;
z-index: 9;
font-family: arial;
visibility: hidden;
}
.topnav {
position: fixed;
top: 0;
width: 100%;
overflow: hidden;
background-color: #333;
}
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.active {
background-color: #4CAF50;
color: white;
}
.topnav .icon {
display: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 17px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.dropdown-content {
display: none;
position: fixed;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.topnav a:hover, .dropdown:hover .dropbtn {
background-color: #555;
color: white;
}
.dropdown-content a:hover {
background-color: #ddd;
color: black;
}
.dropdown:hover .dropdown-content {
display: block;
}
@media screen and (max-width: 600px) {
.topnav a:not(:first-child), .dropdown .dropbtn {
display: none;
}
.topnav a.icon {
float: right;
display: block;
}
}
@media screen and (max-width: 600px) {
.topnav.responsive {
position: relative;
}
.topnav.responsive .icon {
position: absolute;
right: 0;
top: 0;
}
.topnav.responsive a {
float: none;
display: block;
text-align: left;
}
.topnav.responsive .dropdown {
float: none;
}
.topnav.responsive .dropdown-content {
position: relative;
}
.topnav.responsive .dropdown .dropbtn {
display: block;
width: 100%;
text-align: left;
}
}
/*
novo popup
*/
/* Button used to open the contact form - fixed at the bottom of the page */
.open-button {
background-color: #555;
color: white;
padding: 16px 20px;
border: none;
cursor: pointer;
opacity: 0.8;
position: fixed;
bottom: 23px;
right: 28px;
width: 280px;
}
/* The popup form - hidden by default */
.form-popup {
display: none;
position: fixed;
bottom: 0;
right: 15px;
border: 3px solid #f1f1f1;
z-index: 9;
}
/* Add styles to the form container */
.form-container {
max-width: 300px;
padding: 10px;
background-color: white;
}
/* Full-width input fields */
.form-container input[type=text], .form-container input[type=password] {
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
border: none;
background: #f1f1f1;
}
/* When the inputs get focus, do something */
.form-container input[type=text]:focus, .form-container input[type=password]:focus {
background-color: #ddd;
outline: none;
}
/* Set a style for the submit/login button */
.form-container .btn {
background-color: #4CAF50;
color: white;
padding: 16px 20px;
border: none;
cursor: pointer;
width: 100%;
margin-bottom: 10px;
opacity: 0.8;
}
/* Add a red background color to the cancel button */
.form-container .cancel {
background-color: red;
}
/* Add some hover effects to buttons */
.form-container .btn:hover, .open-button:hover {
opacity: 1;
}
/* POPUP central */
/* Full-width input fields */
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
/* Set a style for all buttons */
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
/* Extra styles for the cancel button */
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
/* Center the image and position the close button */
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
position: relative;
}
img.avatar {
width: 40%;
border-radius: 50%;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
padding-top: 60px;
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}
/* The Close Button (x) */
.close {
position: absolute;
right: 25px;
top: 0;
color: #000;
font-size: 35px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
/* Add Zoom Animation */
.animate {
-webkit-animation: animatezoom 0.6s;
animation: animatezoom 0.6s
}
@-webkit-keyframes animatezoom {
from {
-webkit-transform: scale(0)
}
to {
-webkit-transform: scale(1)
}
}
@keyframes animatezoom {
from {
transform: scale(0)
}
to {
transform: scale(1)
}
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
</style>
</head>
<body onload="iniciaPagina();">
<title>Hello</title>
<div class="topnav" id="myTopnav">
<a href="#news" onclick="javascript:void(0);" id="Fila">Fila</a>
<a href="#news"> Ocorrencias</a>
<div class="dropdown">
<button class="dropbtn">
Clientes
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="http://atualli.ddns.net/operacao">MOEMA</a>
<a href="http://atualli.ddns.net/operacaomagma">MAGMA</a>
<a href="http://atualli.ddns.net/operacaoatualli">ATUALLI</a>
<a href="http://atualli.ddns.net/operacaopedra">PEDRAFL</a>
<a href="http://atualli.ddns.net/operacaomultilaser-extrema-1">MULTILASER-EXTREMA-1</a>
<a href="http://atualli.ddns.net/operacaomultilaser-extrema-3">MULTILASER-EXTREMA-3</a>
</div>
</div>
<a href="javascript:openForm();" id="myLogin">Login</a>
<a href="javascript:void(0);" class="icon" onclick="myFunctionNav()">
<i class="fa fa-bars"></i>
</a>
</div>
<div class="row">
<tr>
<div class="form-popup" id="myForm">
<form action="javascript:autentica();" class="form-container">
<h1>Login</h1>
<label for="email"><b>Usuario</b></label>
<input type="text" placeholder="Usuario" id="myFormUsuario" name="email" required>
<label for="psw"><b>Senha</b></label>
<input type="password" placeholder="Senha" id="myFormSenha" name="psw" required>
<button type="submit" class="btn">Login</button>
<button type="button" class="btn cancel" onclick="closeForm()">Close</button>
</form>
</div>
<div id="ocoModal" class="modal">
<form class="modal-content animate" action="javascript:gravaOcorrencia()" method="get">
<div class="imgcontainer">
<span onclick="document.getElementById('ocoModal').style.display = 'none'" class="close" title="Close Modal">×</span>
<video id="videoocorrencia" preload="yes" autoplay loop muted playsinline width=50% height=50% controls src="getpathvideo?c=" type="video/mp4"> </video>
<br />
</div>
<div class="container" style="background-color:#f1f1f1">
<label id="Operador" for="rot"><b>Operador: </b></label>
</div>
<div class="container" style="background-color:#f1f1f1">
<label id="DataOcorrencia" for="rot"><b>Data: </b></label>
</div>
<div class="container" style="background-color:#f1f1f1">
<label id="NomeRoteiro" for="rot"><b>Roteiro: </b></label>
</div>
<div class="container">
<label id="pergunta1" for="uname"><b>Pergunta1</b></label>
<input type="text" id="resposta1" placeholder="Texto livre" name="resposta1" required>
<label id="pergunta2" for="psw"><b>Pergunta2</b></label>
<input type="text" id="resposta2" placeholder="Texto livre" name="resposta2" required>
<input type="hidden" name="cmd" id="GravaOcorrencia" value="">
<input type="hidden" name="idOco" id="idOco" value="">
<input type="hidden" name="idCamera" id="idCamera" value="">
<button type="submit">Grava</button>
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" onclick="document.getElementById('ocoModal').style.display = 'none'" class="cancelbtn">Cancel</button>
</div>
</form>
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 1(1)
Setor:
" src="getresource?r=atualli.png&c=00&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick=" imgRedirect('zoom?n=1&m=1&p=00')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 2(2)
Setor:
" src="getresource?r=atualli.png&c=01&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick=" imgRedirect('zoom?n=1&m=1&p=01')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 3(3)
Setor:
" src="getresource?r=atualli.png&c=02&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=02')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 4(4)
Setor:
" src="getresource?r=atualli.png&c=03&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=03')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 5(5)
Setor:
" src="getresource?r=atualli.png&c=04&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=04')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 6(6)
Setor:
" src="getresource?r=atualli.png&c=05&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=05')">
</div>
</tr><tr>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 7(7)
Setor:
" src="getresource?r=atualli.png&c=06&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=06')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 8(8)
Setor:
" src="getresource?r=atualli.png&c=07&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=07')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 9(9)
Setor:
" src="getresource?r=atualli.png&c=08&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=08')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 10(10)
Setor:
" src="getresource?r=atualli.png&c=09&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=09')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 11(11)
Setor:
" src="getresource?r=atualli.png&c=10&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=10')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 12(12)
Setor:
" src="getresource?r=atualli.png&c=11&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=11')">
</div>
</tr><tr>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 13(13)
Setor:
" src="getresource?r=atualli.png&c=12&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=12')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 14(14)
Setor:
" src="getresource?r=atualli.png&c=13&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=13')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 15(15)
Setor:
" src="getresource?r=atualli.png&c=14&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=14')">
</div>
<div class="column">
<img title="Cliente: MAGMA
DVR: INTELBRAS(DVR01)
IP: ibiraofc.ddns-intelbras.com.br:37779
Cam: CAMERA 16(16)
Setor:
" src="getresource?r=atualli.png&c=15&123" onload="refreshimg(this)" onerror="errorloadimg(this)" class="refr" alt="" style="width:100%" onclick="imgRedirect('zoom?n=1&m=1&p=15')">
</div>
</tr>
</div>
<script async>
// setInterval("gogo();", 1500);
var to = 1; // 2; //3;
var first = 0;
var idx = 0;
// Get the modal
var modalOcorrencia = document.getElementById('ocoModal');
// When the user clicks anywhere outside of the modal, close it
window.onclick = function (event) {
if (event.target == modalOcorrencia) {
modalOcorrencia.style.display = "none";
}
}
function openForm() {
document.getElementById("myForm").style.display = "block";
}
function closeForm() {
document.getElementById("myForm").style.display = "none";
}
function getVideoOcorrencia() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var json = JSON.parse(this.responseText);
var obj = document.getElementById("videoocorrencia");
//var s_rc = obj.getAttribute('src');
obj.setAttribute('src', "getpathvideo?c=" + json.video);
document.getElementById("pergunta1").innerHTML = "<b>" + json.pergunta1 + "</b>";
document.getElementById("pergunta2").innerHTML = "<b>" + json.pergunta2 + "</b>";
document.getElementById("NomeRoteiro").innerHTML = "<b> Roteiro :" + json.roteiro + "</b>";
document.getElementById("DataOcorrencia").innerHTML = "<b> Data: " + json.data + "</b>";
document.getElementById("Operador").innerHTML = "<b> Operador: " + document.getElementById("myLogin").innerHTML + "</b>";
var objidOco = document.getElementById("idOco");
var svalue = objidOco.getAttribute('value');
objidOco.setAttribute('value', json.idOcorrencia);
var objCam = document.getElementById("cameraOco");
objCam.setAttribute('src', "getresource?r=atualli.png&c="+json.camera+"&123");
}
};
xhttp.open("GET", "https://script.google.com/macros/s/AKfycbxNBYm7cgPj_TdVbsaU-LWdGT4Vdg0QBmkUXRoNmJlcrSVLRtE/exec?cmd=Ocorrencia&operador=" + document.getElementById("myLogin").innerHTML, true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("");
}
function gravaOcorrencia()
{
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var json = JSON.parse(this.responseText);
document.getElementById('ocoModal').style.display = 'none';
alert("OCORRENCIA GRAVADA COM SUCESSO !");
}
};
var objidOco = document.getElementById("idOco");
var idOco = objidOco.getAttribute('value');
var idResp1 = document.getElementById("resposta1").value;
var idResp2 = document.getElementById("resposta2").value;
xhttp.open("GET", "https://script.google.com/macros/s/AKfycbxNBYm7cgPj_TdVbsaU-LWdGT4Vdg0QBmkUXRoNmJlcrSVLRtE/exec?cmd=GravaOcorrencia&idOco=" + idOco + "&resposta1=" + idResp1 + "&resposta2=" + idResp2, true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("");
}
function myFunctionNav() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
function login(showhide) {
if (showhide == "show") {
document.getElementById('popupbox').style.visibility = "visible";
} else if (showhide == "hide") {
document.getElementById('popupbox').style.visibility = "hidden";
}
}
function autentica() {
var xhttp = new XMLHttpRequest();
var usuario = document.getElementById("myFormUsuario").value;
var senha = document.getElementById("myFormSenha").value;
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
if (this.responseText.indexOf("ERRO") > -1) {
document.getElementById("myLogin").innerHTML = this.responseText;
localStorage.setItem("sessao", this.responseText);
}
else {
localStorage.setItem("sessao", this.responseText);
}
}
closeForm();
};
document.getElementById("myLogin").innerHTML = "Aguarde Login";
xhttp.open("GET", "https://script.google.com/macros/s/AKfycbxNBYm7cgPj_TdVbsaU-LWdGT4Vdg0QBmkUXRoNmJlcrSVLRtE/exec?cmd=Login&user="+usuario+"&psw="+senha, true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("");
}
function getFila()
{
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("Fila").innerHTML = "Fila" + "(" + this.responseText + ") " + first;
}
};
xhttp.open("GET", "https://script.google.com/macros/s/AKfycbxNBYm7cgPj_TdVbsaU-LWdGT4Vdg0QBmkUXRoNmJlcrSVLRtE/exec?cmd=Fila", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("");
}
function getSessao()
{
var token = localStorage.getItem("sessao");
if (token != "") {
var xhttp2 = new XMLHttpRequest();
xhttp2.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
if (this.responseText.indexOf("ERRO") == -1) {
document.getElementById("myLogin").innerHTML = this.responseText;
//if (document.getElementById("Fila").onclick.indexOf("javascript:void(0);")>-1)
var cfile = document.getElementById("Fila").getAttribute('onclick');
if (cfile == "javascript:void(0);") {
document.getElementById("Fila").setAttribute('onclick', "document.getElementById('ocoModal').style.display = 'block'; getVideoOcorrencia();");
}
}
else {
document.getElementById("myLogin").innerHTML = "Login";
document.getElementById("Fila").setAttribute('onclick', "javascript:void(0);");
}
}
};
xhttp2.open("GET", "https://script.google.com/macros/s/AKfycbxNBYm7cgPj_TdVbsaU-LWdGT4Vdg0QBmkUXRoNmJlcrSVLRtE/exec?cmd=Sessao&token=" + token, true);
xhttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp2.send("");
}
}
function gogo2()
{
getFila()
getSessao()
setTimeout(gogo2, to * 1000);
}
function refreshimg(img)
{
}
function errorloadimg(img) {
var d = new Date(),
dummy = d.getTime();
var newurl = 'getresource?r=atualli.png&';
var obj = img,
s_rc = obj.getAttribute('src'),
pure_src = s_rc.substring(s_rc.indexOf('c='), s_rc.indexOf('c=') + 4);
obj.setAttribute('src',newurl+pure_src + '&' + dummy);
// obj.nextSibling.innerHTML = obj.getAttribute('src');
first += 20;
if (first > 5000)
first = 5000;
}
function gogo()
{
try {
if (first == 0) {
first += 1;
setTimeout(gogo, to * 10000);
}
var d=new Date(),
dummy=d.getTime(),
i=idx,
pix=document.images;
for (; i < pix.length; i++)
{
if (pix[i].className !== 'refr')
{ continue; }
else
{
var obj = pix[i];
if ((obj.complete)) {
first -= 5;
if (first < 1) first = 1;
}
else {
first += 20;
if (first > 5000)
first = 5000;
}
{
var s_rc = obj.getAttribute('src');
if (s_rc.indexOf('r=')) {
var newurl = 'http://atualli.ddns.net:8091/getcamera?';
var pure_src = s_rc.substring(s_rc.indexOf('c='), s_rc.indexOf('c=') + 4);
obj.setAttribute('src', newurl + pure_src + '&' + dummy);
}
else {
var pure_src = s_rc.substring(0, s_rc.indexOf('c=') + 4);
obj.setAttribute('src', pure_src + '&' + dummy);
}
// obj.nextSibling.innerHTML = obj.getAttribute('src');
idx += 1;
if (idx >= pix.length) idx = 0;
break;
}
}
}
setTimeout(gogo, first);
}
catch (e) {
setTimeout(gogo, to * 100);
}
}
function iniciaPagina()
{
// gogo2();
document.getElementById("Fila").setAttribute('onclick', "document.getElementById('ocoModal').style.display = 'block'; getVideoOcorrencia();");
gogo();
}
</script>
</body>
</html>
|