Rev 3 | Rev 16891 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
<?php$acl = $this->viewModel()->getRoot()->getVariable('acl');$currentUser = $this->currentUserHelper();$routeReports = $this->url('microlearning/reports/progress');$roleName = $currentUser->getUserTypeId();$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.js'));$this->headStyle()->captureStart();echo <<<CSS#tableStudents {display: flex;flex-flow: column;width: 100%;}#tableStudents thead {flex: 0 0 auto;}#tableStudents tbody {flex: 1 1 auto;display: block;overflow-y: auto;overflow-x: hidden;}#tableStudents tr {width: 100%;display: table;table-layout: fixed;}CSS;$this->headStyle()->captureEnd();$this->inlineScript()->captureStart();echo <<<JSjQuery( document ).ready(function( $ ) {$.fn.changeFilter = function() {NProgress.start();$.ajax({'dataType' : 'json','accept' : 'application/json','method' : 'get','url' : $('#form-filter').attr('action'),'data' : $('#form-filter').serialize(),}).done(function(response) {if(response['success']) {$('#tableStudents tbody').empty();$('#tableStudents tbody').append($( "#progressRowTemplate" ).render( response['data'] ));} else {if(jQuery.type(response['data']) == 'string') {$.fn.showError(response['data']);} else {$.each(response['data'], function( fieldname, errors ) {$.fn.showFormErrorValidator('#form-slide-video-edit #' + fieldname, errors);});}}}).fail(function( jqXHR, textStatus, errorThrown) {$.fn.showError(textStatus);}).always(function() {NProgress.done();});return false;}$('#form-filter #company_id').change(function(e) {e.preventDefault();$.fn.changeFilter();});$('#form-filter #function_id').change(function(e) {e.preventDefault();$.fn.changeFilter();});$('#form-filter #group_id').change(function(e) {e.preventDefault();$.fn.changeFilter();});$('#form-filter #institution_id').change(function(e) {e.preventDefault();$.fn.changeFilter();});$('#form-filter #program_id').change(function(e) {e.preventDefault();$.fn.changeFilter();});$('#form-filter #partner_id').change(function(e) {e.preventDefault();$.fn.changeFilter();});$('#form-filter #sector_id').change(function(e) {e.preventDefault();$.fn.changeFilter();});$('#form-filter #student_type_id').change(function(e) {e.preventDefault();$.fn.changeFilter();});$.fn.changeFilter();});JS;$this->inlineScript()->captureEnd();?><!-- Content Header (Page header) --><section class="content-header"><div class="container-fluid"><div class="row mb-2"><div class="col-sm-12"><h1>LABEL_PROGRESS</h1></div></div></div><!-- /.container-fluid --></section><section class="content"><div class="container-fluid"><div class="row"><div class="col-12"><div class="card card-primary collapsed-card"><div class="card-header"><h3 class="card-title">LABEL_FILTERS</h3><div class="card-tools"><button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fa fa-filter"></i></button></div><!-- /.card-tools --></div><!-- /.card-header --><div class="card-body"><form name="form-filter" id="form-filter" action="<?php echo $routeReports ?>"><?php$fields = [['label' => 'LABEL_COMPANIES','name' => 'company_id',],['label' => 'LABEL_FUNCTIONS','name' => 'function_id',],['label' => 'LABEL_GROUPS','name' => 'group_id',],['label' => 'LABEL_INSTITUTIONS','name' => 'institution_id',],['label' => 'LABEL_PROGRAMS','name' => 'program_id',],['label' => 'LABEL_PARTNERS','name' => 'partner_id',],['label' => 'LABEL_SECTORS','name' => 'sector_id',],['label' => 'LABEL_STUDENT_TYPES','name' => 'student_type_id',],];$column = 0;foreach($fields as $field) :if($column == 0) {echo '<div class="row">';}$column++;?><div class="col-md-6 col-sm-12"><div class="form-group"><?php$element = $form->get( $field['name'] );$element->setOptions(['label' => $field['label'] ]);$element->setAttributes(['class' => 'form-control']);echo $this->formLabel($element);echo $this->formSelect($element);?></div></div><?phpif($column == 2) {$column = 0;echo '</div>';}?><?php endforeach; ?><?php if($column) {echo '</div>';}?></form></div><!-- /.card-body --></div></div></div><div class="row"><div class="col-12"><div class="card"><!-- /.card-header --><div class="card-body p-0"><table class="table table-responsive" id="tableStudents" ><thead><tr><th style="width: 40%"> LABEL_REPORTS_STUDENT</th><th style="width: 20%">LABEL_CAPSULES</th><th style="width: 20%">LABEL_DATE</th><th style="width: 12%">LABEL_REPORTS_PROGRESS</th><th style="width: 8%" class="text-right">%</th></tr></thead><tbody></tbody></table></div><!-- /.card-body --></div></div></div></div></section><script id="progressRowTemplate" type="text/x-jsrender"><tr><td style="width: 40%">{{>first_name}} {{>last_name}}<br>{{>email}}</td><td style="width: 20%">LABEL_REPORTS_CAPSULES_TOTAL : {{>total_capsules}}<br>LABEL_REPORTS_CAPSULES_COMPLETED : {{>total_capsules_completed}}<br>LABEL_REPORTS_CAPSULES_INCOMPLETED : {{>total_capsules_incomplete}}</td><td style="width: 20%">LABEL_REPORTS_FIRST_DATE<br>{{>first_date}} {{>first_time}}<br>LABEL_REPORTS_LAST_DATE<br>{{>last_date}} {{>last_time}}</td><td style="width: 12%"><div class="progress progress-xs progress-striped active"><div class="progress-bar bg-primary" style="width: {{>total_capsules_percentaje}}%"></div></div></td><td style="width: 8%" class="text-right">{{>total_capsules_percentaje}}</td></tr></script>