<?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['registro']==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> Plan
                                            </a>
                                        </li>
                                    </ol>
                                </nav>
                            </div>
                          
                            <div class="col-sm-12" style="margin-top: 20px;">
                                <form class="form" method="post"  id="frmForm" autocomplete="off">
                                    <div class="card">
                                        <div class="card-header">
                                            <h3 class="card-title" id="idtitle" >
                                                <i class="fas fa-plus"></i> <!-- Icono para agregar -->
                                                Registro Plan<!-- Título del formulario -->
                                            </h3>
                                        </div>
                                        <div class="card-body" style="display: block;">
                                            <div class="container-fluid">
                                                <input type="hidden" name="idplan" id="idplan">
                                                 <input type="hidden" id="idtorre" name="idtorre">
                                                <div class="row">
                                                    <!-- Primera columna -->
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label for="nombre_plan">Nombre Plan:</label>
                                                            <input type="text" class="form-control" name="nombre_plan" id="nombre_plan"  placeholder="Nombre Plan" required>
                                                        </div>
                                                    </div>
                                                    <!-- Segunda columna -->
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label >Nombre Tecnologia:</label>
                                                            <select  name="idtecnologia" id="idtecnologia" class="form-control select2"  data-live-search="true" data-style="btn-default" required>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label >Nombre Olt:</label>
                                                            <select  name="idolt" id="idolt" class="form-control select2"   data-live-search="true" data-style="btn-default" >
                                                            <option value="0">Seleccione</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label for="precio" >Precio:</label>
                                                            <input type="number" class="form-control" name="precio" id="precio"  placeholder="Nombre Precio" required>
                                                        </div>
                                                    </div>

                                                </div>  
                                                <div class="row">
                                                    <!-- Primera columna -->
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label for="upload_servicio" >Upload Servicio:</label>
                                                            <input type="text" class="form-control" name="upload_servicio" id="upload_servicio"  placeholder="Upload Servicio" required>
                                                        </div>
                                                    </div>
                                                    <!-- Segunda columna -->
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label for="download_servicio" >Download Servicio:</label>
                                                            <input type="text" class="form-control" name="download_servicio" id="download_servicio"  placeholder="Download Servicio" required>
                                                        </div>
                                                    </div>
                                                    <div class="col-sm-3">
                                                        <div class="form-group">
                                                            <label for="descripcion" >Descripcion:</label>
                                                            <p><textarea class="form-control" name="descripcion" cols="70" rows="2" id="descripcion"></textarea></p>
                                                        </div>
                                                    </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>
                                </form>
                            </div>
                        </div>
                    </div>
                </section>                
            </div>


               
<?php
}
require '../footer.php';
?>
<script type="text/javascript" src="../../scripts/plan.js"></script>
<?php 
}
ob_end_flush();
?>