
<?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 lang="en">
<head>
  <title>TRANSFERENCIAS</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>

  <style>
    /* Set height of the grid so .sidenav can be 100% (adjust if needed) */
    .row.content {height: 200px}
    
    /* Set gray background color and 100% height */
    .sidenav {
      background-color: #f1f1f1;
      height: 0%;
    }
    
    /* Set black background color, white text and some padding */
    footer {
      background-color: #555;
      color: white;
      padding: 1px;
    }
    
    /* On small screens, set height to 'auto' for sidenav and grid */
    @media screen and (max-width: 77px) {
      .sidenav {
        height: auto;
        padding: 15px;
      }
      .row.content {height: auto;} 
    }




  </style>

<style>
table {
  border-collapse: collapse;
  width: 100%;
}

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

tr:hover {background-color: #D6EEEE;}
</style>

</head>
<body>

<body style="height:100px">



<nav class="navbar navbar-expand-sm bg-success navbar-dark fixed-top">
 <ul class="navbar-nav mr-auto collapse navbar-collapse">
    <li class="nav-item active">
      <a class="nav-link" href="menuExceltransfer.php">TRANSFERENCIAS</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="menuExcelap.php">AP</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="menuExceleq.php">EQUIPOS</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="menuExceltodo.php">TODO</a>
    </li>
  </ul>

    <div class="my-7 my-lg-0">
      <h5 class="navbar-brand"><header><h1>Bienvenido(a): <?php echo $profiless ?></h1></header> </h5>
    </div>
</nav>



<div class="container-fluid" style="margin-top:80px">
 
</div>

<div class="container-fluid">
  <div class="row content">
    <div class="col-sm-1v">
     <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: 4px;
}

   <?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);


  ?>



</style>
</head>
<body>




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

 <center> <h5>PENDIENTES</h5></center>
  <table style="width: 10%;">
<colgroup>
 
</colgroup>
  <tr>
    <th>TERMINO</th>
    <th>CANTIDAD</th>
    </tr>
  
  <tr>
    <td>TRANSFERENCIAS</td>    
    <td>
     
  <center> <strong><h1><a href="#"><?php echo $total_clientS ?></a></h1></strong></center>
   
    </td>
  </tr>
   <tr>
    <td>EQUIPOS</td>    
    <td>
      
   <center> <strong><h1><a href="#"><?php echo $total_clientA; ?></a></center>
   
    </td>
  </tr>
   <tr>
    <td>AP</td>    
    <td>
      
      <center><strong><H1><a href="#"><?php echo $total_clientAP; ?></a></center>
    </td>
  </tr>

   <td>Total S/VALIDAR</td>    
    <td>
      
      <center><H1><a href="prueba.php"><?php echo $total_client ?></a></strong></H1></center>
    </td>
  </tr>
 


</table>



<BR>
<BR>

  <h5>VER MI CARGA</h5>



  <a href="menuCarga.php" class="btn btn-success btn-lg" role="button">Mi Carga</a>

<BR>
<BR>
<BR>
<BR>


  <h5>BUSCAR DELITO</h5>
  <!-- Trigger the modal with a button -->
  <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Buscar Aquí</button>

  <!-- Modal -->
  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">
    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Cerrar</h4>
        </div>
<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>



tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
<div class="container">

<h2>Filtrar por palabra</h2>

<input id="myInput" type="text" placeholder="Ingresa alguna palabra..">



        <div class="modal-body">
 
            
            <table class="table">
  <thead class="table-primary">
    <label>Todos los delitos</label>
    <tr>
      
      <th scope="col">DELITO</th>
      <th scope="col">CODIGO SAF</th>
      <th scope="col">ESPECIALIDAD</th>
      <th scope="col">CLASIFICACION</th>
     
    </tr>
  </thead>
  <tbody>
    <Br>
            
         <?php     
            
             echo '</tr>'; echo '</tr>'; echo '</tr>';
