<?php include_once('../../config.php') ?>
<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
?>


<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Sisplan Web | Cancelamento Venda Pendente</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">
	<!-- Ionicons -->
	<!-- Ionicons -->
	<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
	<!-- Theme style -->
	<link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.2512.9.1">
	<!-- overlayScrollbars -->
	<link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css?versao=3.2512.9.1">
	<!-- Daterange picker -->
	<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>

	<link rel="stylesheet" href="dist/css/custom.css?versao=3.2512.9.1">

	<link rel="shortcut icon" href="<?php echo BASE_URI; ?>/favicon.ico">
	<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" />
	<!-- iCheck for checkboxes and radio inputs -->
	<link rel="shortcut icon" href="favicon.ico">
	<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/PesquisaVariosSelect2.css?versao=3.2512.9.1">
	<link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.2512.9.1">
	<link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.2512.9.1">
	<link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.2512.9.1">
	<!-- Google Font: Source Sans Pro -->
	<style>
		#btnConsultar {
			margin-top: 30px;
		}
	</style>
	<!-- Toastr -->
	<link rel="stylesheet" href="plugins/toastr/toastr.min.css">

</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">Cancelamento Venda Pendente</h1>
							<button class="btn btn-info btn-sm ml-2" id="tutorial">
								<i class="fas fa-question-circle"></i>
							</button>
						</div>
						<div class="col-sm-6">
 
						</div>
					</div>
				</div>
			</div>

			<section class="content">

				<div class="card">
					<div class="card-body">
						<div class="container-fluid p-12">

							<div class="row card-body" id="abaGeral">

								<div class="col-sm-3  col-3 form-group">
									<label data-error="wrong" class="labelGeral" data-success="right" for="dtEmissaoDe">Emissão De/Até</label>
									<div class="input-group">
										<input type="date" max="2500-12-31" class="input-default focus form-control validate" value="1200-01-01" id="dtEmissaoDe" name="dtEmissaoDe">
										<input type="date" max="2500-12-31" class="input-default focus form-control validate" value="2500-12-31" id="dtEmissaoAte" name="dtEmissaoAte">
									</div>
								</div>

								<div class="col-lg-9 form-group">
									<label data-error="wrong" class="labelGeral" data-success="right" for="txtVenda">Venda</label>
									<div class="input-group">
										<input type="text" placeholder="Venda" class="input-default col-lg-3 col-6 focus form-control" class="form-control" id="txtVenda" name="txtVenda">
										<button class="btn bg-danger" id="btnVenda" name="btnVenda" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
										<button class="btn bg-danger" id="btnAdicionaVenda" name="bntAdicionaVenda" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-plus"></i></button>
										<button class="btn bg-danger" id="btnLimpaVenda" name="btnLimpaVenda" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
										<input type="text" disabled class="form-group col-lg-12 col-6 input-default focus form-control" id="listaVendas" placeholder="Lista de Vendas"></input>
									</div>
								</div>
							</div>
							<div class="col-sm-12 d-flex justify-content-end"  style="margin-left:-8px;">
								<button id="btnConsultar" class="btn btn-success">Consultar</button>
							</div>
						</div>


						<div class="row">
							<div class="col-sm-12 icheck-primary d-inline pb-2 ml-2" style="margin-right: 15px;">
								<input class="form-check-input" type="checkbox" id="check_todos" value="option1">
								<label class="form-check-label" for="check_todos">Selecionar Todos</label>
							</div>
						</div>

						<div class="row">
							<div class="col-sm-12 table-responsive">
								<table id="tabelaVendas" class="table table-sm table-select table-hover" width="100%">
									<thead>
										<th>SEL</th>
										<th>CODVEN</th>
										<th>CODCLI</th>
										<th>NOME</th>
										<th>VALOR</th>
										<th>DATA</th>
									</thead>
									<tbody>
									</tbody>
								</table>
							</div>
							<div class="col-sm-12 d-flex justify-content-end">
								<button id="btnCancelar" class="btn botoesMenu btn-danger btn-sisp" style="height:2.5rem; margin-top:27px;">Confirmar</button>
								<!-- <div class="btn-group flex-wrap btn-group-justified btn-group-sm" role="group" aria-label="Basic example">
									<div class="ml-2">
									<label data-error="wrong" class="labelGeral" data-success="right" for="txtTotalQuantRestante">
										Quant. Restante</label>
										<input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtTotalQuantRestante" name="txtTotalQuantRestante">
									</div>
									<div class="ml-2">
										<label data-error="wrong" class="labelGeral" data-success="right" for="txtTotalQuantSelec">
											Quant.
											Selecionada</label>
											<input style="max-width: 130px;" readonly type="text" class="input-default focus form-control validate" value='0' id="txtTotalQuantSelec" name="txtTotalQuantSelec">
										</div>
									</div> -->
							</div>
						</div>

					</div>
				</div>
		</div>
		</section>
		<!-- /.content -->
	</div>
	<!-- Control Sidebar -->
	<aside class="control-sidebar control-sidebar-dark">
		<!-- Control sidebar content goes here -->
	</aside>
	<!-- /.content-wrapper -->
	<?php
	include_once('../../modais.php');
	?>
	<!-- /.control-sidebar -->
	</div>
	<script src="plugins/jquery/jquery.min.js?versao=3.2512.9.1"></script>
	<script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.2512.9.1"></script>
	<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.2512.9.1"></script>
	<script src="dist/js/adminlte.min.js?versao=3.2512.9.1"></script>
	<script type="text/javascript" src="dist/js/jquery.dataTables.min.js?versao=3.2512.9.1"></script>
	<script type="text/javascript" src="dist/js/loadingoverlay.min.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="dist/js/jquery.maskMoney.min.js?versao=3.2512.9.1"></script>
	<script src="dist/js/dataTables.keyTable.js?versao=3.2512.9.1"></script>
	<script src="utils/cookies.js?versao=3.2512.9.1"></script>
	<script src="dist/js/requisicoes.js?versao=3.2512.9.1"></script>
	<!-- SweetAlert2 -->
	<script type="text/javascript" src="<?php echo BASE_URI; ?>/dist/js/sum().js?versao=3.2512.9.1"></script>
	<script src="plugins/sweetalert2/sweetalert2.min.js?versao=3.2512.9.1"></script>
	<script src="plugins/moment/moment.min.js?versao=3.2512.9.1"></script>
	<script src="plugins/toastr/toastr.min.js?versao=3.2512.9.1"></script>
	<script src="dist/js/driver.min.js?versao=3.2512.9.1"></script>
	<script type="text/javascript" src="config.js?versao=3.2512.9.1"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.3/jquery.scrollTo.min.js"></script>
	<script type="text/javascript" src="plugins/select2/js/select2.full.min.js?versao=3.2512.9.1"></script>
  	<script src="utils/funcoes.js?versao=3.2512.9.1"></script>
  	<script src="dist/js/sisplan.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('CANCELAMENTO_VENDA');
			if (!temAcesso.resultado) {
				toastrAcesso(temAcesso, BASE_URI);
				return;
			}

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

		});
	</script>
</body>

</html>