@extends('layouts.app')

@section('content')
<?php
include 'dbconnection.php';
$Email = Auth::user()->email;

$DB = mysqli_query($mysql,"SELECT dbname,Condominio FROM tb_users WHERE email ='$Email'");
while($row100 = mysqli_fetch_array($DB)){
$dbname = $row100 ['dbname'];

}


$hostname2 = "localhost";
$username2 = "tempdpe5_nicolas";
$password2= "(Made7575)";
$conn = mysqli_connect($hostname2,$username2,$password2,$dbname);
if (mysqli_connect_errno()){
  printf("Connect failed: %s\n", mysqli_connect_error());
  exit();
} 
mysqli_set_charset($conn ,"utf8");


$Group = Auth::user()->group_id;

$Username = Auth::user()->username;
$Condominio = $_GET['Condominio']; 
$Mes = $_GET['Mes']; 
$Ano = $_GET['Ano']; 
$Mesano = $Mes.' - '.$Ano;


?>


<!--<div class="page-header"><h2>{{ $pageTitle }} <small> {{ $pageNote }} </small> </h2></div>-->
<div  class="p-4 table-responsive" style="background-color: #ffffff;" >
<!--Inicio-->
<div class="x" style ="transform-origin:top;">   
 <div class="row " style="margin-bottom: -85px;">
    <div class=" col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6" style="text-align: left; margin-top:170px;">
 	
 	<button style="border: none;background: none;border-color: transparent;" onclick="location.href='{{ url('reporteadm') }}'"><img class="imagen" src="dashboardimage/salir.png" style="width:50%;float: left;"></button>
 	</div>
    
    <div class="col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6" style="text-align: right;margin-top:170px;">
    <button style="border: none;background: none;border-color: transparent;outline-style: none;" onclick="generatePDF()"><img class="imagen" src="dashboardimage/sendreport.png" style="width:40%; float: right;"></button>
    </div> 
     </div>

<div id="reporte" class="p-5">
 <div style="font-size:30px;color: #7a7a7a;font-weight:900;font-family: 'Rubik', sans-serif;text-align: center;text-shadow:0px 0px 2px #3b3b3b;margin-top:10px">RESIDENCIAL <?php echo $Condominio; ?></div>
    <div style="font-size:20px;color: #7a7a7a;font-weight:900;font-family: 'Rubik', sans-serif;text-align: center; margin-bottom:-10px;text-shadow:0px 0px 2px #3b3b3b;">REPORTE ADMINISTRATIVO DETALLADO | <?php echo $Mesano; ?></div>         
<div class="col-md-12 col-12">
<hr class="line_break1"> 
<div class="huge4" style="margin-left:15px;text-align: center;" >INFORMACIONES GENERALES DE PAGOS</div> 
<hr class="line_break2">
</div>

<!--tabla de pagos-->
<div class="container-fluid">
<!--priemra fila-->
<div class="row" >
<div class="col-7 col-sm-7 col-md-7 col-lg-7 col-xl-7" style="text-align: center;">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 huge3">INFORMACIONES DE PAGO DEL MES ( CUOTA NORMAL )</div>     
<?php 

$Tabla1 = mysqli_query($conn,"SELECT count(ID) AS num1 FROM mantenimientopago WHERE Tipocuota = 'Normal' AND Mes='$Mes' AND Ano='$Ano'");
while($row20 = mysqli_fetch_array($Tabla1)){
$count1 = $row20 ['num1'];  
}  

