<?php
session_start();
$nom = $_SESSION['nom_admin'];
?>
<html>
    <head>
        
        <title>Productos</title>
        <link type="text/css" rel="stylesheet" href="./css/bootstrap.min.css"  media="screen,projection"/>
        <link rel="stylesheet" type="text/css" href="./css/prueba.css">

        <script src="./js/jquery.min.js"></script>
        <script src="./js/jquery.js"></script>
        <script type="text/javascript" src="./js/script.js"></script>
        <?php
            require ("./Funciones/funciones.php");
            $conexion = conecta();

            $sql= "SELECT * FROM Insumos where Activo =1 and eliminado=0";
            $res = mysqli_query($conexion,$sql);
            $num = mysqli_num_rows($res);
        ?>
    </head>
    <body >
        <?php include('menu.php');?>

        <div id="encabezado">
            <div id="fila">
</div>
</div>
                <table border="0">
                        
                        <tr>
                            <td></br></td>
                        </tr>
                        
                
            </table>
                <table border="0" class="table table-striped table-condensed table-hover">

                    <tr>
                            <td colspan="1" class="titulotable" align="center">Insumo</td>
                            <td colspan="3" class="titulotable" align="center">Acciones</td>
                        </tr>
                         <tr>
                            <td colspan="4"></br></td>
                        </tr>
                    <?php
                        for ($i=0;$i<$num; $i++){
                            $nombre = mysql_result($res, $i,"Descripcion");
                            
                            $id = mysql_result($res, $i,"IdInsumo");

                            ?>
                            
                                <tr>
                                    <td align="center" ><?php echo $nombre; ?></td>
                                    <td colspan="1" align="center" style="vertical-align:center;"><a href="insumos_ver.php?id=<?php echo $id; ?>"><button class="boton">Ver</button></a></td>
                                    <td colspan="1" align="center"><a href="insumos_nuevo.php?id=<?php echo $id; ?>"><button class="boton">Editar</button></a></td>
                                    <td colspan="1" align="center"><a href="javascript:void(0);"  onClick="eliminainsumo(<?php echo $id; ?>);" ><button class="boton" id="eliminar" >Eliminar</button></a></td>
                                </tr>
                           
                            <?
                        }
                    ?>
                      </table>    
            </div>
        </div>
        <div id="footer" align="center">
            <p>Cuadropolis</p>
        </div>
    </body>
</html>


