File "FOR-S-CCI-22.php"

Full Path: C:/wamp64/www/CALIDADWEB/CALIDADWEB/FRONTED/HTML/FOR-S-CCI-22.php
File size: 18.58 KB
MIME-type: text/x-php
Charset: utf-8

<?php
require_once "../../BACKEND/conexiones/conexion.php";
if (session_status() !== PHP_SESSION_ACTIVE) {
    session_start();
}

$iduser = isset($_SESSION["iduser"]) ? htmlspecialchars($_SESSION["iduser"]) : 'No Ingresado';
// ⬇️⬇️⬇️ SISTEMA DE PERMISOS - AGREGAR ESTAS LÍNEAS ⬇️⬇️⬇️
$usuario_actual = isset($_SESSION['usuario']) ? $_SESSION['usuario'] : null;
$usuarios_admin = array('12345','63546660');
$es_admin = in_array($usuario_actual, $usuarios_admin);
// ⬆️⬆️⬆️ FIN SISTEMA DE PERMISOS ⬆️⬆️⬆️

?>
<!DOCTYPE html>
<html lang="es">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CALIDADWEB - FOR-S-CCI-22</title>
    <link rel="shortcut icon" href="../CSS/style_main.css">
    <link rel="shortcut icon" href="../img/avic.jpeg">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <link href='https://unpkg.com/boxicons@2.1.2/css/boxicons.min.css' rel='stylesheet'>
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js" integrity="sha512-2ImtlRlf2VVmiGZsjm9bEyhjGW4dU7B6TNwh/hx/iSByxNENtj3WVE6o/9Lj4TJeVXPi4bnOIMXFIJJAeufa0A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
         <script>
            const esUsuarioAdmin = <?php echo ($es_admin === true) ? 'true' : 'false'; ?>;
            const usuarioActualNombre = "<?php echo htmlspecialchars($usuario_actual); ?>";
        </script>

    <style>
        body {
            background: linear-gradient(135deg, #ffcf4d 0%, #f8ae26 100%);
            min-height: 100vh;
            /* Para que el fondo cubra toda la pantalla */
        }

        .card-header-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-bottom: 0.5rem !important;
        }

        .reloj-container {
            border: 2px solid white;
            border-radius: 10px;
            padding: 10px;
            text-align: left;
        }

        .user-info {
            /* Estilo tomado de tu modal, asegurando la consistencia visual */
            font-size: 0.9rem;
            text-shadow: 1px 1px 5px black;
            text-decoration: underline;
        }

        #tblPesoFrisby td:nth-child(13),
        #tblPesoFrisby td:nth-child(17),
        #tblPesoFrisby td:nth-child(21),
        #tblPesoFrisby td:nth-child(25),
        #tblPesoFrisby th:nth-child(13),
        #tblPesoFrisby th:nth-child(17),
        #tblPesoFrisby th:nth-child(21),
        #tblPesoFrisby th:nth-child(25) {
            width: 410px;
            height: 100px;
            overflow: hidden;
            word-wrap: break-word;
            white-space: normal;
        }

        #tblPesoFrisby td:nth-child(13),
        #tblPesoFrisby td:nth-child(17),
        #tblPesoFrisby td:nth-child(21),
        #tblPesoFrisby td:nth-child(25) {
            max-height: 100px;
            overflow-y: auto;
            display: inline-block;
        }

        .nav-tabs .nav-link.active {
            background-color: rgb(255 138 55) !important;
            /* naranja */
            color: white !important;
        }

        .nav-tabs .nav-link {
            background-color: #f0f0f0;
            /* inactiva */
            color: black;
        }
    </style>
    <script>
            $(document).ready(function() {
          $('#controlpeso').select2({
              width: '100%',
              placeholder: 'SELECCIONAR PRODUCTO',
              allowClear: true
          });
      });
    </script>
</head>

