<?php
ob_start();
ini_set('session.gc_maxlifetime', 14400);
session_set_cookie_params(14400);
session_start();

if (!isset($_SESSION["nombre"]))
{
    header("Location: ../../login/login.php");
}
else
{
    require '../header.php';

if($_SESSION['contratos']==1){

?>
            <div class="content-wrapper">
                <!-- Breadcrumb Section -->
                <section class="content-header">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-sm-12">
                                <nav aria-label="breadcrumb">
                                    <ol class="breadcrumb">
                                        <li class="breadcrumb-item">
                                            <a href="#"><i class="fas fa-home"></i> Panel</a>
                                        </li>
                                        <li class="breadcrumb-item active" aria-current="page">
                                            <a href="list.php">
                                                <i class="module-icon"></i> Fibra Optica
                                            </a>
                                        </li>
                                    </ol>
                                </nav>
                            </div>
                          
                            <div class="col-md-12" style="margin-top: 20px;">
                                <form class="form" method="post"  id="frmForm_fibra" autocomplete="off">
                                    <div class="card">
                                        <div class="card-header">
                                            <h3 class="card-title" id="idtitle" >
                                                <i class="fas fa-plus"></i> <!-- Icono para agregar -->
                                                Datos Fibra Optica<!-- Título del formulario -->
                                            </h3>
                                        </div>
                                    <br>
                                    <div class="panel-body" id="formularioregistros">
                                        <div id="page" class="container" style="border:solid">
                                            <div class="row justify-content-center">
                                                <div class="col-md-8">
                                                    <!-- Formulario centrado -->
                                                     <br>
                                                    <div class="form-group row">
                                                        <label for="idcontrato" class="col-md-4 col-form-label text-right">Id Contrato(*)</label>
                                                        <div class="col-md-6">
                                                            <input type="text" class="form-control" id="idcontrato" name="idcontrato" readonly>
                                                        </div>
                                                    </div>
                                                    <div class="form-group row">
                                                        <label for="idtorre" class="col-md-4 col-form-label text-right">Torre(*)</label>
                                                        <div class="col-md-6">
                                                            <select id="idtorre" name="idtorre" class="form-control select2" data-live-search="true" required>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="form-group row">
                                                        <label for="idolt" class="col-md-4 col-form-label text-right">OLT(*)</label>
                                                        <div class="col-md-6">
                                                            <select id="idolt" name="idolt" class="form-control select2" data-live-search="true"></select>
                                                        </div>
                                                    </div>
                                                    <div class="form-group row">
                                                        <label for="sit_linea" class="col-md-4 col-form-label text-right">Situación(*)</label>
                                                        <div class="col-md-6">
                                                        <input type="text" class="form-control" id="sit_linea" name="sit_linea" onclick="cambiarEstado()" readonly>
                                                        </div>
                                                    </div>
                                                    <div class="form-group row">
                                                        <label for="usuario_cliente" class="col-md-4 col-form-label text-right">Usuario(*)</label>
                                                        <div class="col-md-6">
                                                            <input type="text" class="form-control" id="usuario_cliente" name="usuario_cliente" >
                                                        </div>
                                                    </div>
                                                    <div class="form-group row">
                                                        <label for="password" class="col-md-4 col-form-label text-right">Contraseña(*)</label>
                                                        <div class="col-md-6">
                                                            <input type="text" class="form-control" id="password" name="password" >
                                                        </div>
                                                    </div>
                                                    <div class="form-group row">
                                                        <label for="idplan" class="col-md-4 col-form-label text-right">Plan(*)</label>
                                                        <div class="col-md-6">
                                                            <select id="idplan" name="idplan" class="form-control select2" data-live-search="true"></select>
                                                            <input type="hidden" id="upload_servicio" name="upload_servicio">
                                                            <input type="hidden" id="download_servicio" name="download_servicio">
                                                        </div>
                                                    </div>
                                                    <div class="form-group row">
                                                        <label for="cliente_nombre" class="col-md-4 col-form-label text-right">Nombre del Cliente(*)</label>
                                                        <div class="col-md-6">
                                                            <input type="text" class="form-control" id="cliente_nombre" name="cliente_nombre" readonly>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="card-footer">
                                            <!-- Botones de acción -->
                                                <button type="submit" id="btnGuardar" class="btn btn-primary btn-flat">
                                                    <i class="fas fa-save"></i> Guardar registro
                                                </button>
                                                <a href="list.php" class="btn btn-danger btn-flat">
                                                    <i class="fas fa-times"></i> Cancelar
                                                </a>
                                             </div>
                                         </div>
                                         <br>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </section>                
            </div>
               
<?php
}
require '../footer.php';
?>
<script type="text/javascript" src="../../scripts/contrato_fibra.js"></script>

<?php 
}
ob_end_flush();
?>