<?php 
	if(!isset($_SESSION))
		session_start();
	if (!isset($_SESSION['usuarioLogin']) || $_SESSION['usuarioLogin'] == ""){
		session_unset();
		session_destroy();
		header("Location: login.php");
		exit();
	}
?>
<?php
	require_once('../../Connections/catalogo.php');
	$marcas = $mysqli->query("SELECT * FROM marcaspiezas ORDER BY marca");
	if(!$marcas)
		echo "Error: " . $mysqli->error;	
?> 
<div>
    <h3 style="display:inline-block; margin-top:3%;">Filtro de Marca: </h3>
    <div style="display:inline-block">
        <select name="idMarca" id="idMarca2" class="combo_buscar"  onChange="javascript:RecargarTabla('piezas', getSeleccionCombo(this))">
                <option value='' disabled selected style='display:none;'>Seleccionar Marca</option>
                <?php while ($renglon = $marcas->fetch_object()){ ?>
                <option value="<?php echo $renglon->id ?>" >
                    <?php echo $renglon->marca ?>
                </option>
            <?php } ?>
        </select> 
    </div>
    <a href="javascript:MostrarAltaEditar('piezas','')" style="display:inline-block;float:right;">
    	<img src="imagenes/agregar.png" width="85" height="85" />
    </a>
    <p>&nbsp;</p>
</div>
<section>
    <div style="overflow:auto; margin-left:20px; margin-right:20px;">
        <div class="container2">
            <div id='nocopiar'>
                <div id='div_tabla_piezas'>	
					<?php include "piezas_lista_tabla.php"; ?>
                </div>
            </div>
        </div>
    </div>
</section>