<body>

    <?php if (!empty($_SESSION['mensaje'])): ?>
        <script>
            window.swalData = {
                title: <?= json_encode($_SESSION['tipo'] === 'success' ? 'Éxito' : 'Atención') ?>,
                text: <?= json_encode($_SESSION['mensaje']) ?>,
                icon: <?= json_encode($_SESSION['tipo']) ?>
            };
        </script>
    <?php
        unset($_SESSION['mensaje'], $_SESSION['tipo'], $_SESSION['icon']);
    endif;
    ?>

    <div class="container mt-5 mb-5">


        <form id="formcontrolpeso" method="POST" action="../../BACKEND/controller/FOR-S-CCI-22.php">

            <div class="card shadow-lg" style="background-color: rgb(255 138 55); color: white;">
                <div class="card-header border-bottom border-white">
                    <h5 class="text-center mt-2 mb-0"> FOR-S-CCI-22 CONTROL PESO</h5>
                </div>
                <div class="container">
                    <div class="col-md-12">

                        <div class="card">
                            <div class="card-header">
                                <ul class="nav nav-tabs card-header-tabs" id="bologna-list" role="tablist">
                                    <li class="nav-item">
                                        <a class="nav-link active" id="productoFrisby-tab" data-bs-toggle="tab" href="#productoFrisby" role="tab" aria-controls="productoFrisby" aria-selected="true">FORMATO CONTROL</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" id="controlpesosi-tab" data-bs-toggle="tab" href="#controlpesosi" role="tab" aria-controls="tblapeso" aria-selected="false">CONSULTAR REGISTROS</a>
                                    </li>
                                </ul>
                            </div>
                            <div class="card-body" style="background-color: rgb(255 138 55);">
                                <div class="tab-content mt-3">
                                    <div class="tab-pane active" id="productoFrisby" role="tabpanel">
                        
                                        <div class="row" style="display: flex; text-align:center; font-size:larger; margin-top:40px">
                                           
                                            <div class="row" style="text-align: -webkit-center;">
                                                <legend style="margin-top: 20px;border-bottom: dotted;">DESPRESADO <br></legend><br>
                                                <div class="col-md-6">
                                                <label for="">PRODUCTO</label><br>
                                                <!-- <input type="text" name="cMariDespreProduc" id="cMariDespreProduc" step="0.0001" class="form-control" placeholder="" aria-describedby="helpId"><br> -->
                                                <select class="form-select" name="controlpeso" id="controlpeso">
                                                    <option value="" selected hidden>SELECCIONAR PRODUCTO</option>
                                                    <?php
                                                    $PRO = mysqli_query($conexion, "SELECT * FROM itemss");
                                                    while ($ITEM = mysqli_fetch_row($PRO)) { ?>
                                                    <option value="<?php echo $ITEM[1] .
                                                        " - " .
                                                        $ITEM[2]; ?>"><?php echo $ITEM[1] .
                                                        " - " .
                                                    $ITEM[2]; ?></option>
                                                    <?php }
                                                    ?>
                                                </select>
                                                </div>
                                              
                                            </div>

                                            <div class="col-md-3 mt-4">
                                                <i class='bx bx-barcode-reader'></i>
                                                <label for="">RANGO</label><br>
                                                <input type="text" name="rango" id="rango" class="form-control" style="padding:10px; height:55px">
                                            </div>
                                            <div class="col-md-3 mt-4">
                                                <i class='bx bx-barcode-reader'></i>
                                                <label for="">LOTE</label><br>
                                                <input type="text" name="lote1" id="lote1" class="form-control" style="padding:10px;  height:55px">
                                            </div>
                                            <div class="col-md-6">
                                                <label for="fechaVencimiento" class="form-label">
                                                    <i class='bx bx-calendar'></i> FECHA DE VENCIMIENTO
                                                </label>
                                                <input type="date" name="fechaVencimiento" id="fechaVencimiento" class="form-control form-control-lg" required>
                                            </div>
                                        </div>

                                        <div class="row" style="text-align: -webkit-center; align-items: baseline;justify-content: center; margin-top:40px">
                                            <legend style="border-bottom: dotted"></legend>
                                            <span style='font-size: 20px;'>🐔</span>

                                           
                                            <div class="grid" id="contenedor-inputs"></div>
                                        </div>
                                        <div class="row" style="text-align: -webkit-center; align-items: baseline;justify-content: center">
                                            <div class="row mt-3">
                                                <div class="col text-center mt-5">
                                                    <i class='bx bx-repost'></i>
                                                    <label for class="form-label">PESO PROMEDIO:</label>
                                                    <input type="text" name="promediopeso" id="promediopeso" class="form-control mx-auto text-center fs-4 fw-bold" value="0" readonly>
                                                </div>
                                                <div class="col text-center">
                                                    <span style='font-size: 20px;'>🐔</span>
                                                    <label for="">PESO ALTO</label><br>
                                                    <input type="number" name="pesoalto" id="pesoalto" class="form-control mx-auto text-center fs-4 fw-bold" placeholder="" aria-describedby="helpId"><br>
                                                </div>
                                                <div class="col text-center">
                                                    <span style='font-size: 20px;'>🐔</span>
                                                    <label for="">PESO BAJO</label><br>
                                                    <input type="number" name="pesonocumle" id="pesonocumle" class="form-control mx-auto text-center fs-4 fw-bold" placeholder="" aria-describedby="helpId" readonly><br>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row justify-content-center">
                                            <div class="col-md-6 mb-3">
                                                <i class='bx bx-user-check'></i> 
                                                <label>REALIZO</label><br>
                                                <input type="text" id="nombreProcesopeso1" name="nombreProcesopeso1" class="form-control" style="height: 62px; text-transform:uppercase;" placeholder="Escribe la cédula " required>
                                            </div>

                                            <div class="col-md-6 mb-3">
                                                <i class='bx bx-user-check'></i> 
                                                <label>APROBO</label><br>
                                                <input type="text" id="nombreCalidadpeso2" name="nombreCalidadpeso2" class="form-control" style="height: 62px; text-transform:uppercase;" placeholder="Escribe la cédula " required>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="tab-pane" id="controlpesosi" role="tabpanel" aria-labelledby="controlpesosi-tab">
                                        <div class="container-fluid" style="font-size: small; display:contents">
                                            <button class="btn btn-light btn-sm mb-4 btnPeso" type="button">CARGAR TABLA</button>
                                            <table class="table table-light table-striped table-hover" style="display: block;overflow-x: auto;border-radius: 1em; text-align:center; border: 5px solid transparent;" id="tblapeso">
                                                <thead style="vertical-align: revert;">
                        
                                                    <tr>
                                                        <th scope="col">#</th>
                                                        <th scope="col" style="min-width:100px">Fecha</th>
                                                        <th scope="col">Producto</th>
                                                        <th scope="col">Rango</th>      
                                                        <th scope="col">Lote</th>
                                                        <th scope="col">Fecha Vencimiento</th>
                                                        <th scope="col">Promedio</th>
                                                        <th scope="col">Peso Alto</th>
                                                        <th scope="col">Peso Bajo</th>
                                                        <th scope="col">VALORES PESO</th>
                                                        <th scope="col">Realizo</th>
                                                        <th scope="col">Aprobó</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="card-footer border-top border-white" id="footer1">
                                        <div class="row align-items-center">
                                            <div class="col-md-6 text-start reloj-container">
                                                <span id="tiempo" class="d-block h3 mb-1"> 00 : 00 : 00</span>
                                                <p id="fecha" class="mb-2">Cargando fecha...</p>
                                                <p class="mb-0 user-info">
                                                    <i class='bx bx-user-circle'></i> Usuario: <strong><?php echo $iduser; ?></strong>
                                                </p>
                                            </div>
                                            <div class="col-md-6 mt-3 mt-md-0 d-flex justify-content-md-center">

                                                <div class="d-flex flex-column gap-2 w-100" style="max-width: 350px;">

                                                    <button type="submit" name="formcontrolpeso" id="controlEnviar" class="btn btn-light btn-lg shadow-lg">
                                                        <i class='bx bx-send'></i> ENVIAR REPORTE
                                                    </button>

                                                    <button type="button"
                                                        class="btn btn-light"
                                                        id="cancelarGeneral"
                                                        onclick="window.location.href = '../mainJefe.php';">
                                                        <i class='bx bx-x'></i> CANCELAR
                                                    </button>

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

                        </div>

        </form>


    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.6/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/v/bs5/jszip-2.5.0/dt-1.11.5/datatables.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/v/bs5/jszip-2.5.0/dt-1.11.5/b-2.2.2/b-colvis-2.2.2/b-html5-2.2.2/b-print-2.2.2/r-2.2.9/sb-1.3.2/sp-2.0.0/datatables.min.js"></script>



    <script src="../JS/reloj.js"></script>

    <script src="../CONTROLTABLAS.JS/FOR-S-CCI-22.js?v=<?php echo time(); ?>"></script>
    <script src="../INPUTS/FOR-S-CCI-22.js?v=<?php echo time(); ?>"></script>


<script src="../JS/permisos-global.js"></script>


</body>

</html>






<!----------------------------------------------INICIO CONTROL PESO PRODUCTO ADOBADO FRISBY---------------------------------------------------------------------------------------------------->