if($count1 == 0){ 
 echo"<img class='imagen4' src='dashboardimage/nodatos.png'>";    
}else{

echo"<table class='table table-striped ' style='table-layout:fixed;'>";
				echo"<tr style='background: #436e8f; color: #fff;text-align: center;border: 1px solid #436e8f;vertical-align: middle;'>";
					echo"<th class='align-middle' style='vertical-align: middle;'    width='25' height='10'>RESIDENCIA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='30'>NOMBRES & APELLIDOS</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='25'>TIPO DE CUOTAL</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>CUOTA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>PAGO TOTAL</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>ESTATUS</th>";
				echo"</tr>";
mysqli_query($conn,"UPDATE mantenimientopago SET Totalreporte = InvTotal WHERE Totalreporte IS NULL");
mysqli_query($conn,"UPDATE mantenimientopago SET Statusreporte = Pagostatus WHERE Statusreporte IS NULL");

$Tabla1x = mysqli_query($conn,"SELECT * FROM mantenimientopago WHERE Mes='$Mes' AND Tipocuota='Normal' AND Ano='$Ano' AND Condominio = '$Condominio'");
$count1x = mysqli_num_rows($Tabla1x); 
while($row21 = mysqli_fetch_array($Tabla1x)){
$Residencia[] = $row21 ['Residencia'];
$Nombres[] = $row21 ['Nombres'];
$Apellidos[] = $row21 ['Apellidos'];
$Tipocuota[] = $row21 ['Tipocuota'];
$Cuota[] = number_format($row21 ['Totalreporte'],2);
$Pago[] = number_format($row21 ['Pagorealizado'],2);
$Estatus[] = $row21 ['Statusreporte'];

}
 
   
for($i=0;$i<$count1x;$i++){
    
echo"<tr style='text-align:center;word-wrap:break-word;center;font-size:18px;'>"; 
echo"<td style='font-size:11px;'>$Residencia[$i]</td>";
echo"<td style='font-size:11px;'>$Nombres[$i] $Apellidos[$i]</td>";
echo"<td style='font-size:11px;'>$Tipocuota[$i]</td>";
echo"<td style='font-size:11px;'>$ $Cuota[$i]</td>";
echo"<td style='font-size:11px;'>$ $Pago[$i]</td>";
echo"<td style='font-size:11px;'>$Estatus[$i]</td>";
echo"</tr>";

}

echo"</table>"; 

}

?> 
</div>
<div class="col-5 col-sm-5 col-md-5 col-lg-5 col-xl-5 " style="text-align: center;">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 huge3" >INFORMACIONES DE PAGOS PENDIENTES </div>        
<?php 

$Tabla2 = mysqli_query($conn,"SELECT count(ID) AS num2 FROM mantenimientopago WHERE Pagostatus !='Pagado' AND Condominio = '$Condominio'");
while($row30 = mysqli_fetch_array($Tabla2)){
$count2 = $row30 ['num2'];  
}  

if($count2 == 0){ 
 echo"<img class='imagen4' src='dashboardimage/nodatos.png'>";    
}else{

echo"<table class='table table-striped ' style='table-layout:fixed;'>";
			
				echo"<tr style='background: #436e8f; color: #fff;text-align: center;border: 1px solid #436e8f;vertical-align: middle'>";
					echo"<th class='align-middle' style='vertical-align: middle;'    width='25'>RESIDENCIA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='30'>NOMBRES & APELLIDOS</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>TOTAL</th>";
				echo"</tr>";

$Tabla2x = mysqli_query($conn,"SELECT Residencia,Nombres,Apellidos,SUM(InvTotal) as Total,SUM(Pagorealizado) as Pago FROM mantenimientopago WHERE Pagostatus !='Pagado' AND Condominio = '$Condominio' AND Tipocuota IN ('Normal','Extraordinaria') GROUP BY Residencia");
$count3 = mysqli_num_rows($Tabla2x); 
while($row31 = mysqli_fetch_array($Tabla2x)){
$Residencia2[] = $row31 ['Residencia'];
$Nombres2[] = $row31 ['Nombres'];
$Apellidos2[] = $row31 ['Apellidos'];
$Pendiente2[] = number_format($row31 ['Total']- $row31 ['Pago'],2);
}
 
   
for($x=0;$x<$count3;$x++){
    
echo"<tr style='text-align:center;word-wrap:break-word;center;font-size:18px;'>"; 
echo"<td style='font-size:11px;'>$Residencia2[$x]</td>";
echo"<td style='font-size:11px;'>$Nombres2[$x] $Apellidos2[$x]</td>";
echo"<td style='font-size:11px;'>$Pendiente2[$x]</td>";

echo"</tr>";

}

echo"</table>"; 

}

?>     

</div>
</div> 
<!--priemra fila-->
<!--segunda fila-->
<div class="row">
<div class="col-7 col-sm-7 col-md-7 col-lg-7 col-xl-7" style="text-align: center;margin-top:15px;">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 huge3">INFORMACIONES DE PAGO ( CUOTA EXTRAORDINARIA )</div>
<?php 

