<?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> Contratos
                                            </a>
                                        </li>
                                    </ol>
                                </nav>
                            </div>
                          
                            <div class="col-sm-12" style="margin-top: 20px;">
                                <div class="card  ">
                                    <div class="card-header bg-primary">
                                        <h3 class="card-title">
                                            <i class="fas fa-search"></i>
                                            Listado de Contratos
                                        </h3>
                                    </div>
                                    <div class="card-body" style="display: block;">
                                        <div class="container-fluid">
                                            <br>
                                            <table style="width:100%;" class="table table-bordered" id="producto">
                                                <thead>
                                                <tr>
                                                <th></th>
                                                <th width="7%">Fecha</th>
                                                <th>Cliente</th>
                                                <th>DNI/RUC</th>                            
                                                <th>Nro Contrato</th>
                                                <th>Servicio</th>
                                                <th>Plan</th>
                                                <th>Equipo</th>
                                                <th>Estado Contrato</th>
                                                <th>Estado Linea</th>
                                                <th>Opciones</th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="card-footer">
                                        <!-- Footer buttons -->
                                        <a href="create.php" class="btn btn-primary btn-flat">
                                            <i class="fas fa-plus"></i> Nuevo Registro
                                        </a>
                                        <a href="list.php" class="btn btn-success btn-flat">
                                            <i class="fas fa-sync-alt"></i> Actualizar
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>                
            </div>

            <div class="modal fade" id="modalDetalleContrato" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
                <div class="modal-dialog modal-lg" role="document">
                    <div class="modal-content">
                        <div class="modal-header bg-danger">
                            <h5 class="modal-title" id="modalLabel">Detalle Contrato</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Cerrar">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <form id="">
                            <div class="modal-body">
                                <div class="row">
                                <div class="col-12 col-sm-12 col-md-12">
                                        <div class="form-group">
                                            <label >Nombre Cliente:</label>
                                            <input class="form-control" name="cliente" id="cliente" readonly>                                        
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-6 col-md-6">
                                        <div class="form-group">
                                            <label >Nro Contrato:</label>
                                            <input class="form-control" name="nrocontrato" id="nrocontrato" readonly>                                        
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-6 col-md-6">
                                        <div class="form-group">
                                            <label >Situacion Linea:</label>
                                            <input class="form-control" name="sit_contrato" id="sit_contrato" readonly>                                        
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-6 col-md-6">
                                        <div class="form-group">
                                            <label >Plan:</label>
                                            <input class="form-control" name="nombre" id="nombre" readonly>                                        
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-6 col-md-6">
                                        <div class="form-group">
                                            <label >Mensualidad:</label>
                                            <input class="form-control" name="mensualidad" id="mensualidad" readonly>                                        
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-12 col-md-12">
                                        <div class="form-group">
                                            <label >Direccion:</label>
                                            <input class="form-control" name="direccion" id="direccion" readonly>                                        
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-12 col-md-12">
                                        <div class="form-group">
                                            <label >Referencia:</label>
                                            <input class="form-control" name="referencia" id="referencia" readonly>                                        
                                        </div>
                                    </div>
                                </div>
                            </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-dark btn-flat" data-dismiss="modal" id="btnGuardar"> <i class="fas fa-times"></i> Cerrar</button>
                                </div>
                               
                            </div>
                        </form>
                    </div>
                </div>
            </div>


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