<?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 | Altera Preço</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.258.7.1">
    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.258.7.1">
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.258.7.1" />
    <link href='../dist/css/bootstrap.min.css?versao=3.258.7.1'>
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.258.7.1">
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.258.7.1">
    <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.258.7.1">
    <link rel="stylesheet" href="dist/css/custom.css?versao=3.258.7.1">
    <link rel="stylesheet" type="text/css" href="plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.258.7.1">
    <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.258.7.1" />
    <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.258.7.1">
    <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.258.7.1">
    <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.258.7.1">
    <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.258.7.1">
    <link rel="stylesheet" href="dist/css/sisplan.newColorsButtons.css?versao=3.258.7.1" type="text/css" />
    <link rel="stylesheet" href="dist/css/sisplan.adjustDataTableButtons.css?versao=3.258.7.1" type="text/css" />
    <style>
        .input-group button,
        .input-group input {
            height: 40px;
        }

        .input-group button {
            min-width: 45px;
        }

        .info-box-text {
            font-size: 20px;
            font-weight: bold;
            color: grey;
        }

        .input-preconovo {
            height: 1.8rem;
        }

        .radioStyle {
            border: solid #e0e4e6;
            border-radius: 4px;
            border-width: 2px;
            padding: 7px;
            margin-top: 5px;
            width: 317px;
            margin-left: 8px;
        }

        .checkStyle {
            border: solid #e0e4e6;
            border-radius: 4px;
            border-width: 2px;
            padding: 7px;
            margin-top: 31px;
            width: 320px;
            margin-left: 6px;
            padding-left: 11px !important;
        }

        .border-Field .textoBorda {
            font-size: 1em !important;
            text-align: left !important;
            width: auto;
            padding: 0 10px;
            border-bottom: none;
            font-weight: 700;
        }

        .border-Field {
            border: 1px solid var(--font-color) !important;
            padding: 0 0 0 1.0em !important;
            margin: 0 0 1.0em 0 !important;
            -webkit-box-shadow: 0px 0px 0px 0px #000;
            box-shadow: 0px 0px 0px 0px #000;
            border-radius: 4px;
        }

        .escondeRadio {
            font-weight: 500 !important;
        }

        #tabelaAlteraPreco td {
            padding: 5px 8px !important;
        }

        .table.dataTable tbody td,
        th {
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }

        #tabelaAlteraPreco_length {
            margin-top: 15px;
        }

        .dataTables_scroll {
            margin-top: -5px !important;
        }

        .dataTables_filter {
            align-items: baseline;
        }

        .col-1-3 {
            flex: 0 0 10.8333%;
            max-width: 10.8333%;
        }

        .col-10-7 {
            flex: 0 0 89.1667%;
            max-width: 89.1667%;
        }
    </style>