$Tabla3 = mysqli_query($conn,"SELECT count(ID) AS num3 FROM mantenimientopago WHERE Tipocuota= 'Extraordinaria' AND Mes='$Mes' AND Ano = '$Ano' AND Condominio = '$Condominio'");
while($row32 = mysqli_fetch_array($Tabla3)){
$count4 = $row32 ['num3'];  
}  

if($count4 == 0){ 
 echo"<img class='imagen4' src='dashboardimage/nodatos.png'>";    
}else{

echo"<table class='table table-striped ' style='table-layout:fixed;'>";
			
				echo"<tr style='background: #436e8f; color: #fff;text-align: center;border: 1px solid #436e8f;vertical-align: middle'>";
					echo"<th class='align-middle' style='vertical-align: middle;'    width='25'>RESIDENCIA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='30'>NOMBRES & APELLIDOS</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='25'>TIPO DE CUOTAL</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>CUOTA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>PAGO TOTAL</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>ESTATUS</th>";
				echo"</tr>";

$Tabla3x = mysqli_query($conn,"SELECT * FROM mantenimientopago WHERE Mes='$Mes' AND Tipocuota ='Extraordinaria' AND Ano = '$Ano'AND Condominio = '$Condominio'");
while($row33 = mysqli_fetch_array($Tabla3x)){
$Residencia3[] = $row33 ['Residencia'];
$Nombres3[] = $row33 ['Nombres'];
$Apellidos3[] = $row33 ['Apellidos'];
$Tipocuota3[] = $row33 ['Tipocuota'];
$Cuota3[] = number_format($row33 ['Totalreporte'],2);
$Pago3[] = number_format($row33 ['Pagorealizado'],2);
$Estatuspagos[] = $row33 ['Statusreporte'];

}
 
   
for($y=0;$y<$count4;$y++){
    
echo"<tr style='text-align:center;word-wrap:break-word;center;font-size:18px;'>"; 
echo"<td style='font-size:11px;'>$Residencia3[$y]</td>";
echo"<td style='font-size:11px;'>$Nombres3[$y] $Apellidos2[$y]</td>";
echo"<td style='font-size:11px;'>$Tipocuota3[$y]</td>";
echo"<td style='font-size:11px;'>$ $Cuota3[$y]</td>";
echo"<td style='font-size:11px;'>$ $Pago3[$y]</td>";
echo"<td style='font-size:11px;'>$Estatuspagos[$y]</td>";
echo"</tr>";

}

echo"</table>"; 

}

?>

</div>
<div class="col-5 col-sm-5 col-md-5 col-lg-5 col-xl-5" style="text-align: center;">

</div>
</div>
<!--segunda fila-->    
<!--tabla de pagos-->    
</div>
<!--tabla de gastos-->
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<hr class="line_break1"> 
<div class="huge4" style="margin-left:15px;text-align: center;" >INFORMACIONES GENERALES DE GASTOS</div> 
<hr class="line_break2">
</div>
<div class="container-fluid">
<div class="row">
<div class="col-7 col-sm-7 col-md-7 col-lg-7 col-xl-7" style="text-align: center;">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 huge3"style="">INFORMACIONES DE GASTOS DEL MES</div>        
<?php 
mysqli_query($conn,"UPDATE gastos SET Totalreporte = Total WHERE Totalreporte IS NULL");
mysqli_query($conn,"UPDATE gastos SET Statusreporte = Status WHERE Statusreporte IS NULL");

mysqli_query($conn,"UPDATE gastos SET Mes = STR_TO_DATE(Fecha,'%Y-%m-%d')");

mysqli_query($conn,"UPDATE gastos SET Ano = STR_TO_DATE(Fecha,'%Y-%m-%d')");

mysqli_query($conn,"UPDATE gastos SET Mes = DATE_FORMAT(Mes, '%M')");

mysqli_query($conn,"UPDATE gastos SET Ano = DATE_FORMAT(Ano, '%Y')");


mysqli_query($conn,"UPDATE gastos SET Mes = 'Enero' WHERE Mes = 'January'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Febrero' WHERE Mes = 'February'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Marzo' WHERE Mes = 'March'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Abril' WHERE Mes = 'April'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Mayo' WHERE Mes = 'May'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Junio' WHERE Mes = 'June'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Julio' WHERE Mes = 'July'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Agosto' WHERE Mes = 'August'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Septiembre' WHERE Mes = 'September'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Octubre' WHERE Mes = 'October'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Noviembre' WHERE Mes = 'November'");
mysqli_query($conn,"UPDATE gastos SET Mes = 'Diciembre' WHERE Mes = 'December'");

