Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("../../capaDatos/conexion.php");
- $conect = new Conexion();
- $link = $conect->conectar();
- $logrado="L";
- $nologrado="NL";
- $codigoCurso = "1324";
- $sql = " select codCurso, count(estado) as Logrado , (Select count(estado) from estadisticas where estado='$nologrado' and codCurso='$codigoCurso') as NoLogrado from estadisticas where estado='$logrado' and codCurso='$codigoCurso' ";
- $result = mysqli_query($link ,$sql) or die (mysqli_error());
- $rows = array();
- $tabla = array();
- $tabla['col'] = array(
- array('label' => 'codCurso', 'type' => 'string'),
- array('label' => 'Logrado', 'type' => 'number'),
- array('label' => 'No Logrado', 'type' => 'number')
- );
- $rows = array();
- while($r = mysqli_fetch_assoc($result) ) {
- $temp = array();
- // the following line will be used to slice the Pie chart
- $temp[] = array('v' => (string) $r['codCurso']);
- // Values of each slice
- $temp[] = array('v' => (int) $r['Logrado']);
- $temp[] = array('v' => (int) $r['NoLogrado']);
- $rows[] = array('c' => $temp);
- }
- $tabla['rows'] = $rows;
- $jsonTable = json_encode($tabla);
- //echo $jsonTable;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement