
<?php

require 'menu.php';

//llamamos la constante URL

//controlamos que se haya iniciado session.
require 'class/sessions.php';
$objSes = new Sessions();
$objSes->init();

$profiless = $objSes->get('login');
$profile = $objSes->get('profi');

if((!isset($profile))&&($profile != 'Stardard')){
    header('location: ' . URL);
}


?>



<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link type="text/css" rel="shortcut icon" href="img/logo-mywebsite-urian-viera.svg"/>
  <title>Cómo Importar Excel a MYSQL con PHP sin Libreria de forma Fácil :: WebDeveloper Urian Viera</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
  <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="css/cargando.css">
  <link rel="stylesheet" type="text/css" href="css/cssGenerales.css">


    <script>
      $(document).ready(function () {  
        //Detectar click en el checkbox superior de la lista
        $('#selectall').on('click', function () {
          //verificar el estado de ese checkbox si esta marcado o no
          var checked_status = this.checked;
 
          /*
           * asignarle ese estatus a cada uno de los checkbox
           * que tengan la clase "selectall"
          */
          $(".selectall").each(function () {
            this.checked = checked_status;
          });
        });
      });
    </script>



</head>
<body>

<div class="cargando">
    <div class="loader-outter"></div>
    <div class="loader-inner"></div>
</div>
    

<nav class="navbar navbar-expand-lg navbar-light navbar-dark fixed-top" style="background-color: #022EC3 !important;">
    <ul class="navbar-nav mr-auto collapse navbar-collapse">
      <li class="nav-item active">
        <a href="index.php"> 
          <img src="img/logo-mywebsite-urian-viera.svg" alt="Web Developer Urian Viera" width="120">
        </a>
      </li>
    </ul>
    <div class="my-2 my-lg-0">
      <h5 class="navbar-brand"><header><h1>Bienvenido(a): <?php echo $profiless ?></h1></header> </h5>
    </div>

    
</nav>




<div class="container">



<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#myInput").on("keyup", function() {
    var value = $(this).val().toLowerCase();
    $("#myTable tr").filter(function() {
      $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
    });
  });
});
</script>
<style>
table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>

<h2>Filtrar por palabra</h2>

<input id="myInput" type="text" placeholder="Search..">
<br><br>

<table>
  <thead>

<h1 class="text-center">
    
</h1>    
 
    

    <div class="">
  <?php
 
  include('config.php');
  $sqlClientes = ("SELECT * FROM ruc WHERE ESTADO ='PENDIENTE' and ASIGNADO = '$profiless' ORDER BY id ASC");
  $queryData   = mysqli_query($con, $sqlClientes);
  $total_client = mysqli_num_rows($queryData);


  include('config.php');
  $sqlClientes = ("SELECT * FROM ruc WHERE DECISION ='TRANSFERENCIAS' and ASIGNADO = '$profiless' and ESTADO ='PENDIENTE' ORDER BY id ASC");
  $queryData   = mysqli_query($con, $sqlClientes);
  $total_clientS = mysqli_num_rows($queryData);
  
 
  include('config.php');
  $sqlClientes = ("SELECT * FROM ruc WHERE DECISION ='EQUIPO' and ASIGNADO = '$profiless' and ESTADO ='PENDIENTE' ORDER BY id ASC");
  $queryData   = mysqli_query($con, $sqlClientes);
  $total_clientA = mysqli_num_rows($queryData);
 
 
  include('config.php');
  $sqlClientes = ("SELECT * FROM ruc WHERE DECISION = 'AP' and ASIGNADO = '$profiless' and ESTADO ='PENDIENTE' ORDER BY id ASC");
  $queryData   = mysqli_query($con, $sqlClientes);
  $total_clientAP = mysqli_num_rows($queryData);



  $objSes = new Sessions();
        $objSes->init();
        $profiless = $objSes->get('login');
  
  include('config.php');
$sqlClientes = ("SELECT * FROM ruc WHERE ESTADO ='PENDIENTE' and ASIGNADO = '$profiless' ORDER BY id ASC");  
//$sqlClientes = ("SELECT * FROM ruc  ORDER BY id ASC");
 // $sqlClientes = ("SELECT C.*, C.dv FROM clientes C INNER JOIN user u ON u.nombre = '$cla' AND C.dv = '0' OR C.dv = '1' AND c.estado = 'EQUIPO'");
  
//$sqlClientes = ("SELECT * FROM clientes  ORDER BY id DESC ");
  $queryData   = mysqli_query($con, $sqlClientes);
  $total_client = mysqli_num_rows($queryData);


  ?>

</div>


<div class="container">

  <meta name="viewport" content="width=device-width, initial-scale=1">
<style>
table {
  border-collapse: collapse;
  width: 5%;
  border: 1px solid #ddd;
}

th, td {
  text-align: left;
  padding: 3px;
}
</style>
</head>
<body>

  <h5>Tabla Asignación</h5>