$Tabla4 = mysqli_query($conn,"SELECT count(GastosID) AS num3 FROM gastos WHERE Mes ='$Mes' AND Ano = '$Ano' AND Condominio = '$Condominio' ");
while($row34 = mysqli_fetch_array($Tabla4)){
$count5 = $row34 ['num3'];  
}  

if($count5 == 0){ 
 echo"<img class='imagen4' src='dashboardimage/nodatos.png'>";    
}else{

echo"<table class='table table-striped' style='table-layout:fixed;'>";
			
				echo"<tr style='background: #436e8f; color: #fff;text-align: center;border: 1px solid #436e8f;vertical-align: middle'>";
					echo"<th class='align-middle' style='vertical-align: middle;'    width='20'>FECHA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='25'>SUPLIDOR</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='30'>CONCEPTO</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='25'>TOTAL</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>ESTATUS</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='30'>CONCILIACIÓN</th>";
				echo"</tr>";

$Tabla4x = mysqli_query($conn,"SELECT * FROM gastos WHERE Mes = '$Mes' AND Ano = '$Ano' AND Condominio = '$Condominio'");
while($row35 = mysqli_fetch_array($Tabla4x)){
$Fecha[] = $row35 ['Fecha'];
$Suplidor[] = $row35 ['Suplidor'];
$Concepto[] = $row35 ['Concepto'];
$Totalgastos[] = number_format($row35 ['Totalreporte'],2);
$Estatusgastos[] = $row35 ['Statusreporte'];
$Conciliacion[] = $row35 ['Conciliacion'];


}
 
   
for($i=0;$i<$count5;$i++){
    
echo"<tr style='text-align:center;word-wrap:break-word;center;font-size:18px;'>"; 
echo"<td style='font-size:11px;'>$Fecha[$i]</td>";
echo"<td style='font-size:11px;'>$Suplidor[$i]</td>";
echo"<td style='font-size:11px;'>$Concepto[$i]</td>";
echo"<td style='font-size:11px;'>$ $Totalgastos[$i]</td>";
echo"<td style='font-size:11px;'>$Estatusgastos[$i]</td>";
echo"<td style='font-size:11px;'>$Conciliacion[$i]</td>";
echo"</tr>";

}

echo"</table>"; 

}

?>     
</div>     
<div class="col-5 col-sm-5 col-md-5 col-lg-5 col-xl-5" style="text-align: center;">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 huge3">INFORMACIONES DE GASTOS PENDIENTES</div>      
<?php 

$Tabla5 = mysqli_query($conn,"SELECT count(GastosID) AS num4 FROM gastos WHERE Status = 'No Pagado' AND Condominio = '$Condominio' ");
while($row36 = mysqli_fetch_array($Tabla5)){
$count6 = $row36 ['num4'];  
}  

if($count6 == 0){ 
 echo"<img class='imagen4' src='dashboardimage/nodatos.png'>";    
}else{

echo"<table class='table table-striped' style='table-layout:fixed;'>";
			
				echo"<tr style='background: #436e8f; color: #fff;text-align: center;border: 1px solid #436e8f;vertical-align: middle'>";
					echo"<th class='align-middle' style='vertical-align: middle;'    width='20'>FECHA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='25'>SUPLIDOR</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='30'>CONCEPTO</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>TOTAL</th>";
				echo"</tr>";

$Tabla5x = mysqli_query($conn,"SELECT * FROM gastos WHERE Status = 'No Pagado' AND Condominio = '$Condominio'");
$count7 = mysqli_num_rows($Tabla5x); 
while($row37 = mysqli_fetch_array($Tabla5x)){
$Fecha2[] = $row37 ['Fecha'];
$Suplidor2[] = $row37 ['Suplidor'];
$Concepto2[] = $row37 ['Concepto'];
$Totalgastos2[] = number_format($row37 ['Total'],2);
}
 
   
for($x=0;$x<$count7;$x++){
    
echo"<tr style='text-align:center;word-wrap:break-word;center;font-size:18px;'>"; 
echo"<td style='font-size:11px;'>$Fecha2[$x]</td>";
echo"<td style='font-size:11px;'>$Suplidor2[$x]</td>";
echo"<td style='font-size:11px;'>$Concepto2[$x]</td>";
echo"<td style='font-size:11px;'>$ $Totalgastos2[$x]</td>";

echo"</tr>";

}

echo"</table>"; 

}

