<?php 
session_start();
		include_once('php_conexion.php'); 
		include_once('Class/funciones.php'); 
		include_once('Class/class_pacientes.php');
		if($_SESSION['tipo_usu']=='a' or $_SESSION['tipo_usu']=='e'){
		}else{
			header('location:error.php');
		}
 ?>
<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Control de Pacientes</title>
	<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
  	<script src="js/jquery.min.js"></script>
  	<script src="bootstrap/js/bootstrap.min.js"></script>
  	<script src="js/webcam.min.js"></script>
  	<link rel="stylesheet" type="text/css" href="css/labo.css">
  	<link href="css/ionicons.css" rel="stylesheet" type="text/css">
  	<link rel="stylesheet" type="text/css" href="css/jquery-ui.min.css">
  	<script type="text/javascript" src="js/jquery-ui.min.js"></script>
  	<script language="JavaScript">
  		function reportecaja(fechaini,fechafin) {
		    if (fechaini == "") {
		        document.getElementById("reporte").innerHTML = "";
		        return;
		    } else { 
		        if (window.XMLHttpRequest) {
		            // code for IE7+, Firefox, Chrome, Opera, Safari
		            xmlhttp = new XMLHttpRequest();
		        } else {
		            // code for IE6, IE5
		            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		        }
		        xmlhttp.onreadystatechange = function() {
		            if (this.readyState == 4 && this.status == 200) {
		                document.getElementById("reporte").innerHTML = this.responseText;
		            }
		        };
		        xmlhttp.open("GET","instancias/reporte.php?fechaini="+fechaini+"&fechafin="+fechafin,true);
		        xmlhttp.send();
		    }
		}
  	</script>
</head>
<body>
	<div class="container-fluid">
		<div class="row justify-content-around">
			<div class="col-sm-12">
				<div class="card border-primary">
					<h5 class="card-header">REPORTE CAJA</h5>
					<div class="card-body">
						<div class="row justify-content-between">
							<div class="col-md-6">
								<form action="">
								  <div class="form-group">
								    <div class="input-group input-group-sm mb-3">
										<div class="input-group-prepend">
										<label class="input-group-text" for="inputGroupSelect01">Fecha inicio: </label>
										</div>
										<input type="date" name="fechaini" class="form-control form-control-sm" id="fechaini">
										<div class="input-group-prepend">
										<label class="input-group-text" for="inputGroupSelect01">Fecha fin: </label>
										</div>
										<input type="date" name="fechafin" class="form-control form-control-sm" id="fechafin">
										<div class="input-group-append">
									    <button class="btn btn-outline-secondary btn-sm" type="submit" onclick="reportecaja($('#fechaini').val(),$('#fechafin').val());return false;"><span class='ion-android-search'></span> Buscar</button>
									  </div>
									</div>
								  </div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<hr class="my-2">
		<div class="row">
			<div class="col-md-12" id="reporte">
				
			</div>
		</div>
	</div>
</body>
</html>