<?php 
 require_once('../config/Conexion.php');
 date_default_timezone_set('America/Lima');
?>
<!DOCTYPE html>
<html lang="es">
<head>
    <title>Inntel Peru - Panel</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="author" content="Author Name">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="shortcut icon" href="#"/>
    <!-- DataTables CSS -->
    <link rel="stylesheet" href="../static/lib/datatables-1.10.25/css/dataTables.bootstrap4.min.css"/>
    <link rel="stylesheet" href="../static/lib/datatables-1.10.25/plugins/responsive-2.2.9/css/responsive.bootstrap4.min.css"/>
    <!-- CSS de botones -->
    <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.7.1/css/buttons.bootstrap4.min.css"/>
    <!--CSS-->
    <link rel="stylesheet" href="../static/lib/bootstrap-4.6.0/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="../static/lib/fontawesome-6.1.1/css/all.min.css"/>
    <link rel="stylesheet" href="../static/lib/jquery-ui-1.12.1/jquery-ui.css"/>
     <!--Javascript-->
    <script src="../static/lib/bootstrap-4.6.0/js/jquery.min.js"></script>
    <script src="../static/lib/jquery-ui-1.12.1/jquery-ui.min.js"></script>
    <script src="../static/lib/bootstrap-4.6.0/js/popper.min.js"></script>
    <script src="../static/lib/bootstrap-4.6.0/js/bootstrap.min.js"></script>
    <script src="../static/lib/adminlte-3.2.0/js/adminlte.min.js"></script>
    <!--Template-->
    <link rel="stylesheet" href="../static/lib/adminlte-3.2.0/css/adminlte.css"/>
    <!--Styles-->
    <link rel="stylesheet" href="../static/css/style.css"/>
   <!--Libs-->
    <script src="../static/lib/bootstrap-daterangepicker-3.1/js/moment.min.js"></script>
    <script src="../static/lib/bootstrap-daterangepicker-3.1/js/moment-with-locales.js"></script>
    <script src="../static/lib/jquery-confirm-3.3.4/js/jquery-confirm.min.js"></script>
    <link rel="stylesheet" href="../static/lib/jquery-confirm-3.3.4/css/jquery-confirm.min.css"/>
    <script src="../static/lib/sweetalert2-11.0.16/js/sweetalert2.all.min.js"></script>
    <link rel="../stylesheet" href="static/lib/sweetalert2-11.0.16/css/sweetalert2.min.css"/>
    <script src="../static/lib/jquery-loading-overlay-2.1.7/js/loadingoverlay.min.js"></script>
    <script src="../static/js/functions.js"></script>
    <link rel="stylesheet" href="../static/lib/select2-4.0.13/css/select2.min.css">
    <script src="../static/lib/select2-4.0.13/js/select2.min.js"></script>
    <script src="../static/lib/select2-4.0.13/js/i18n/es.js"></script>
    <link rel="stylesheet" href="../static/lib/select2-4.0.13/css/select2-bootstrap4.min.css">
    <script src="../static/lib/tempusdominus-bootstrap-4.5.37.0/js/tempusdominus-bootstrap.js"></script>
    <link rel="stylesheet" href="../static/lib/tempusdominus-bootstrap-4.5.37.0/css/tempusdominus-bootstrap.css"/> 
</head>
<style type="text/css">
.loading {
  position: fixed;
  z-index: 999;
  height: 2em;
  width: 2em;
  overflow: show;
  margin: auto;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}
