<?php
  date_default_timezone_set('America/Sao_Paulo');
  $dateadded = date("d/m/Y  --  G:i"); 
  $check5='checked';$check6='';$check7='';$check8='';
?>
<!DOCTYPE html>
<html lang='pt-br'>
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="x-ua-compatible" content="ie=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
    <title>Relatório Técnico</title>
    <link rel="icon" type="image/png" href="../images/favicon.ico">
    <link href="../css/estilo.css" rel="stylesheet" type="text/css" />
    <link href='../css/redmond/jquery-ui-1.10.1.custom.css' rel='stylesheet' type='text/css'>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/bootstrap-theme.min.css" rel="stylesheet">
    <link href="../css/theme.css" rel="stylesheet">
    <link href="../css/signin.css" rel="stylesheet">
    <script src='../js/jquery-3.3.1.min.js'></script>
    <script src='../js/jquery-ui.js' type='text/javascript'></script>
    <script src="../js/ui.datepicker-pt-BR.js"></script>
    <script src="../js/jquery.mask.js"></script>
    <script type='text/javascript' >
      $(document).ready(function(){
        $('.date').mask('00/00/0000');
        $('.time').mask('00:00');
      });
      $(function(){ // declaro o início do jquery
        $('.action').on('click', function(){//botão para disparar a ação
          var inicio      = $("input[name='inicio']").val();
          var horainicio  = $("input[name='horainicio']").val();
          var fim         = $("input[name='fim']").val();
          var horafim     = $("input[name='horafim']").val();
          var rt          = $("input[name='rt']:checked").val();
          var min         = $("input[name='min']").val();
          var max         = $("input[name='max']").val();
          var via         = 2;
          if (inicio!='' && horainicio!='' && fim!='' && horafim!='' && via!='' && min!='' && max!=''){
            $.get('sitrad02.php?inicio='+inicio+'&horainicio='+horainicio+'&fim='+fim+'&horafim='+horafim+'&via='+via+'&rt='+rt+'&min='+min+'&max='+max,function(data){
              $('#resultado').html(data);//onde vou escrever o resultado
            });
          }
        });
      });// fim do jquery
    </script>
  </head>
  <body role="document"> 
    <div class="container">   
      <table width="100%"> 
        <tr> 
          <td>
            <img src="../images/logo03.png" width="408" height="88"  />
          </td> 
          <td>
            <div class="page-header">
              <h2>
                <span class="label label-primary">&nbsp;&nbsp;Relatório Térmico dos Armazéns&nbsp;&nbsp;</span>
              </h2>
            </div>
          </td>
        </tr> 
        <tr> 
          <td height="30"  colspan="2" background="../images/top-menubg.gif" >&nbsp;&nbsp;<?php echo $dateadded; ?>
          </td> 
        </tr> 
      </table>
        <div class="col-md-12" align="center">
          <form method='GET' action='sitrad02.php'>
            <div>
              <table width='100%' style='padding: 10px 10px 10px 10px;'>
                <tr>
                  <td align='center' width='45%' >
                    <img src="images/mapa.png" width="160" height="25" usemap="#Map"></br></br>
                    <map name="Map" id="Map">
                      <area shape="rect" coords="0,0,50,50" href="#" class='action'/>
                    </map>            
                    <label>Data:&nbsp;&nbsp;</label><input type='date'  name='inicio'id='inicio' value=''size='10'maxlength='10' required autofocus /></br></br>
                    <label>Hora:&nbsp;&nbsp;</label><input name='horainicio'type='text' class='time' id='horainicio'size='5'maxlength='5' required /></br></br>
                    <label>Temperatura Mínima:&nbsp;&nbsp;</label><input name='min'type='number' id='min' min='0' max='30' value='15'required />
                  </td>
                  <td align='center' width='10%' >
                    <img src="images/mapa3.png" width="100" height="25"></br></br>
                    <!--!-->
                    <input type="radio"name="rt" id='rt' value="1" <?php echo $check1 ?> />&nbsp;&nbsp;A1-MOV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
                    <input type="radio"name="rt" id='rt' value="2" <?php echo $check2 ?> />&nbsp;&nbsp;A1-ARM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
                    <input type="radio"name="rt" id='rt' value="3" <?php echo $check3 ?> />&nbsp;&nbsp;A2-ARM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
                    <input type="radio"name="rt" id='rt' value="4" <?php echo $check4 ?> />&nbsp;&nbsp;A3-ARM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
                    
                    <input type="radio"name="rt" id='rt' value="5" <?php echo $check5 ?> />&nbsp;&nbsp;S001-ARM01<br>
                    <input type="radio"name="rt" id='rt' value="6" <?php echo $check6 ?> />&nbsp;&nbsp;S002-ARM02<br>
                    <input type="radio"name="rt" id='rt' value="7" <?php echo $check7 ?> />&nbsp;&nbsp;S003-HUB&nbsp;&nbsp;&nbsp;&nbsp;<br>
                    <input type="radio"name="rt" id='rt' value="8" <?php echo $check8 ?> />&nbsp;&nbsp;TW-OSA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
                  </td>
                  <td align='center' width='45%'>
                    <img src="images/mapa2.png" width="160" height="25"></br></br>
                    <label>Data:&nbsp;&nbsp;</label><input type='date'  name='fim'id='fim'value=''size='10'maxlength='10'required /></br></br>
                    <label>Hora:&nbsp;&nbsp;</label><input name='horafim'type='text' class='time' id='horafim'size='5'maxlength='5' required /></br></br>
                    <label>Temperatura Máxima:&nbsp;&nbsp;</label><input name='max' type='number' id='max' min='0' max='30' value='25' required />
                  </td>
                </tr>
                <tr>
                  <td align='center' colspan='3'></br>
                    <input id="via"name="via"type="hidden"value="1"/>
                    <input type='submit' class='btn btn-primary'value=' OK ' />
                  </td>
                </tr>
              </table>
            </div>
          </form>
          <div id='resultado'></div></br></br>
        </div>
    </div>
  </body>
  <p class="copyright" align="center">&copy; Copyright 2023 TransWar - Todos os direitos reservados. Versão 1.0</p> 
  <br />
  <script src="../js/bootstrap.min.js"></script>
  <script src="../js/ie10-viewport-bug-workaround.js"></script>
</html>