<table>
  <tr>
   
    </tr>
  <tr>
    <td>SIN VALIDAR</td>
   
    <td>
 <center><a href="index2.php"><?php echo $total_client; ?></a></center>

</td></table>
<br>



<table>
  <tr>
    <th>TERMINO</th>
    <th>CANTIDAD</th>
    </tr>
  
  <tr>
    <td>TRANSFERENCIAS</td>    
    <td>
     
  <center>  <a href="index2.php"><?php echo $total_clientS; ?></a></center>
    </td>
  </tr>
   <tr>
    <td>EQUIPOS</td>    
    <td>
      
   <center>   <a href="index2.php"><?php echo $total_clientA; ?></a></center>
    </td>
  </tr>
   <tr>
    <td>AP</td>    
    <td>
      
  <center>    <a href="index2.php"><?php echo $total_clientAP; ?></a></center>
    </td>
  </tr>
    <td>Total SV</td>    
    <td>
      
  <center>    <a href="index2.php"><?php echo $total_client; ?></a></center>
    </td>
  </tr>
 
</table>


   
  <!--
  <center><button type="button" class="btn btn-danger">SIN VALIDAR <span class="badge"><strong><H5><a href="index2.php"><?php echo $total_client; ?></a></strong></H5></span></button>

   <button type="button" class="btn btn-success">AP  <span class="badge"><strong><H5><a href="ap.php"><?php echo $total_clientAP; ?></a></strong></H5></span></button>

    <button type="button" class="btn btn-danger">TRANSFERENCIAS  <span class="badge"><strong><H5><a href="transfer.php"><?php echo $total_clientS; ?></a></strong></H5></span></button>

    <button type="button" class="btn btn-warning">EQUIPO JURIDICO <span class="badge"><strong><H5><a href="equipos.php"><?php echo $total_clientA; ?></a></strong></H5></span></button>

</center>-->



<br>
    <br>
      <h6 class="text-center">
        RUC cargados <strong>(<?php echo $total_client; ?>)</strong>
      </h6>


      <form action="updatechek.php" method="POST">
<div class="table-responsive-xl">
       <table class="table table-striped table-hover table-bordered table-responsive-xl">
          <thead class="thead-dark">


            <tr>
              <th>#</th>
               <th width="7%">RUC</th>
               <tH>RUC CORTO</tH>
              <th>DIGITAL</th>
              <th>PRECLASIFICACION</th>
              <th>TERMINO</th>
              <th>VALIDADO</th>
               <th>FECHA DE REGISTRO</th>              
               <th><input class="btn btn-success" name="submit" type="submit" value="VALIDAR" />  <label><input  id="selectall"type="checkbox" name='check' value=""></label>
                <center> </center> </th>              
                   <th>ACCION</th>    
              </tr>
          </thead>
          <tbody>

            <?php

           
            
             $rut = '15844765-7';
            $i = 1;
            while ($data = mysqli_fetch_array($queryData)) { ?>
            <tr>
               <tbody id="myTable">
              <th scope="row"><?php echo $i++; ?></th>  
                 <td><a href="http://frfamae010:270/carpeta_digital_v9/index.php?ruc=<?php echo $data['RUC'];?>&rut=<?php echo $rut;?>"><?php echo $data['RUC']; ?></td>    
             <td> <?php echo $resultado = substr($data['RUC'], -8);?></td>
              <td><?php echo $data['DIGITAL']; ?></td>
              <td><?php echo $data['OBSERVACION']; ?></td>  
               <td><?php echo $data['DECISION']; ?></td>  

               <td><?php  $data['ESTADO'];   if ($data['ESTADO'] == 'VALIDADO'){
echo ' <a href="" class="btn btn-success btn-lg">
          <span class="glyphicon glyphicon-ok"></span> 
        </a>';
}else{
  
echo '<a href="" class="btn btn-danger btn-lg">
          <span class="glyphicon glyphicon-remove"></span> 
        </a>';


}

?></td>       
              <td><?php echo $data['FECHA_LECT']; ?></td>  
         
          <!-- <td><center> <label><input type="checkbox" value="VALIDADO" name='check' class="selectall"></label> </center> </td>-->
            <td><center> <label><input type="checkbox" class="selectall" value="<?= $data['ID']?>" name ="id[]"></label> </center> </td>  


       <td>  <button name="submit" type="submit" class="btn btn-warning btn-lg" >
          <span class="glyphicon glyphicon-floppy-saved"></span> </td>
       
       
  <!-- <td> <?php  echo '<a href=updacheck1a1.php?e='.$data['id'].' class="btn btn-info btn-lg"</a> 22  <span class="glyphicon glyphicon-edit"></span> ';?></td>-->
       
       
</tr>

</body>
</html>
 
          <?php } ?>
         
      

    </div>
  </div>
</div> 
</div> 


<script src="js/jquery.min.js"></script>
<script src="'js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $(window).load(function() {
            $(".cargando").fadeOut(10);
        });      
});
</script>


</body>
</html>