?>         
    
</div>      
</div>   
</div>
<!--tabla de gastos-->
<!--tabla de trabajos-->
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12" >
<hr class="line_break1"> 
<div class="huge4" style="margin-left:15px;text-align: center;" >INFORMACIONES GENERALES DE TRABAJOS</div> 
<hr class="line_break2">
</div>

<div class="container-fluid">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 p-1" style="text-align: center;">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 huge3" >INFORMACIONES DE TRABAJOS PENDIENTES </div>  
<?php 

$Tabla6 = mysqli_query($conn,"SELECT count(OrdenID) AS num5 FROM ordendetrabajo WHERE Status NOT IN ('Completada','Revisada','Cancelada') AND Condominio = '$Condominio'");
while($row38 = mysqli_fetch_array($Tabla6)){
$count7 = $row38 ['num5'];  
}  

if($count7 == 0){ 
 echo"<img class='imagen4' src='dashboardimage/nodatos.png'>";    
}else{

echo"<table class='table table-striped' style='table-layout:fixed;'>";
			
				echo"<tr style='background: #436e8f; color: #fff;text-align: center;border: 1px solid #436e8f;vertical-align: middle'>";
					echo"<th class='align-middle' style='vertical-align: middle;'    width='20'>No DE ORDEN</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>FECHA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='30'>TITULO</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>TIPO DE ORDEN</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='30'>DESCRIPCIÓN</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>FECHA INICIO PROGRAMADA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>FECHA FINAL PROGRAMADA</th>";
					echo"<th class='align-middle'  style='vertical-align: middle;'     width='20'>ESTATUS</th>";
				echo"</tr>";

$Tabla6x = mysqli_query($conn,"SELECT * FROM ordendetrabajo WHERE Status NOT IN ('Completada','Revisada','Cancelada') AND Condominio = '$Condominio'");
while($row39 = mysqli_fetch_array($Tabla6x)){
$OrdenID6[] = $row39 ['OrdenID'];
$Fecha6[] = date("Y-m-d",strtotime($row39 ['Fecha'])); 
$Titulo6[] = $row39 ['Titulo'];
$Tipodeorden6[] = $row39 ['Tipodeorden'];
$Descripcion6[] = $row39 ['Descripcion'];
$Fechadeinicio6[] = $row39 ['Fechadeinicio'];
$Fechafinal6[] = $row39 ['Fechafinal'];
$Estatus6[] = $row39 ['Status'];

}
 
   
for($i=0;$i<$count7;$i++){
    
echo"<tr style='text-align:center;word-wrap:break-word;center;font-size:18px;'>"; 
echo"<td style='font-size:11px;'>$OrdenID6[$i]</td>";
echo"<td style='font-size:11px;'>$Fecha6[$i]</td>";
echo"<td style='font-size:11px;'>$Titulo6[$i]</td>";
echo"<td style='font-size:11px;'>$Tipodeorden6[$i]</td>";
echo"<td style='font-size:11px;'>$Descripcion6[$i]</td>";
echo"<td style='font-size:11px;'>$Fechadeinicio6[$i]</td>";
echo"<td style='font-size:11px;'>$Fechafinal6[$i]</td>";
echo"<td style='font-size:11px;'>$Estatus6[$i]</td>";
echo"</tr>";

}

echo"</table>"; 

}

?>   
</div>
</div>
<!--tabla de trabajos-->
</div>
</div>
<!--Final-->
</div>






<div>
<!-- Modal -->
  <div class="modal fade p-5 " id="myModal" role="dialog" style="margin-top:-60px;">
    <div class="modal-dialog modal-dialog-centered">
    
      <!-- Modal content-->
      <div class="modal-content modal-sm text-center" >
       
        <div class="modal-body">
        	<img src="sximo5/images/send2.png" style="width: 40%;" />
          <H5>Proceso de Envío Completado !</H5>
          <button type="button" class="btn btn-default" data-dismiss="modal" style="border-color: #f29f41;margin-bottom: 1px;margin-top: 5px;font-size:13px;">Cerrar</button>
        </div>
        
      </div>
      
    </div>
  </div>