</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <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">Alteração de Preços</h1>
                            <button type="button" class="btn btn-info btn-sm ml-2" style="color: white;" id="tutorial">
                                <i class="fas fa-question-circle"></i> </button>
                        </div>
                    </div>
                    <div class="row card">
                        <div class="col-12" id="tourbotoes" style="margin-top: 8px; padding-left: 20px; padding-right: 20px;">
                            <div class="col-sm-12 p-0">
                                <div class="row">
                                    <div class="col-auto">
                                        <div class="form" id="tipos">
                                            <fieldset class="form border-Field mb-0 pb-0 col-md-auto">
                                                <legend class="textoBorda mb-0 pb-0">Tipo:</legend>
                                                <div class="form-row">
                                                    <div class="icheck-primary mr-3">
                                                        <input type="radio" checked="checked" id="radioProduto" name="radio"><label class="containerckd escondeRadio" for="radioProduto">Produto</label>
                                                    </div>
                                                    <div class="icheck-primary mr-3">
                                                        <input type="radio" id="radioMaterial" name="radio"><label class="containerckd escondeRadio" for="radioMaterial">Material</label>
                                                    </div>
                                                </div>
                                            </fieldset>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-3 col-12 form-group" id='divTabeladePreco'>
                                        <label data-error="wrong" data-success="right" for="txtTabPreco">Tabela de Preço: * </label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control " id="txtTabPreco" name="txtTabPreco" class="form-control" placeholder="Tabela de Preço">
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnTabPreco" name="btnTabPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnlimparTabPreco" name="btnlimparTabPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-3 col-12 form-group" id='divCodigo'>
                                        <label data-error="wrong" data-success="right" for="txtCodigo">Código: </label>
                                        <div class="input-group">
                                            <select class="js-example-programmatic js-states form-control" id="txtCodigo" name="txtCodigo" multiple="multiple"> </select>
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnCodigo" name="btnCodigo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnlimparCodigo" name="btnlimparCodigo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-3 col-12 form-group" id='divCor'>
                                        <label data-error="wrong" data-success="right" id="lblCor" for="txtCor">Cor: </label>
                                        <div class="input-group">
                                            <select class="js-example-programmatic js-states form-control" id="txtCor" name="txtCor" multiple="multiple" placeholder="Cor"> </select>
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnCor" name="btnCor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnlimparCor" name="btnlimparCor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-3 col-12 form-group" id='divTamanho'>
                                        <label data-error="wrong" data-success="right" id="lblTamanho" for="txtTamanho">Tamanho: </label>
                                        <div class="input-group">
                                            <select class="js-example-programmatic js-states form-control" id="txtTamanho" name="txtTamanho" multiple="multiple" placeholder="Tamanho"> </select>
                                            <div class="input-group-append">
                                                <button class="btn bg-danger" id="btnTamanho" name="btnTamanho" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btnlimparTamanho" name="btnlimparTamanho" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12 mb-2">
                                        <div class="d-flex justify-content-end">
                                            <button id="btnConsultar" class="btn-sisp btn btn-primary"><i class="fas fa-search"></i> Consultar</button>
                                            <button id="btnLimpar" class="btn-sisp btn btn-danger marginBtnH"><i class="fas fa-trash"></i> Limpar</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="card-body d-none" id="tabAlteraPreco">
                            <div class="flex">
                                <div class="col-10-7">
                                    <div class="row pt-2">
                                        <div class="col-sm-12 table-responsive p-0">
                                            <table id="tabelaAlteraPreco" class="jus table table-sm table-sm-sisp table-select table-hover" width="100%" style="white-space: nowrap;">
                                                <thead>
                                                </thead>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-1-3 ml-2">
                                    <div class="col-sm-12 col-12 form-group" id='divTodos'>
                                        <label data-error="wrong" data-success="right" for="txtTabPreco">Alterar Preço de Todos</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control" id="txtAlteraTodosPrecos" name="txtAlteraTodosPrecos" class="form-control" placeholder="Alterar Preço de Todos">
                                        </div>
                                    </div>
                                    <div class="col-sm-12 col-12 form-group" id='divPercDesconto'>
                                        <label data-error="wrong" data-success="right" for="txtTabPreco">Perc. Desconto</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control " id="txtPercentualDesconto" name="txtPercentualDesconto" class="form-control" placeholder="Perc. Desconto">
                                        </div>
                                    </div>
                                    <div class="col-sm-12 col-12 form-group" id='divValDesconto'>
                                        <label data-error="wrong" data-success="right" for="txtTabPreco">Valor de Desconto</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control " id="txtValorDesconto" name="txtValorDesconto" class="form-control" placeholder="Valor de Desconto">
                                        </div>
                                    </div>
                                    <div class="col-sm-12 col-12 form-group" id='divPercAcrescimo'>
                                        <label data-error="wrong" data-success="right" for="txtTabPreco">Perc. Acréscimo</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control " id="txtPercentualAcrescimo" name="txtPercentualAcrescimo" class="form-control" placeholder="Perc. Acréscimo">
                                        </div>
                                    </div>
                                    <div class="col-sm-12 col-12 form-group" id='divValAcrescimo'>
                                        <label data-error="wrong" data-success="right" for="txtTabPreco">Valor de Acréscimo</label>
                                        <div class="input-group">
                                            <input type="text" class="input-default focus form-control " id="txtValorAcrescimo" name="txtValorAcrescimo" class="form-control" placeholder="Valor de Acréscimo">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row d-flex justify-content-end mt-3">
                                <button id="btnGravar" class="btn-sisp btnVerde btn"><span class="fas fa-save"></span> Gravar</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>

    <?php
    include_once('../../modais.php');
    ?>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
    </aside>
    <!-- /.control-sidebar -->
    </div>
    <!-- ./wrapper -->

    <!-- jQuery -->
    <script src="plugins/jquery/jquery.min.js?versao=3.258.7.1"></script>
    <script src="dist/js/jquery.maskMoney.min.js?versao=3.258.7.1"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.258.7.1"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
        if ($('[type="date"]').prop('type') != 'date') {
            $('[type="date"]').datepicker();
        }
        $.widget.bridge('uibutton', $.ui.button)
    </script>

    <!-- Bootstrap 4 -->
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.258.7.1"></script>
    <script src="dist/js/sisplan.js?versao=3.258.7.1"></script>
    <script type="text/javascript" src="utils/funcoes.js?versao=3.258.7.1"></script>
    <script src="dist/js/adminlte.min.js?versao=3.258.7.1"></script>
    <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.258.7.1"></script>
    <script type="text/javascript" src="dist/js/loadingoverlay.min.js?versao=3.258.7.1"></script>
    <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.258.7.1"></script>
    <script src="dist/js/dataTables.keyTable.js?versao=3.258.7.1"></script>
    <script src="dist/js/requisicoes.js?versao=3.258.7.1"></script>
    <script src="utils/cookies.js?versao=3.258.7.1"></script>
    <!-- SweetAlert2 -->
    <script src="plugins/sweetalert2/sweetalert2.min.js?versao=3.258.7.1"></script>
    <script src="plugins/toastr/toastr.min.js?versao=3.258.7.1"></script>
    <script src="dist/js/driver.min.js?versao=3.258.7.1"></script>
    <script type="text/javascript" src="dist/js/sum().js?versao=3.258.7.1"></script>
    <script type="text/javascript" src="config.js?versao=3.258.7.1"></script>
    <script src="plugins/select2/js/select2.full.min.js?versao=3.258.7.1"></script>
    <script src="dist/js/datetime.js?versao=3.258.7.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;

            sArquivo = `${BASE_URI}/pages/altera_preco/altera_preco.js?versao=3.258.7.1`;
            insereJavaScriptPagina(sArquivo);
        });
    </script>

</body>

</html>