Skip to content

Commit

Permalink
#29 grafico generales
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioviera committed Mar 4, 2020
1 parent a7f87de commit cfb7047
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 5 deletions.
2 changes: 1 addition & 1 deletion protected/controllers/ReportesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function actionDiagramaCaja($pnivel, $pcargo, $pcarrera, $pdepartamento)
$where = 'ap.cargo = \''.$pcargo.'\'';

if($pnivel AND $pcargo!='Laboratorio'){
$titulo .= $pnivel.' de nivel ';
$titulo .= ' de '.$pnivel.' nivel ';
$where .= ' and a.nivel = '.$pnivel;
}

Expand Down
1 change: 1 addition & 0 deletions protected/views/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
)),
array('label' => 'Reportes', 'url' => array(''),
'items' => array(
array('label'=>'Generales', 'url'=>array('/reportes/diagramacaja', 'pnivel'=>'', 'pcargo'=>'Titular', 'pcarrera'=>'', 'pdepartamento'=>'', )),
array('label'=>'Datos Generales', 'url'=>array('/reportes/index', 'view'=>'about')),
array('label'=>'Avances', 'url'=>array('/reportes/avances', 'view'=>'about')),
array('label'=>'Generales x Encuestas', 'url'=>array('/reportes/generalesPorEncuestas', 'view'=>'about')),
Expand Down
80 changes: 76 additions & 4 deletions protected/views/reportes/diagramaCaja.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,82 @@
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<?php $this->breadcrumbs=array('Reportes');
$this->menu=array();?>

<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Filtros</h3>
</div>
<div class="panel-body">
<form action="diagramacaja" method="GET" class="form-horizontal">
<div class="form-group">
<label class="control-label col-md-2">Nivel</label>
<div class="col-md-10">
<select class="form-control" name="pnivel" id="pnivel">
<option value="">Todos</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Cargo</label>
<div class="col-md-10">
<select class="form-control" name="pcargo" id="pcargo">
<option>Titular</option>
<option>Auxiliar</option>
<option>Laboratorio</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Carrera</label>
<div class="col-md-10">
<select class="form-control" name="pcarrera" id="pcarrera">
<option value="">Todos</option>
<option value="7">Eléctrica</option>
<option value="17">Mecánica</option>
<option value="27">Química</option>
<option value="5">Sistemas</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Departamento</label>
<div class="col-md-10">
<select class="form-control" name="pdepartamento" id="pdepartamento">
<option value="">Todos</option>
<option value="17">Básicas</option>
<option value="15">Eléctrica</option>
<option value="16">Mecánica</option>
<option value="4">Química</option>
<option value="12">Sistemas</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Aplicar Filtros</button>
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">
function selectElement(id, valueToSelect) {
let element = document.getElementById(id);
element.value = valueToSelect;
}

selectElement('pnivel', '<?php echo $_GET['pnivel']; ?>');
selectElement('pcargo', '<?php echo $_GET['pcargo']; ?>');
selectElement('pcarrera', '<?php echo $_GET['pcarrera']; ?>');
selectElement('pdepartamento', '<?php echo $_GET['pdepartamento']; ?>');

</script>

<?php
$plotValues='';
$tickvals='[';
Expand Down Expand Up @@ -43,9 +119,6 @@
}

?>
<?php if ( isset($asignaturaProfesor) and !empty($asignaturaProfesor) ){ ?>
<input type="button" value="Volver" onclick="history.back()" class="btn btn-success pull-right" />
<?php } ?>
<div class="row">
<h2><?php echo $titulo ?></h2>
<h3>Particiación</h3>
Expand Down Expand Up @@ -86,7 +159,6 @@
Plotly.newPlot('plot-result', data, layout);
</script>

<input type="button" value="Volver" onclick="history.back()" class="btn btn-success pull-right" />
<style>
.plot .boxlayer .boxes .box{stroke-width: 3px !important;}
</style>

0 comments on commit cfb7047

Please sign in to comment.