<link rel=icon href='img/logonino.jpeg' sizes="32x32" type="image/jpeg">
<?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="PRODUCTOS FINALES | ".NOMBRE_EMPRESA;
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<?php include("head.php");?>
</head>
<body>
	<?php
	include("navbar.php");
	?>
    
<div class="container" style="width:98%">
	<div class="panel panel-info">
		<div class="panel-heading">
		    <?php if($_SESSION['rol']=="gerencia"){ ?>
		    <div class="btn-group pull-right">
				<button type='button' class="btn btn-info" data-toggle="modal" data-target="#productoFinalModal"><span class="glyphicon glyphicon-plus" ></span> Nuevo Producto Final</button>
			</div>
			<?php } ?>
			<h4><i class='glyphicon glyphicon-search'></i> Consultar Productos Finales</h4>
		</div>
		<div class="panel-body">
		
			<?php
			include("modal/registro_productos_finales.php");
			include("modal/editar_productos_finales.php");
			include("modal/composicion_productos_finales.php");
			?>
			
			<form class="form-horizontal" id="datos_cotizacion">
    <div class="form-group row">
        <div class="table-responsive" align="center">
            <table class="table">
                <tr class="info">
                    <td align="right"><strong>Tipo</strong></td>
                    <td align="left" class="col-md-4">
                        <select class="form-control" id="f_tipo">
                            <option value="">Todos los tipos</option>
                            <?php 
                            $query_rubros = mysqli_query($con, "SELECT * FROM rubros ORDER BY rubro");
                            while($row_rubro = mysqli_fetch_array($query_rubros)){
                                echo "<option value='".$row_rubro['rubro']."'>".$row_rubro['rubro']."</option>";
                            }
                            ?>
                        </select>
                    </td>
                    <td align="right"><strong>Descripción</strong></td>
                    <td align="left" class="col-md-4">
                        <input type="text" class="form-control" id="f_descripcion" placeholder="Buscar...">
                    </td>
                </tr>
            </table>
        </div>
    </div>      
</form>
            
            <div id="loader" style="text-align: center;"></div>
            
            <div class='outer_div'></div> 
			
		</div>
	</div>
</div>
<hr>

</div>
<hr>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/productos_finales.js"></script>
</body>
</html>