<?php
include_once '../auxiliar/login_fora_do_horario_guard.php';
include_once '../bd/bd_senhas.inc';
include '../idiomas/config.inc';

login_fora_do_horario_guard();
?>

<!DOCTYPE html>
<html>

<head>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>AFV 2 | Inicio</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="./../web/bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="./../web/bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="./../web/bower_components/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="./../web/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="./../web/dist/css/skins/_all-skins.min.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>

<body class="hold-transition skin-blue sidebar-mini">
  <!-- Site wrapper -->
  <div class="wrapper">

    <header class="main-header">
      <!-- Logo -->
      <a href="../html/cadastro.php" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini">ADV</span>
        <!-- logo for regular state and mobile devices -->
        <span class="logo-lg"><b>AFV</b> - ADV Tecnologia </span>
      </a>
      <!-- Header Navbar: style can be found in header.less -->
      <nav class="navbar navbar-static-top">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </a>
      </nav>
    </header>

    <!-- =============================================== -->
    <!-- Inserir modal aqui-->
    <div class="modal fade" id="modal-default">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title"><?php  echo $m_relatorios; ?></h4>
          </div>
          <div class="modal-body">
            <p>
              <?php
              include './../html/relatorios.php';
              ?>
            </p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php  echo $bt_sair; ?></button>
          </div>
        </div>
        <!-- /.modal-content -->
      </div>
      <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->



    <?php
    include_once '../bd/funcoes.inc';
    if (lecookie("codos")) {
      echo " <SCRIPT>
                          self.location.href='../html/produtos_consulta.php';
                        </SCRIPT>";
      exit;
    }
    ?>

    <?php include "../modais/modal_cliente_search.php" ?>


    <!-- Fim do modal -->

    <!-- Left side column. contains the sidebar -->
    <aside class="main-sidebar">
      <!-- sidebar: style can be found in sidebar.less -->
      <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
          <div class="pull-left image">
            <img src="./../icons/frame.png" class="img-circle" alt="User Image">
          </div>
          <div class="pull-left info">
            <p name="usuariologado">
              <?php
              include_once '../bd/funcoes.inc';
              $p_codusu = lecookie("codusu");
              echo (TrazValorCampo('senhas', 'usuario', 'codusu', lecookie('codusu')));
              ?>
            </p>
          </div>
        </div>

        <?php if(isGerente(lecookie('codusu'))): ?>
        <form action="../php/get_pedido_to_edit.php" method="post" class="sidebar-form">
          <div class="input-group">
            <input type="text" name="os" class="form-control" placeholder="Buscar OS">
            <span class="input-group-btn">
                  <button type="submit" name="search" id="search-btn" class="btn btn-flat">
                    <i class="fa fa-search"></i>
                  </button>
                </span>
          </div>
        </form>
        <?php endif; ?>

        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu" data-widget="tree">
          <li class="header"><?php  echo $g_painel_navegacao; ?></li>
          <li class="treeview">
            <a href="#">
              <i class="fa fa-dashboard"></i> <span name='MVendas'><?php  echo $m_vendas; ?></span>
              <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
            </a>
            <ul class="treeview-menu">
              <li><a href="./buscahistvnd.php" name='HistVenda'><i class="fa fa-circle-o"></i> <?php  echo $m_historico_venda; ?></a></li>
              <li><a href="#" data-toggle="modal" data-target="#modal-buscarcliente" name='NovaVenda'><i class="fa fa-circle-o"></i> <?php  echo $m_nova_venda; ?></a></li>
            </ul>
          </li>
          <li class="treeview">
            <a href="#">
              <i class="glyphicon glyphicon-user"></i> <span name='MClientes'><?php  echo $m_clientes; ?></span>
              <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
            </a>
            <ul class="treeview-menu">
              <li><a href="./cadastronovo.php"><i class="fa fa-circle-o"></i> <?php  echo $m_cadastrar_cliente; ?></a></li>
              <li>
                <a href="#" data-toggle="modal" data-target="#modal-buscarcliente" name='MLocalizarCliente'>
                  <i class="fa fa-circle-o"></i>
                  <?php  echo $m_localizar_cliente; ?></a>
              </li>
            </ul>
          </li>
          <li class="treeview">
            <a href="#" data-toggle="modal" data-target="#modal-default">
              <i class="fa fa-files-o"></i>
              <span><?php  echo $m_relatorios; ?></span>
            </a>
          </li>
          <li>
            <a href="./produtos_consulta.php">
              <i class="glyphicon glyphicon-search"></i> <span><?php  echo $m_consulta_produtos; ?></span>
            </a>
          </li>
          <li>
            <a href="../php/logoff.php">
              <i class="glyphicon glyphicon-off"></i>
              <span name='logout'><?php  echo $m_Logout; ?></span>
            </a>
          </li>
        </ul>
      </section>
      <!-- /.sidebar -->
    </aside>

    <!-- =============================================== -->

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <section class="content-header">
        <h1>
          <?php echo $h_pagina_inicial; ?>
        </h1>
        <ol class="breadcrumb">
          <!-- controle de paginas aqui-->
          <li><a href="#"><i class="fa fa-dashboard"></i> <?php  echo $g_inicio; ?></a></li>
        </ol>
      </section>

      <!-- Main content -->
      <section class="content">

        <!-- Default box -->
        <div class="box">
          <div class="box-header with-border">
            <h3 class="box-title"></h3>

            <div class="box-tools pull-right">
              <button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
                <i class="fa fa-minus"></i></button>
              <button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
                <i class="fa fa-times"></i></button>
            </div>
          </div>
          <div class="box-body">
            <!-- Inserir aqui-->

            <a href="#" data-toggle="modal" data-target="#modal-buscarcliente">
              <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box bg-green">
                  <span class="info-box-icon"><i class="fa fa-cart-plus"></i></span>

                  <div class="info-box-content">
                    <span class="info-box-text"><?php echo $m_vendas; ?></span>
                    <span class="info-box-number" name="ANovaVenda"><?php echo $b_iniciar_venda; ?></span>
                  </div>
                  <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
              </div>
            </a>

            <a href="./cadastronovo.php">
              <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box bg-aqua">
                  <span class="info-box-icon"><i class="fa fa-user"></i></span>

                  <div class="info-box-content">
                    <span class="info-box-text"><?php echo $m_clientes; ?></span>
                    <span class="info-box-number" name="ANovoCliente"><?php echo $b_cadastrar_cliente; ?></span>
                  </div>
                  <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
              </div>
            </a>

            <a href="./produtos_consulta.php">
              <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box bg-yellow">
                  <span class="info-box-icon"><i class="fa  fa-search"></i></span>

                  <div class="info-box-content">
                    <span class="info-box-text"><?php echo $b_produtos; ?></span>
                    <span class="info-box-number"><?php echo $b_consulta_estoque; ?></span>


                  </div>
                  <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
              </div>
            </a>

            <a href="#" data-toggle="modal" data-target="#modal-default">
              <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box bg-red">
                  <span class="info-box-icon"><i class="fa fa-bar-chart"></i></span>

                  <div class="info-box-content">
                    <span class="info-box-text"><?php echo $m_relatorios; ?></span>
                    <span class="info-box-number"><?php echo $b_consultar_relatorios; ?></span>

                    <!-- /.info-box-content -->
                  </div>
                  <!-- /.info-box -->
                </div>
            </a>

            <!-- Finalizar aqui-->
          </div>

        </div>
        <!-- /.box -->

      </section>
      <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

     <?php  include_once '../html/footer.php'; ?>
  </div>
  <!-- ./wrapper -->

  <!-- jQuery 3 -->
  <script src="../web/bower_components/jquery/dist/jquery.min.js"></script>
  <!-- Bootstrap 3.3.7 -->
  <script src="../web/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  <!-- SlimScroll -->
  <script src="../web/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
  <!-- FastClick -->
  <script src="../web/bower_components/fastclick/lib/fastclick.js"></script>
  <!-- AdminLTE App -->
  <script src="../web/dist/js/adminlte.min.js"></script>
  <!-- AdminLTE for demo purposes -->
  <script src="../web/dist/js/demo.js"></script>
  <script>
    $(document).ready(function() {
      $('.sidebar-menu').tree()
      if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition((position) => {});
      }
    });
  </script>
</body>

</html>