<!-- Modal -->
</div>





<script type="text/javascript" src="{{ asset('sximo5/js/jquery.js') }}"></script>
<script type="text/javascript" src="{{ asset('html2pdf.bundle.min.js') }}"></script>

<script> 


function generatePDF() {
 
 var email = '<?=$Email?>';
    console.log(email); 
    
  var condominio = '<?=$Condominio?>';
    console.log(condominio);  
    
  var mesano = '<?=$Mesano?>';
    console.log(mesano);   
 
 $("#myModal").modal('show');

let el = document.getElementById('reporte');
let opt = {
    margin:      [0.2, 0.1, 1, -0.7],
              filename:     'myfile.pdf',
              pagebreak: {avoid: 'tr'},
              image:        { type: 'jpeg', quality: 0.98 },
              html2canvas:  { scale: 2,width: 1200,windowWidth: 1024 },
              jsPDF:        { unit: 'in', format: 'letter', orientation: 'landscape' }
                                       };
html2pdf().set( opt ).from( el ).toPdf().output('datauristring').then(function( pdfAsString ) {
   
   // $("#myModal").modal('hide');
    
    let data = {'fileDataURI': pdfAsString, 'Email':email, 'Condominio':condominio, 'Mesano':mesano};
    $.post( "mail2.php", data);
    console.log( data );
} );
};
      
 
			
</script>



<style>
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@900&display=swap');

@media (max-width: 200px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:1000%;
 
transform: scale(.7, .7);


margin-top: -130px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-130px;

 }
}   

@media (min-width: 201px) and (max-width: 225px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:850%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 226px) and (max-width: 250px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:700%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  




@media (min-width: 251px) and (max-width: 275px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:600%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}   


@media (min-width: 276px) and (max-width: 300px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:525%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}   

@media (min-width: 301px) and (max-width: 325px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:450%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}   

@media (min-width: 326px) and (max-width: 350px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:430%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}   

@media (min-width: 351px) and (max-width: 375px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:390%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 376px) and (max-width:400px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:360%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 401px) and (max-width:425px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:330%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 426px) and (max-width:450px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:310%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
} 

@media (min-width: 451px) and (max-width:475px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:290%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 476px) and (max-width:500px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:270%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  


@media (min-width: 501px) and (max-width:525px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:250%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 526px) and (max-width:550px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:230%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 551px) and (max-width:575px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:210%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 576px) and (max-width:600px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:210%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
 
 
}  

@media (min-width: 601px) and (max-width:700px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:180%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
} 

@media (min-width: 701px) and (max-width:800px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:180%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 801px) and (max-width:900px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { width:153%;
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 901px) and (max-width:1000px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { 
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-155px;
margin-left:-155px;
margin-bottom:-120px;
 }
}  

@media (min-width: 1001px) and (max-width:1100px) {
.table-responsive {
   overflow-x: auto !important;}
 
 .x { 
 
transform: scale(.7, .7);

margin-top: -120px;
margin-right:-110px;
margin-left:-110px;
margin-bottom:-120px;
 }
}  



.table th{
font-weight:600;  
font-size:11px;

 } 

 
.huge2{

font-family: 'Rubik', sans-serif;
font-weight: 900;
letter-spacing: -2px;  
/*-webkit-text-stroke: 2px #808080;*/
font-size: 32px;
margin-top:-1px;
color: #7d7d7d;

}    
.huge3{

font-family: 'Rubik', sans-serif;
font-weight: 900;
letter-spacing: -1px;  
/*-webkit-text-stroke: 2px #808080;*/
font-size: 15px;
margin-top:-1px;
color: #7d7d7d;
margin-bottom:7px;

} 

.huge4{

font-family: 'Rubik', sans-serif;
font-weight: 700;
letter-spacing: 0px;  
/*-webkit-text-stroke: 2px #808080;*/
font-size: 16px;
margin-top:5px;
color: #4879a1;
margin-bottom:15px;
text-shadow:0px 0px 2px #3b3b3b;
}       



.line_break1{
    width:100%;
    float: left;
    border-bottom: 1px solid #4879a1;
    margin-bottom: 6px;
    
 }
    
    .line_break2{
    width:100%;
    float: left;
    border-bottom: 1px solid #4879a1;
    margin-top:-11px;    
        
    }    
    
    
    
</style>
@endsection
