
		
<?php include ("../conexion.php");

 ?>
 
 
<html>
	<head>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Principal</title>
		<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
		<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">



<script type="text/javascript" src="jquery-1.8.2.min.js"></script>



		<style type="text/css">
${demo.css}
		</style>
        
        <script src="highcharts.js"></script>
		<script src="exporting.js"></script>
		<script type="text/javascript">
		

  
		
$(function () {
    $('#container').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: 'Cartera Cuentas x Pagar'
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b>: {point.percentage:.1f} % <br> ( {point.y:,.0f} )</br>',
                    style: {
                        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                    }
                }
            }
        },
        series: [{
            type: 'pie',
            name: 'Vencimiento',
            data: [
			
			<?php
	
			
	       $sql=("SELECT SUM(al_dia) AS al_dia , SUM(0_15) AS 0_15, SUM(15_30) AS 15_30,SUM(30_60) AS 30_60, SUM(60_90) AS 60_90, SUM(90_mas) AS 90_mas FROM cartera_cxp " );
		if ($resultado = $mysqli->query($sql)) 

 
  				while ($res = $resultado->fetch_assoc()) {		
			
		
			?>
			
				['<?php echo "0 a 15 días"; ?>', <?php echo $res['0_15'] ?>],
				['<?php echo "15 a 30 días"; ?>', <?php echo $res['15_30'] ?>],
				['<?php echo "30 a 60 días"; ?>', <?php echo $res['30_60'] ?>],
				['<?php echo "60 a 90 días"; ?>', <?php echo $res['60_90'] ?>],
				['<?php echo "Más de 90 días"; ?>', <?php echo $res['90_mas'] ?>],
			    ['<?php echo "Al día"; ?>', <?php echo $res['al_dia'] ?>],
			<?php
			}
			?>	

            ]
        }]
    });
});


		</script>
	</head>
   
		<body onLoad=" enfoque_inicial(); nobackbutton(); ">
		<div id="">
		<div id="zonaContenido">
				<div align="center">
				  <div id="container" style="min-width: 330px; height: 349px; max-width: 600px; margin-top:5px; margin-left:0%"> 
				    <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>

</div>
              
		  </div>
	</div>
	</body>
</html>