/* Transparent Overlay */
.loading:before {
  content: '';
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
    background: radial-gradient(rgba(20, 20, 20,.8), rgba(0, 0, 0, .8));

  background: -webkit-radial-gradient(rgba(20, 20, 20,.8), rgba(0, 0, 0,.8));
}
/* :not(:required) hides these rules from IE9 and below */
.loading:not(:required) {
  /* hide "loading..." text */
  font: 0/0 a;
  color: transparent;
  text-shadow: none;
  background-color: transparent;
  border: 0;
}
.loading:not(:required):after {
  content: '';
  display: block;
  font-size: 10px;
  width: 1em;
  height: 1em;
  margin-top: -0.5em;
  -webkit-animation: spinner 150ms infinite linear;
  -moz-animation: spinner 150ms infinite linear;
  -ms-animation: spinner 150ms infinite linear;
  -o-animation: spinner 150ms infinite linear;
  animation: spinner 150ms infinite linear;
  border-radius: 0.5em;
  -webkit-box-shadow: rgba(255,255,255, 0.75) 1.5em 0 0 0, rgba(255,255,255, 0.75) 1.1em 1.1em 0 0, rgba(255,255,255, 0.75) 0 1.5em 0 0, rgba(255,255,255, 0.75) -1.1em 1.1em 0 0, rgba(255,255,255, 0.75) -1.5em 0 0 0, rgba(255,255,255, 0.75) -1.1em -1.1em 0 0, rgba(255,255,255, 0.75) 0 -1.5em 0 0, rgba(255,255,255, 0.75) 1.1em -1.1em 0 0;
box-shadow: rgba(255,255,255, 0.75) 1.5em 0 0 0, rgba(255,255,255, 0.75) 1.1em 1.1em 0 0, rgba(255,255,255, 0.75) 0 1.5em 0 0, rgba(255,255,255, 0.75) -1.1em 1.1em 0 0, rgba(255,255,255, 0.75) -1.5em 0 0 0, rgba(255,255,255, 0.75) -1.1em -1.1em 0 0, rgba(255,255,255, 0.75) 0 -1.5em 0 0, rgba(255,255,255, 0.75) 1.1em -1.1em 0 0;
}
/* Animation */
@-webkit-keyframes spinner {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
@-moz-keyframes spinner {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
@-o-keyframes spinner {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
@keyframes spinner {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
</style>
<?php 
$fechahoy=date("Y-m-d");
///echo $fechahoy;
$dni = isset($_GET['numero_dni']) ? $_GET['numero_dni'] : null;
        if ($dni === null || empty($dni)) {
            die("No se recibió el número de DNI.");
        }
          $query = "SELECT c.idcontrato,c.idcliente,c.paga,p.nombre,p.celular,p.fechanacimiento,p.email,c.sit_contrato,p.fechanacimiento
                    FROM persona p 
                    JOIN contrato c ON p.idpersona=c.idcliente  
                    WHERE p.num_documento='$dni'";
                      $row = ejecutarConsultaSimpleFila($query);
                      $nombrecliente=$row['nombre'];
                      $celular=$row['celular'];
                      $fechanacimiento=$row['fechanacimiento'];
                      $email=$row['email'];
                      $idcontrato=$row['idcontrato'];
                      $fechanacimiento=$row['fechanacimiento'];
                      $mensualidadpaga=$row['paga'];
                      $idpersona=$row['idcliente'];
                      $sit_linea=$row['sit_contrato'];
            
          $query1= "SELECT sum(c.monto) as monto_deuda,c.montocuota 
                    FROM cuota c  
                    WHERE c.idcontrato='$idcontrato'  and date(c.fecha_pago)<='$fechahoy' and c.estado_cuota='1' and c.estado_contrato='1'";
                    $row1 = ejecutarConsultaSimpleFila($query1);
                      if(empty($row1['monto_deuda'])){
                        $mon=0.00;
                      }else{
                        $cuo=$row1['montocuota'];
                        $mon=$row1['monto_deuda']+$cuo;
                      }
            ?>

      <body class="hold-transition sidebar-collapse layout-fixed">
        <div class="wrapper">
          <nav class="main-header navbar navbar-expand navbar-white navbar-light">
            <!-- Left navbar links -->
            <ul class="navbar-nav">
              <li class="nav-item">
                <a class="nav-link"  href="#" role="button"><i class="fas fa-bars"></i></a>
              </li>
              <li class="nav-item d-none d-sm-inline-block">
                <a href="#" class="nav-link"></a>
              </li>
            </ul>
          </nav>
          <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <div class="container-fluid">
                  <div class="row mb-2">
                    <div class="col-sm-6">
                      <h1></h1>
                    </div>
                    <div class="col-sm-6">
                      <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="#">Inicio</a></li>
                        <li class="breadcrumb-item active">Validacion</li>
                      </ol>
                    </div>
                  </div>
                </div><!-- /.container-fluid -->
              </section>
              <section class="content">
                    <div class="container-fluid">
                      <div class="row">
                        <!-- left column -->
                        <div class="col-md-3">
                        </div>
                          <div class="col-md-6">
                          <!-- jquery validation -->
                          <div class="card card-danger">
                              <div class="card-header">
                                <center>
                                <h3 class="card-title">CONSULTA TU ESTADO DE CUENTA</h3>
                                </center>
                              </div>
                              <br>
                                <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                <label>Nombre de abonado(a):</label><span><?php echo $nombrecliente;  ?></span>                          
                              </div>   
                              <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                <label>Deuda Total:</label><span>S/<?php echo $mon ?></span>                                                     
                              </div>  
                              <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                <label>Mensualidad :</label><span><?php echo $mensualidadpaga ?></span>                                                     
                              </div>  
                              <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                <label>Estado de la Linea :</label><span> <?php echo $sit_linea ?></span>                                                     
                              </div>
                              <?php
                              if(isset($_GET['datoss'])){
                              echo '<div class="card-body">
                                    <div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>"'.$_GET['datoss'].'"</div> </div>';
                                }
                              ?>
                            <div class="col-12 col-sm-12">
                              <div class="card card-primary card-tabs">
                                <div class="card-header p-0 pt-1">
                                  <ul class="nav nav-tabs" id="custom-tabs-one-tab" role="tablist">
                                    <li class="nav-item">
                                    <a class="nav-link active" id="custom-tabs-one-deuda-tab" data-toggle="pill" href="#custom-tabs-one-deuda" role="tab" aria-controls="custom-tabs-one-deuda" aria-selected="true">Detalle de Deuda</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" id="custom-tabs-one-pago-tab" data-toggle="pill" href="#custom-tabs-one-pago" role="tab" aria-controls="custom-tabs-one-pago" aria-selected="false">Detalle Pago</a>
                                    </li>
                                    <li class="nav-item">
                                      <a class="nav-link" id="custom-tabs-one-datos-tab" data-toggle="pill" href="#custom-tabs-one-datos" role="tab" aria-controls="custom-tabs-one-datos" aria-selected="false">Actualizar Datos</a>
                                    </li>
                                    <li class="nav-item">
                                      <a class="nav-link" id="custom-tabs-one-averia-tab" data-toggle="pill" href="#custom-tabs-one-averia" role="tab" aria-controls="custom-tabs-one-averia" aria-selected="false">Registrar Incidencia</a>
                                    </li>
                                    <li class="nav-item">
                                      <a class="nav-link" id="custom-tabs-one-averia-tab" data-toggle="pill" href="#custom-tabs-one-estado_averia" role="tab" aria-controls="custom-tabs-one-estado_averia" aria-selected="false">Estado Averia</a>
                                    </li>
                                  </ul>
                                </div>
                                <div class="card-body">
                                  <div class="tab-content" id="custom-tabs-one-tabContent">
                                    <div class="tab-pane fade show active" id="custom-tabs-one-deuda" role="tabpanel" aria-labelledby="custom-tabs-one-deuda-tab">
                                      <?php 

                                        if($mon==0){
                                          echo '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>"Felicitaciones esta al dia en sus pagos!"</div>';
                                          echo'   <label>Proximos Pagos:</label>';
                                          echo "
                                                  <div class='card-body p-0'>
                                                      <table cellspacing='2' class='table table-bordered table-striped'>
                                                        <thead>
                                                          <tr>
                                                            <th style='width: 10px'>#</th>
                                                            <th style='width: 30px'>Fecha Corte</th>
                                                            <th style='width: 30px'>Mensualidad</th>      
                                                            <th style='width:30px' >Monto</th>
                                                          </tr>
                                                        </thead>
                                                        <tbody>";
                                                        $query2 = "SELECT c.idcuota,c.monto,c.fecha_pago,c.montocuota  
                                                        FROM cuota c 
                                                        WHERE c.estado_cuota='1' and c.estado_contrato='1' and c.idcontrato='$idcontrato'";
                                                        $row2 = ejecutarConsultaSimpleFila($query2);
                                                        $fechapago=0;
                                                        $montocuota=0;
                                                        $monto_total_cuota=0;
                                                        $idcuota=0;
                                                        if ($row2 && isset($row2['idcuota'])) {
                                                          // Se encontraron resultados
                                                          $fechapago = $row2['fecha_pago'];
                                                          $montocuota = $row2['montocuota'];
                                                          $monto_total_cuota = number_format($row2['monto'] + $montocuota, 2);
                                                          $idcuota = $row2['idcuota'];
                                                      } else {
                                                          // No se encontraron resultados
                                                          echo "No se encontraron cuotas pendientes para este cliente.";
                                                        // return; // O maneja como corresponda
                                                      }
                                                        $simbo="S/";    
                                                        $url1="registrovoucher.php?id=";

                                                        echo'<tr>    
                                                        <td style="font-size:1pt;width:10%"><a target="_blank" href="registrovoucher.php?id='.$idcuota.'&&iv='.$idcontrato.'&&im='.$monto_total_cuota.' "></i><button class="btn-sm btn-success">Pagar</button></a> </td>                                  
                                                        <td style="font-size:9Pt;width:10%">'.$fechapago.'</td>
                                                        <td style="font-size:9pt;width:2%">'.$mensualidadpaga.'</td>                   
                                                        <td style="font-size:11pt;width:1%"><span class="badge bg-danger">'.$simbo.$monto_total_cuota.'</span></td> 
                                                        </tr>';
                                                echo' </tbody> 
                                            </table>
                                          </div>';

                                        }else{
                                          echo '<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>"Usted tiene deudas vencidas!!"</div>';
                                          echo "
                                                  <div class='card-body p-0'>
                                                    <table  cellspacing='2' class='table table-responsive'>
                                                    <thead>
                                                        <tr>
                                                        <th style='width: 10px'>#</th>
                                                        <th style='width: 30px'>Fecha Corte</th>
                                                        <th style='width: 30px'>Mes</th>      
                                                        <th style='width:30px' >Monto</th>
                                                        </tr>
                                                    </thead>
                                                      <tbody>";
                                                              $query2 = "SELECT c.idcuota,c.monto,c.fecha_pago,c.montocuota 
                                                              FROM cuota c 
                                                              WHERE  c.estado_contrato='1' and date(c.fecha_pago)<='$fechahoy' and c.estado_cuota='1' and c.idcontrato='$idcontrato'";
                                                              $adicional2 = mysqli_query($conexion,$query2);
                                                              $i = 1;
                                                            foreach ($adicional2 as $row2){

                                                              $fech = $row2['fecha_pago'];
                                                              $cu =$row2['monto_cuota'];
                                                              $monto_total =number_format($row2['monto']+$cu,2);  
                                                              $idcuota =$row2['idcuota'];
                                                              $simbo="S/";    
                                                              $url="ticketpago.php?idcuota=";
                                                              $url1="registrovoucher.php?iduota=";

                                                              echo'<tr>    
                                                                      <td style="font-size:1pt;width:10%"><a target="_blank" href="registrovoucher.php?id='.$idcuota.'&&iv='.$idcontrato.'&&im='.$monto_total.' "> <button class="btn-sm btn-success">Pagar</button></a></td>                                  
                                                                      <td style="font-size:9Pt;width:10%">'.$fech.'</td>
                                                                      <td style="font-size:9pt;width:2%">'.$mensualidadpaga.'</td>                   
                                                                      <td style="font-size:11pt;width:1%"><span class="badge bg-danger">'.$simbo.$monto_total.'</span></td> 
                                                                  </tr>';
                                                                  $i++;
                                                              }
                                                          echo' </tbody> 
                                                      </table>
                                                    </div>';
                                              }
  ?>
                                       </div>
                                          <div class="tab-pane fade" id="custom-tabs-one-pago" role="tabpanel" aria-labelledby="custom-tabs-one-pago-tab"> 
                                            <!-- /.card-header -->
                                            <div class="card-body p-0">
                                              <table id="example3" class="table">
                                                  <thead>
                                                    <tr>
                                                      <th style="width: 5px">#</th>
                                                      <th>Fecha Pago</th>
                                                      <th>Monto</th>
                                                      <th style="width: 40px">Tipo Pago</th>
                                                    </tr>
                                                  </thead>
                                                  <tbody>
                                                    <?php 
                                                          $query3 = "SELECT idcuota,fecha_pago,fecha_cancelacion,montopagado,formapago
                                                                      FROM cuota 
                                                                      WHERE idcontrato='$idcontrato' and estado_cuota='2' and montopagado>0 ORDER BY idcuota desc limit 10";
                                                                      $adicional3 = mysqli_query($conexion,$query3);
                                                                      $i = 1;
                                                                      foreach ($adicional3 as $row3){

                                                                          if($row3['formapago']==2){
                                                                          $row3['formapago']='Efectivo';
                                                                          }else{
                                                                            $row3['formapago']='Deposito';
                                                                          }
                                                                          $fech = $row3['fecha_pago'];
                                                                          $mont =$row3['montopagado'];                       
                                                                          $tipopa=$row3['formapago'];
                                                                          $simbo="S/"; 
                                                                          $idcuota =$row3['idcuota'];
                                                                          $url="voucherpago.php?idcuota=";
                                                                      echo "<tr>                
                                                                      <td style='font-size:6pt;width:6%'><a target='_blank' href='$url$idcuota'
                                                                      ''> <button class='btn-sm btn-primary'><i class='fa fa-file'></i> </button></a></td>                       
                                                                      <td style='font-size:8pt;width:5%'>$fech</td>            
                                                                      <td style='font-size:10Pt;width:5%'><span class='badge bg-success'>$simbo.$mont</span> </td>                    
                                                                      <td style='font-size:8pt;width:5%'>$tipopa</td>             
                                                                      </tr>";
                                                                          $i++;
                                                                      }
                                                        ?>
                                                  </tbody>
                                                </table>
                                              </div>
                                            </div>
                  
                              <div class="tab-pane fade" id="custom-tabs-one-datos" role="tabpanel" aria-labelledby="custom-tabs-one-datos-tab">
                                <form  id="insert_formulario"   method="post">
                                        <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                          <label>Numero de Whatsapp: (*)</label>  
                                          <input type="hidden" class="form-control" name="dni1" id="dni1" value="<?php echo $dni ?>" > 
                                          <input type="number" class="form-control" name="numerow" id="numerow" value="<?php echo $celular ?>" placeholder="Ingrese su Numero" >
                                        </div>

                                        <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                          <label>Correo Electronico: (*)</label>                                                                   
                                          <input type="email" class="form-control" name="email" id="email" value="<?php echo $email ?>" placeholder="Ingrese un Correo" >
                                        </div>

                                        <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                          <label>Fecha Nacimiento: (*)</label>                                                                   
                                          <input type="date" class="form-control" name="fechan" id="fechan" value="<?php echo $fechanacimiento ?>"  placeholder="Ingrese su fecha Nacimiento" >
                                        </div>
                                                
                                        <center>
                                        <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                            <button class="btn btn-primary form-control"  id="btnguardar"><i class="fa fa-undo"></i>&nbsp; Actualizar Datos</button>
                                        </div>
                                      </center>
                                  </form>
                              </div>
                  
                              <div class="tab-pane fade" id="custom-tabs-one-averia" role="tabpanel" aria-labelledby="custom-tabs-one-averia-tab">
                                    <form  id="insert_averia"   method="post">
                                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <label>Nombre Cliente: (*)</label>  
                                        <input type="hidden" class="form-control" name="idcontrato" id="idcontrato" value="<?php echo $idcontrato ?>" > 
                                        <input type="text" class="form-control" name="nombre" id="nombre" readonly value="<?php echo $nombrecliente ?>"  >
                                      </div>
                                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <label>Descripcion del Problema: (*)</label>                                                                   
                                        <textarea class="form-control" name="descripcion"  id="descripcion" rows="3"  placeholder="Descripcion ..."></textarea>
                                      </div>
                                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <label>Referencia de su Direccion: (*)</label>                                                                   
                                        <textarea class="form-control" name="referencia"  id="referencia" rows="3"  placeholder="Referencia direccion ..."></textarea>
                                      </div>
                                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <label>Numero de Contacto: (*)</label>                                                                   
                                        <input type="number" class="form-control" name="celular"  id="celular"  placeholder="Numero de Contacto" >
                                        </div>
                                        <input type="hidden" name="latitud" id="latitud">
                                        <input type="hidden" name="longitud" id="longitud">
                                        <input type="hidden" name="direccion" id="direccion">
                                      <center>
                                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                          <button class="btn btn-primary form-control"  id="btnguardar1"><i class="fa fa-undo"></i>&nbsp; Enviar Averia</button>
                                      </div>
                                      </center>
                                    </form>
                                </div>
                                <div class="tab-pane fade" id="custom-tabs-one-estado_averia" role="tabpanel" aria-labelledby="custom-tabs-one-estado_averia-tab">
                                    <form  id="insert_averia_tecnico"   method="post">
                                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <label>Nombre Tecnico: (*)</label>  
                                        <input type="text" class="form-control" name="nombre_tecnico" id="nombre_tecnico" readonly>
                                      </div>
                                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <label>Estado Averia: (*)</label>                                                                   
                                        <input type="text" class="form-control" name="estado_averia_tecnico" id="estado_averia_tecnico" readonly>
                                      </div>
                                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <label>Numero de Tecnico: (*)</label>                                                                   
                                        <input type="number" class="form-control" name="celular_tecnico"  id="celular_tecnico"  placeholder="Numero de Contacto" >
                                        </div>
                                    </form>
                                </div>
                            </div>
                          </div>
                          <!-- /.card -->
                        </div>
                      </div>
                      <div class="loading" id="loader" style="display: none">Cargando</div>
                      <center>
                      <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12">
                      <a href="consultapago.php"><button class="btn btn-warning" type="submit"></i>Salir</button></a>
                      </div>
                  </center>
               </div>                                 
            </div>
          </div>
        </div>
      </div>
      </section>
      </div>
<?php  
 $año=date("Y")
?>
<footer class="main-footer position-relative text-center py-2">
    <div>
        © Copyright <strong>Dashboard New</strong>. Todos los derechos reservados<br>
        <a href="https://www.facebook.com/jorge.melgarejopatricio" target="_blank">Desarrollado por JM.</a>
    </div>
    <div class="position-absolute" style="right: 15px; top: 50%; transform: translateY(-50%);">
        <a href="https://wa.me/985700881/?text=Hola%20Inntel%20" target="_blank">
            <img src="whasp.png" width="35" height="35">
        </a>
    </div>
</footer>
    </div>

<script>
    // Example script for displaying error messages if they exist
    var errors = '';
    // Add messages dynamically here
    if (errors) {
        alert(errors); // Replace with your own error display logic
    }
</script>
</body>
<!-- JavaScript for DataTable -->
    <script src="../static/lib/datatables-1.10.25/js/jquery.dataTables.js"></script>
    <script src="../static/lib/datatables-1.10.25/js/dataTables.bootstrap4.min.js"></script>
    <script src="../static/lib/datatables-1.10.25/plugins/responsive-2.2.9/js/dataTables.responsive.min.js"></script>
    <script src="../static/lib/datatables-1.10.25/plugins/responsive-2.2.9/js/responsive.bootstrap4.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.7.1/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.bootstrap4.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.colVis.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
    <script src="../static/js/main.js"></script>
    <script type="text/javascript" src="../scripts/portal.js"></script>
</html>
<script>
function openCity(evt, cityName) {
    var i, tabcontent, tablinks;
    tabcontent = document.getElementsByClassName("tabcontent");
    for (i = 0; i < tabcontent.length; i++) {
      tabcontent[i].style.display = "none";
    }
    tablinks = document.getElementsByClassName("tablinks");
    for (i = 0; i < tablinks.length; i++) {
      tablinks[i].className = tablinks[i].className.replace(" active", "");
    }
    document.getElementById(cityName).style.display = "block";
    evt.currentTarget.className += " active";
  }
</script>

