<?php
session_start();
require_once('conexion.php');
if (isset($_SESSION['usu_nombre']))
{
	require_once('include/sesiones.php');   
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<?php include ('head.php'); ?>
</head>
<body>
<?php
	$inicio="active";
	$M_inventario="";
	$M_contactos="";
	$M_compras="";
	$M_ventas="";
	$M_pedidos="";
	$M_pos="";
	$R_reportes="";

	$m_empresa="";
	$m_sucursales="";
	$m_usuarios="";
	$m_configuraciones="";
	include ('menu.php');
?>  
<div class="main">
	<div class="">
		<div class="">
			<div class="col-md-12">
				<div class="col-lg-12 ">
					<div class="note note-warning note-shadow">
						<h4 class="center">Bienvenido(a) al Punto de venta. </h4>
					</div>
				</div>
			
				
					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="V_ventas.php">
							<div class="dashboard-stat green-jungle">
								<div class="visual">
									<i class="fas fa-shopping-cart"></i>
								</div>
								<div class="details">
									<div class="number">VENTAS </div>
									<div class="desc">Total: <strong>
										<?php  
											$ven=mysqli_query($con,"SELECT count(*) as vent  FROM ventas where empresa='$empresa' ") or die(mysqli_error($con)); 
											$ve=mysqli_fetch_array($ven);
											echo number_format($vent=$ve['vent'],0);
										?></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="C_compras.php">
							<div class="dashboard-stat purple-plum">
								<div class="visual">
									<i class="fas fa-shopping-basket"></i>

								</div>
								<div class="details">
									<div class="number">COMPRAS </div>
									<div class="desc">Total: <strong>
										<?php  
											$com=mysqli_query($con,"SELECT count(*) as comp  FROM compras where empresa='$empresa' ") or die(mysqli_error($con)); 
											$co=mysqli_fetch_array($com);
											echo number_format($comp=$co['comp'],0);
										?></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>
					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="V_cotizaciones.php">
							<div class="dashboard-stat red-thunderbird">
								<div class="visual">
									<i class="fas fa-file-pdf"></i>

								</div>
								<div class="details">
									<div class="number">PEDIDOS </div>
									<div class="desc">Total: <strong>
										<?php  
											$pro=mysqli_query($con,"SELECT count(*) as can  FROM cotizacion where empresa='$empresa' ") or die(mysqli_error($con)); 
											$pr=mysqli_fetch_array($pro);
											echo number_format($can=$pr['can'],0);
										?></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="U_clientes.php">
							<div class="dashboard-stat blue">
								<div class="visual">
									<i class="fas fa-users"></i>

								</div>
								<div class="details">
									<div class="number">CLIENTES </div>
									<div class="desc">Total: <strong>
										<?php  
											$cli=mysqli_query($con,"SELECT count(*) as can  FROM cliente where empresa='$empresa' ") or die(mysqli_error($con)); 
											$cl=mysqli_fetch_array($cli);
											echo number_format($can=$cl['can'],0);
										?></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="U_usuarios.php">
							<div class="dashboard-stat green">
								<div class="visual">
									<i class="fas fa-user-cog"></i>

								</div>
								<div class="details">
									<div class="number">EMPLEADOS </div>
									<div class="desc">Total: <strong>
										<?php  
											$cli=mysqli_query($con,"SELECT count(*) as can  FROM usuario where empresa_emp_id='$empresa' and usu_nombre<>'VENDEDOR GENERAL' and eliminado<>'si'") or die(mysqli_error($con)); 
											$cl=mysqli_fetch_array($cli);
											echo number_format($can=$cl['can'],0);
										?></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="I_articulos.php">
							<div class="dashboard-stat blue-madison">
								<div class="visual">
									<i class="fas fa-cubes"></i>

								</div>
								<div class="details">
									<div class="number">ARTICULOS </div>
									<div class="desc">Total: <strong>
										<?php  
											$cana=mysqli_query($con,"SELECT count(*) as can FROM articulos  where  art_tipo='articulo' and empresa ='$empresa' and art_estado='Activo'") or die(mysqli_error($con)); 
											$ca=mysqli_fetch_array($cana);
											echo number_format($can=$ca['can'],0); 
										?></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="I_combos.php">
							<div class="dashboard-stat red-flamingo">
								<div class="visual">
									<i class="fas fa-gifts"></i>

								</div>
								<div class="details">
									<div class="number">COMBOS </div>
									<div class="desc">Total: <strong>
										<?php  
											$coms=mysqli_query($con,"SELECT count(*) as comb  FROM combos where empresa='$empresa' ") or die(mysqli_error($con)); 
											$cm=mysqli_fetch_array($coms);
											echo number_format($comb=$cm['comb'],0);
										?></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>


					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="U_proveedores.php">
							<div class="dashboard-stat yellow-gold">
								<div class="visual">
									<i class="fas fa-people-carry"></i>

								</div>
								<div class="details">
									<div class="number">PROVEEDORES </div>
									<div class="desc">Total: <strong>
										<?php  
											$pro=mysqli_query($con,"SELECT count(*) as can  FROM proveedor where empresa='$empresa' ") or die(mysqli_error($con)); 
											$pr=mysqli_fetch_array($pro);
											echo number_format($can=$pr['can'],0);
										?></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="I_tarifas.php">
							<div class="dashboard-stat yellow-casablanca">
								<div class="visual">
									<i class="fas fa-money-bill-alt"></i>

								</div>
								<div class="details">
									<div class="number">TARIFAS </div>
									<div class="desc"> <strong></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="R_reportes.php">
							<div class="dashboard-stat yellow">
								<div class="visual">
									<i class="fas fa-chart-line"></i>

								</div>
								<div class="details">
									<div class="number">REPORTES </div>
									<div class="desc"> <strong></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="V_cartera.php">
							<div class="dashboard-stat purple">
								<div class="visual">
									<i class="fas fa-business-time"></i>

								</div>
								<div class="details">
									<div class="number">CARTERA </div>
									<div class="desc"> <strong></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>

					<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
						<a href="A_configuraciones.php">
							<div class="dashboard-stat red-soft">
								<div class="visual">
									<i class="fas fa-cogs"></i>

								</div>
								<div class="details">
									<div class="number">AJUSTES </div>
									<div class="desc"> <strong></strong> 
									</div>
								</div>
								<div class="more">Más información <i class="m-icon-swapright m-icon-white"></i></div>
							</div>
						</a>
					</div>
			
		</div> <!-- /row -->
	</div> <!-- /container -->
</div> <!-- /main -->
</br>
<?php
	include ('php_caja/caja_abrir.php');
	include ('script.php');
?>
	</body>
</html>
<?php
}
else
{
	echo '<script>location.href = "index.php";</script>';
}
?>