<?php include_once('../../config.php') ?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Sisplan Web | Retaguarda B2B</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.2512.9.1">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.2512.9.1">

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


    <link rel="stylesheet" href="dist/css/custom.css?versao=3.2512.9.1">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.2512.9.1">
    <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.2512.9.1" />
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.2512.9.1">
    <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.2512.9.1" />
    <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.2512.9.1">
    <!-- <link rel="stylesheet" href="dist/css/leaflet.css?versao=3.2512.9.1"> -->
    <link rel="stylesheet" href="pages/retaguardab2b/css/retaguardab2b.css">
    <style>
    </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <?php
        include_once('../../menu.php');
        ?>
        <div class="content-wrapper">
            <div class="content-header">
                <div class="container-fluid">
                    <div class="row mb-2">
                        <div class="col-sm-6 flex">
                            <h1 class="m-0 text-dark">Retaguarda Mesa de Atendimento</h1>
                            <button type="button" class="btn btn-info btn-sm ml-2" title="Tutorial" style="color: white;" id="tutorial">
                                <i class="fas fa-question-circle"></i></button>
                        </div>
                        <div class="col-sm-6">
                            <!-- <ol class="breadcrumb float-sm-right">
                                
                                <li class="breadcrumb-item active">Retaguarda Mesa de Atendimento</li>
                            </ol> -->
                        </div>
                    </div>
                </div>
            </div>


            <div class="container-fluid">

                <div class="col-sm-12 mt-3 d-flex align-items-center">
                    <button class="btn btn-success btn-sisp mr-2" id="btnFiltros"><span class="fas fa-search"></span> Filtros</button>
                    <div class="icheck-danger d-inline pl-4" id="checkAovivo">
                        <input type="checkbox" id="cbAoVivo" checked="true" class="form-check-input">
                        <label for="cbAoVivo" class="mb-2">Ao Vivo</label>
                    </div>
                </div>
                <div class="row mx-4 mt-4">
                    <h5>Lista de Mesas em Atendimento - <h5 id="tipoConsulta"> Ao Vivo</h5>
                    </h5>
                </div>

                <div class="card m-4 " id="cardMesasRetaguarda"></div>

                <div class="row" id="divTabelaAtendimentos">
                    <div class="col-sm-12 table-responsive" style="padding-left:14px;">
                        <div class="col-sm-12 table-responsive card-body">
                            <table id="tabelaAtendimentos" class="table table-sm table-select table-hover" width="100%">
                                <thead></thead>
                                <tbody></tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class="row mr-4 d-none" id="divBtnVoltar">
                    <div class="col-12 d-flex justify-content-end">
                        <button class="btn btn-primary btn-sisp" id="btnVoltar"><span class="fas fa-arrow-left mr-2"></span> Voltar</button>
                    </div>
                </div>


            </div>
        </div>
    </div>

    <div id="modal-filtros" class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content" id="modalBody">
                <div class="modal-header">
                    <h4 class="modal-title">Filtros</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-6">
                            <div class="group-default form-group">
                                <label for="dtEmiIni">Início De/ Até:</label>
                                <div class="input-group">
                                    <input type="date" max="2500-12-31" value="2023-01-01" class="input-default focus form-control validate" id="txtDataDe" name="DataDe">
                                    <input type="date" max="2500-12-31" value="2500-12-01" class="input-default focus form-control validate" id="txtDataAte" name="DataAte">
                                </div>
                            </div>
                        </div>
                        <div class="col-6" id="UsuarioConsultaInfoTour">
                            <label data-error="wrong" data-success="right" for="txtUsuarioConsulta">Usuário </label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control d-none" id="txtUsuasadasdrioConsulta" name="txtUsuariasdasoConsulta" class="form-control" placeholder="Usuário">
                                <input type="text" placeholder="Usuário" class="input-default focus form-control validate ui-autocomplete-input" id="txtUsuarioConsulta" name="txtUsuarioConsulta" autocomplete="off" data-selecionado="false" data-chave="" data-desc="">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btn-UsuarioConsulta" name="btn-UsuarioConsulta" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btn-limpa-UsuarioConsulta" name="btn-limpa-UsuarioConsulta" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="row">
                        <button class="btn btn-primary btn-sisp" id="btnLimparFiltros" style="background-color: #B22222; border-color: #B22222"><span class="fas fa-trash"></span> Limpar Filtros</button>     
                        <button class="btn btn-primary btn-sisp" id="btnConsultar"><span class="fas fa-search"></span> Consultar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="modalDesistencia" tabindex="-1">
        <div class="modal-dialog modal-md modal-dialog-centered">
            <div class="modal-content" id="modal-content-DesistirItem">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalToggleLabel">Motivos da Desistência</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="col-6 d-flex align-items-center">
                        <h5>Lista Desistências</h5>
                    </div>
                    <div class="col-12 table-responsive ">
                        <table id="tabelaDesistenciaItem" width="100%" class="table table-sm table-select">
                            <thead></thead>
                            <tbody></tbody>
                        </table>
                    </div>
                </div>
                <div class="modal-footer" style="justify-content: flex-end; align-items: center;">
                    <div>
                        <button id="btnFecharDesistencia" type="button" class="btn btn-sm btn-sisp btn-success">Sair</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="modal-carrinho" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-xl">
            <div class="modal-content">
                <div class="modal-header" style="border:none">
                    <h4 id="modal-simular-titulo" class="modal-title">Carrinho</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="row">

                        <div class="col-12 table-responsive ">
                            <table id="tabelaCarrinho" style="width:100%;" width="100%" class="table table-sm table-select">
                                <thead></thead>
                                <tbody></tbody>
                            </table>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <?php
    include_once('../../modais.php');
    ?>
    <aside class="control-sidebar control-sidebar-dark">
    </aside>
    <script src="plugins/jquery/jquery.min.js?versao=3.2512.9.1"></script>
    <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.2512.9.1"></script>
    <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.2512.9.1"></script>
    <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.2512.9.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2512.9.1"></script>
    <script src="dist/js/adminlte.min.js?versao=3.2512.9.1"></script>
    <script src="dist/js/sisplan.js?versao=3.2512.9.1"></script>
    <!-- <script src="dist/js/leaflet.js?versao=3.2512.9.1"></script> -->
    <script src="utils/funcoes.js?versao=3.2512.9.1"></script>
    <script src="utils/cookies.js?versao=3.2512.9.1"></script>
    <script src="pages/pedidosb2b/js/arrayColunasDatatablePedido.js?versao=3.2512.9.1"></script>
    <script src="dist/js/requisicoes.js?versao=3.2512.9.1"></script>
    <script src="dist/js/loadingoverlay.min.js?versao=3.2512.9.1"></script>
    <script src="dist/js/driver.min.js?versao=3.2512.9.1"></script>
    <script src="plugins/toastr/toastr.min.js?versao=3.2512.9.1"></script>
    <script type="text/javascript" src="dist/js/sum().js?versao=3.2512.9.1"></script>
    <script type="text/javascript" src="config.js?versao=3.2512.9.1"></script>
    <script>
        $(document).ready(async function() {
            if (getCookie('usuario') == "") {
                window.location.href = `${BASE_URI}/login`;
                return;
            }

            let usuario = getCookie('usuario');
            let empresa = getCookie('empresa');

            ipInterno = IP_INTERNO;
            ipExterno = IP_EXTERNO;
            basicAuth = BASIC_AUTH;

            const temAcesso = await temAcessoTela('RETAGUARDAB2B');
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            sArquivo = `${BASE_URI}/pages/retaguardab2b/js/retaguardab2b.js?versao=3.2512.9.1`;
            insereJavaScriptPagina(sArquivo);

        });
    </script>
</body>

</html>