<?php
session_start();
require('../Operaciones/Cliente_operacion.php');
if(isset($_SESSION['Login'])){
$Id	=$_SESSION['Login'];
}else {
	session_start();
	session_destroy();
	header('location: ../Salir.php');
}

$Esta_Basica= new Cliente_P();
$dato=$Esta_Basica->Estadistica_Ini($Id);

?>
<head>
<meta charset="utf-8">
<html>
<script type="text/javascript">
      google.charts.load('current', {'packages':['corechart']});
      google.charts.setOnLoadCallback(drawChart);
	 
      function drawChart() {
		let Gen_ = parseInt('<?php echo $dato['Folios'];?>');
		let Usd_ = parseInt('<?php echo $dato['Usados'];?>');
		let Can_ = parseInt('<?php echo $dato['Cancelados'];?>');
		let Inc_ = parseInt('<?php echo $dato['Incompletos'];?>');
		let Tit_ = ((Gen_ - Usd_ - Can_ - Inc_)==0 ? 'Sin Folios Disponibles' : '');
        let data = google.visualization.arrayToDataTable([
          ['Folios Asig', 'Folios usados'],
          ['Asignados', (Gen_ - Usd_ - Can_ - Inc_)],
          ['Usados ', Usd_],
		  ['Cancelados ', Can_],
		  ['Incompletos ', Inc_]
        ]);

        let options = {
          title: '= Uso de Folios =',
		  is3D: true,
        };

        let chart = new google.visualization.PieChart(document.getElementById('piechart'));

        chart.draw(data, options);
      }
    </script>
<body>
   <div id="piechart" style="width: 352px; height: 225px;"></div>
</body>
</html>
