

<?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">

<h1 class="text-center">
    
</h1>    
 
    <div class="">
  <?php

  $objSes = new Sessions();
        $objSes->init();
        $profiless = $objSes->get('login');
  
  include('config.php');
 // $sqlClientes = ("SELECT * FROM clientes WHERE estado ='PENDIENTE' and correo = '$profiless' ORDER BY id ASC");  
  //$sqlClientes = ("SELECT * FROM clientes WHERE estado ='PENDIENTE' 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 c.*, u.celular2 FROM clientes c INNER JOIN clientes2 u ON c.nombre= u.nombre");
//$sqlClientes = ("SELECT * FROM clientes  ORDER BY id DESC ");
  $queryData   = mysqli_query($con, $sqlClientes);
  $total_client = mysqli_num_rows($queryData);
  ?>

<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>ESTADO</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>VALIDADO</th>    
              </tr>
          </thead>
          <tbody>
           
            <?php 
             $rut = '15844765-7';
            $i = 1;
            while ($data = mysqli_fetch_array($queryData)) { ?>
            <tr>
             
              <th scope="row"><?php echo $i++; ?></th>  
                 <td><a href="http://frfamae012:270/carpeta_digital_v9/index.php?ruc=<?php echo $data['nombre'];?>&rut=<?php echo $rut;?>"><?php echo $data['nombre']; ?></td>    
             <td> <?php echo $resultado = substr($data['nombre'], -8);?></td>
              <td><?php echo $data['correo']; ?></td>
              <td><?php echo $data['celular']; ?></td> 
                <td><?php echo $data['celular2']; ?></td>   
            
              <td><?php echo $data['fecha']; ?></td>  
              <td><?php echo $data['estado']; ?></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-info btn-lg" >
          <span class="glyphicon glyphicon-ok"></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(500);
        });      
});
</script>


</body>
</html>
