<?php
	session_start();
	if (!isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] != 1) {
        header("location: login.php");
		exit;
        }
		

	/* Connect To Database*/
	require_once ("config/db.php");//Contiene las variables de configuracion para conectar a la base de datos
	require_once ("config/conexion.php");//Contiene funcion que conecta a la base de datos
	
	$active_facturas="";
	$active_productos="";
	$active_clientes="";
	$active_usuarios="active";	
	$title="TIENDAS | FONTUR";
	
	
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<?php include("head.php");?>
</head>
<body onLoad="">
	<?php
	include("navbar.php");
	
	?>
<div class="container" style="width:98%">
	<div class="panel panel-info">
		<div class="panel-heading">
		<div class="btn-group pull-right">
				<button type='button' class="btn btn-info" data-toggle="modal" data-target="#tiendaModal"><span class="glyphicon glyphicon-plus" ></span> Nueva tienda</button>
				
			</div>
				<h4><i class='glyphicon glyphicon-search'></i> Consultar tienda</h4>
		</div>
		<div class="panel-body">
			<?php
			include("modal/registro_tiendas.php");
	include("modal/editar_tiendas.php");
			
			?>
			<form class="form-horizontal" role="form" id="datos" method="post">
				
				<div class="form-group row">
					<div class="table-responsive" align="center">
						<table class="table">
   			       			<tr  class="info">
								<td align="right">Estado</td>
        			    		<td><select class="form-control" id="lugar" onchange='load(1);'>
	 			          			<option value="">---Seleccione una opcion---</option>
						  			<?php 
              						$count_query= mysqli_query($con, "SELECT * FROM `estados`");
		     						while($dato= mysqli_fetch_array($count_query))
									{
			 							$estado=$dato['estado'];
			  						?>
                  						<option value="<?php echo $estado; ?>"><?php echo $estado; ?></option>
                  					<?php 
									} 
						  			?>
                          			</select> 
								</td>
		       					<td align="right">Ingrese tienda a Buscar</td>
        			    		<td>
								<input type="text" class="form-control" id="q" placeholder="" onkeyup='load(1);'>
								</td>
			            	</tr>
                		</table>
            		</div>
				</div>		
			</form>
			<div id="resultados"></div><!-- Carga los datos ajax -->
			<div class='outer_div'></div><!-- Carga los datos ajax -->
			
  		</div>
	</div>
</div>
<hr>
<?php
include("footer.php");
?>
<script type="text/javascript" src="js/tiendas.js"></script>
</body>
</html>