<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
        <meta name="description" content="" />
        <meta name="author" content="" />
        <title>BIO - ALMACÉN</title>
        <link href="https://cdn.jsdelivr.net/npm/simple-datatables@4.0.8/dist/style.css" rel="stylesheet" />
        <link href="https://cdn.jsdelivr.net/npm/litepicker/dist/css/litepicker.css" rel="stylesheet" />
        <link href="./view/css/styles.css" rel="stylesheet" />
        <link rel="icon" type="image/x-icon" href="./view/assets/img/trinity_bio/icono_trinity.png" />
        <script data-search-pseudo-elements defer src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/js/all.min.js" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.28.0/feather.min.js" crossorigin="anonymous"></script>
    </head>
    <body class="nav-fixed">

        <?php require_once("./view/menu.phtml") ?>

        <div id="layoutSidenav">

            <?php require_once("./view/menuv.phtml") ?>
            
            <div id="layoutSidenav_content">
            <main>
                    <header class="page-header page-header-dark bg-gradient-primary-to-secondary pb-10">
                        <div class="container-xl px-4">
                            <div class="page-header-content pt-4">
                                <div class="row align-items-center justify-content-between">
                                    <div class="col-auto mt-4">
                                        <h1 class="page-header-title">
                                            <div class="page-header-icon"><i data-feather="users"></i></div>
                                            SOLICITUDES ALMACEN
                                        </h1>
                                        <div class="page-header-subtitle">SOLICITUDES ALMACEN</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </header>

                    <div class="container-xl px-4 mt-n10">
                        <div class="card mb-4">
                                <div class="card-header">
                                    <div class="row align-items-center justify-content-between pt-3">
                                        <div class="col-auto mb-3">
                                            <h1 class="page-header-title">
                                                SOLICITUDES
                                            </h1>
                                        </div>
                                    </div>
                                </div>
                            
                                <div class="card-body">
                                            
                                    <table id="datatablesSimple">
                                            <thead>
                                                <tr>
                                                    <th>ID</th>
                                                    <th>ALMACEN</th>
                                                    <th>FECHA</th>
                                                    <th>ACCIÓN</th>
                                                    <!-- <th>CONFIGURACIÓN</th> -->
                                                </tr>
                                            </thead>
                                            <tfoot>
                                                <tr>
                                                    <th>ID</th>
                                                    <th>ALMACEN</th>
                                                    <th>ACCIÓN</th>
                                                    <!-- <th>CONFIGURACIÓN</th> -->
                                                </tr>
                                            </tfoot>
                                            <tbody>
                                                <?php
                                                foreach ($solicitudes as $solicitud) {
                                                ?>
                                                    <tr>
                                                        <td><?= $solicitud['id_requerimiento_almacen'] ?></td>
                                                        <td><?= $solicitud['almacen'] . ' - ' . $solicitud['ccosto'] ?></td>
                                                        <td><?= date_format($solicitud['fecha_creacion'], 'Y-m-d H:i') ?></td>
                                                        <td>
                                                            <div class="badge bg-primary rounded-pill" onclick="accesos('<?= $solicitud['id_requerimiento_almacen'] ?>')">GESTIONAR</div>
                                                        </td>
                                                    </tr>
                                                <?php
                                                }
                                                ?>
                                            </tbody>

                                    </table>
                                                
                                </div>
                            
                        </div>

                        
                    </div>
                </main>
                <footer class="footer-admin mt-auto footer-light">
                    <div class="container-xl px-4">
                        <div class="row">
                            <div class="col-md-6 small">Copyright &copy; TRINITY ERP - BIO SAC 2022</div>
                            <div class="col-md-6 text-md-end small">
                                <a href="#!">POLÍTICAS DE PRIVACIDAD</a>
                                &middot;
                                <a href="#!">TERMINOS &amp; CONDICIONES</a>
                            </div>
                        </div>
                    </div>
                </footer>
            </div>
        </div>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
        <script src="./view/js/scripts.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/simple-datatables@4.0.8" crossorigin="anonymous"></script>
        <script src="./view/js/datatables/datatables-simple-demo.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/litepicker/dist/bundle.js" crossorigin="anonymous"></script>
        <script src="./view/js/litepicker.js"></script>
        <script>

            function accesos(id){
                window.location.href="soli_almacen.php?id="+id+"";
            }

        </script>
    </body>
</html>
