<!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="./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-compact page-header-light border-bottom bg-white mb-4">
                        <div class="container-xl px-4">
                            <div class="page-header-content">
                                <div class="row align-items-center justify-content-between pt-3">
                                    <div class="col-auto mb-3">
                                        <h1 class="page-header-title">
                                            <div class="page-header-icon"><a href="contratas.php"><i data-feather="corner-up-left"></i></a></div>
                                            ATRÁS
                                        </h1>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </header>
                    
                    <div class="row">
                        <div class="container-xl px-4 mt-4">
                            
                            <nav class="nav nav-borders">
                                <a class="nav-link active ms-0">REGISTRAR CONTRATA</a>
                            </nav>
                            <hr class="mt-0 mb-4" />
                            <div class="row">
                                
                                <div class="col-xl-12">
                                    
                                    <div class="card mb-4">
                                        <div class="card-header">REGISTRAR CONTRATA</div>
                                        <div class="card-body">
                                            <form method="post" action="registrar_contrata.php" enctype="multipart/form-data">

                                                <div class="row gx-3 mb-3">
                                                    
                                                    <div class="col-md-12">
                                                        <label class="small mb-1" for="ruc">RUT</label>
                                                        <input  required onkeydown="return (event.keyCode !== 32);" type="text" class="form-control" id="ruc_empresa" name="ruc_empresa" placeholder="RUC" value="<?=$ruc?>">
                                                        
                                                    </div>

                                                </div>

                                                <div class="row gx-3 mb-3">
                                                    
                                                    <div class="col-md-12">
                                                        <label class="small mb-1" for="razon_social_empresa">RAZÓN SOCIAL</label>
                                                        <input required oninput="validarEspacios(this)" type="text" class="form-control" id="razon_social_empresa" name="razon_social_empresa" placeholder="RAZÓN SOCIAL" value="">
                                                    </div>

                                                </div>


                                                <input class="btn btn-primary" type="submit" name="REGISTRAR" id="REGISTRAR" value="REGISTRAR">

                                                
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </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 type="text/javascript">
            function validarEspacios(input) {
                // Obtener el valor actual del campo
                let valor = input.value;

                // Eliminar espacios dobles por un solo espacio mientras se escribe
                valor = valor.replace(/\s{2,}/g, ' ');

                // Verificar si el primer carácter es un espacio
                if (/^\s/.test(valor)) {
                    // Si es un espacio, eliminarlo
                    valor = valor.replace(/^\s+/, '');
                }

                // Actualizar el valor del campo con los cambios
                input.value = valor;
            }
        </script>

        <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>
    </body>
</html>