include("conect2.php");

  
$resultados=mysqli_query($conexion, "select * FROM delitos");

while($row = mysqli_fetch_assoc( $resultados )) {

?>
 <tbody id="myTable"><?php 
    // set up a row for each record
    echo '<tr>';
    echo '<td>' . $row['DELITO']            .   '</td>';
    echo '<td>' . $row['CODIGO']    .   '</td>';
    echo '<td>' . $row['ESPECIALIDAD']     .   '</td>';
    echo '<td>' . $row['GRUPO']      .   '</td>';
    
    echo '</tr>';
}
?>
</tbody>
</table>

        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
      
    </div>
  </div>
  
</div>
      </div></div>
  

    <div class="col-sm-5">
 
    
    <div class="">
  <?php
 
 
  $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 COUNT(*) AS CANTIDAD, ID, ASIGNADO, ESTADO, FECHA_CARGA, FECHA_LECT, FECHA_VALIDA, FECHA_ASIG, DECISION FROM ruc where DECISION = 'TRANSFERENCIAS' GROUP BY FECHA_CARGA ORDER BY  FECHA_CARGA DESC"); 
//$sqlClientes = ("SELECT R.ID, R.ASIGNADO, COUNT(*) AS CANTIDAD, R.ESTADO FROM ruc R INNER JOIN user US  US.logUser on (R.ID = US.idUser) GROUP BY ASIGNADO ORDER BY  CANTIDAD DESC");   
 // $sqlClientes = ("SELECT COUNT(RUC) AS CANTIDAD FROM ruc");   
//$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>
   
  <!--
  <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>-->


<H1>DESCARGAR EXCEL TRANSFERENCIAS</H1>


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


            <tr>
                    
             
              <th>CANTIDAD</th>             
              <th>FECHA DE CARGA</th>
              <th>FECHA DE LECTURA</th>
              <th>FECHA DE ASIGNACION</th>
              <th>DESCARGAR EXCEL</th>
              <th>IMPRIMIR CODIGO DE BARRA</th>
            <th>VER</th>
            
           
            </tr>
          </thead>
          <tbody>

            <?php     


            
         
            while ($data = mysqli_fetch_array($queryData)) { ?>
                
            <tr>
                <tbody id="myTable">           
        
              <td><strong><?php echo $data['CANTIDAD']; ?></strong></td> 
             <!-- <td><strong><a href="select_menueq.php"><?php echo $data['DECISION']; ?></a></strong></td> -->
              <td><strong><?php echo $data['FECHA_CARGA']; ?></strong></td> 
               <td><strong><?php echo $data['FECHA_LECT']; ?></strong></td> 
                <td><strong><?php echo $data['FECHA_ASIG']; ?></strong></td> 

           
   <!--<td><center> <label><input type="radio" name ="fecha" class="selectall" value="<?= $data['FECHA_CARGA']?>" ></label> </center> </td> -->

      

      <td>  <button a href="pdfap.php" type="submit" name ="fecha" class="btn btn-success btn-lg" value="<?= $data['FECHA_CARGA']?>"> <span class="glyphicon glyphicon-cloud-download"></span> DESCARGAR</td>
       

         <td>  <center>
    <a href="code_bar/codigobarras/tabla.php?variable1=<?= $data['FECHA_CARGA']?>" class="btn btn-warning btn-lg" name="submit" type="submit"/a>
          <span class="glyphicon glyphicon-print"></span> </td></center>
          
          
            <td>  <center>
    <a href="vistatermino.php?variable2=<?= $data['DECISION']?>&variable1=<?= $data['FECHA_CARGA']?>" class="btn btn-success btn-lg" name="submit" type="submit"/a>
          <span class="glyphicon glyphicon-eye-open"></span></center></td>
</tr>



 
          <?php } ?>
         

           



      

   
            </div>
          </div>
        </div>
      </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>