<?php


$variable1=($_GET['variable1']);

"$variable1";


$variable2=($_GET['variable2']);

"$variable2";
//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);
}

	header('Content-type:application/xls');
	header('Content-Disposition: attachment; filename=micargaporvalidar'.$variable2.''.$profiless.'.xls');

	require_once('conexion.php');
	$conn=new Conexion();
	$link = $conn->conectarse();

	$query="SELECT * FROM ruc WHERE FECHA_CARGA = '$variable1' and ASIGNADO ='$profiless' ";
	$result=mysqli_query($link, $query);



?>






<table border="1">
		<tr style="background-color:green;">

		<th>N</th>	
		<th>CARPETA DIGITAL</th>
		<th>RUC</th>
		<th>RUC CORTO</th>
		<th>FISCALIA</th>
		<th>DIGITAL</th>
		<th>OBSERVACION</th>
		<th>DECISION</th>
		<th>DELITO</th>
		<th>COMUNA</th>
		<th>FECHA LECTURA</th>
		<th>FECHA ASIGNACION</th>
		<th>ASIGNADO</th>
		<th>OBSERVACION</th>
	</tr>
	<?php


	 $a ='C';
	 $i = 1;
	
	

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

	 
			?>
			
				<tr>
					
					<th scope="row"><?php echo $i++; ?></th>  
					<td><?php echo $carpeta_digital = '=HIPERVINCULO(CONCATENAR("http://frcn-webp04:270/carpeta_digital_v9/index.php?ruc=";C'.$i.';"&rut=15844765-7"); "CARPETA DIGITAL")';?></td>
					<td><?php echo $row['RUC']; ?></td>
					<td><?php echo $ruc_corto = '=EXTRAE('.$a.$i.';4;12)';?></td>
					<td><?php echo $row['COD_FL']; ?></td>
					<td><?php echo $row['DIGITAL']; ?></td>
					<td><?php echo $row['OBSERVACION']; ?></td>
					<td><?php echo $row['DECISION']; ?></td>
					<td><?php echo $row['DELITO']; ?></td>
					<td><?php echo $row['COMUNA']; ?></td>
					<td><?php echo $row['FECHA_LECT']; ?></td>
					<td><?php echo $row['FECHA_ASIG']; ?></td>
					<td><?php echo $row['ASIGNADO']; ?></td>
					
				</tr>	

			<?php
		}

	?>
</table>