Create M.A.S.A Version 1.0
This commit is contained in:
57
app/partials/report/course_assist.controller.js
Normal file
57
app/partials/report/course_assist.controller.js
Normal file
@@ -0,0 +1,57 @@
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('app.reports')
|
||||
.controller('CourseAssistCtrl', CourseAssistCtrl)
|
||||
|
||||
CourseAssistCtrl.$inject =
|
||||
['$scope', '$rootScope', '$state', 'professors', '$modal', 'selectedCourse'];
|
||||
function CourseAssistCtrl($scope, $rootScope, $state, professors, $modal, selectedCourse) {
|
||||
var vm = this;
|
||||
var professorid = $rootScope.professorId;
|
||||
vm.course = null;
|
||||
vm.lectures = 0;
|
||||
vm.percentage = 0;
|
||||
vm.positive = 0;
|
||||
vm.professor = null;
|
||||
vm.negative = 0;
|
||||
|
||||
professors.get({ id: professorid },
|
||||
function (successResult){
|
||||
vm.professor = successResult;
|
||||
angular.forEach (vm.professor.courses,
|
||||
function (value, key){
|
||||
if (value._id == selectedCourse._id ) {
|
||||
selectedCourse.index = key;
|
||||
vm.course = value;
|
||||
}
|
||||
});
|
||||
|
||||
angular.forEach (vm.course.sections,
|
||||
function (value){
|
||||
angular.forEach (value.students,
|
||||
function (valued){
|
||||
vm.lectures = valued.assistance;
|
||||
angular.forEach (valued.assistanceTotal,
|
||||
function (valueda){
|
||||
if (valueda.assistance) {
|
||||
vm.positive++;
|
||||
} else {
|
||||
vm.negative++;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
vm.total = vm.positive + vm.negative;
|
||||
vm.percentage = ((vm.positive/vm.total)/vm.lectures)*100;
|
||||
},
|
||||
function (){
|
||||
console.log("Error al obtener los datos.");
|
||||
});
|
||||
|
||||
vm.back = function (index) {
|
||||
$state.go('courseReport');
|
||||
};
|
||||
};
|
||||
})();
|
16
app/partials/report/course_assist.html
Normal file
16
app/partials/report/course_assist.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="row clearfix col-md-12">
|
||||
<h4>Asistencia de Materia {{vm.course.name}}</h4>
|
||||
<br>
|
||||
</br>
|
||||
<div class= "row clearfix col-md-12">
|
||||
<div> Estadisticas </div>
|
||||
<div> Porcentaje de Asistencia: {{vm.percentage}} % </div>
|
||||
<div> Total de Dias de Clase: {{vm.lectures}} </div>
|
||||
</div>
|
||||
<button class = "btn-warning btn"
|
||||
type = "button"
|
||||
style = "margin: 10px"
|
||||
ng-click = "vm.back()">
|
||||
Regresar
|
||||
</button>
|
||||
</div>
|
43
app/partials/report/course_report.controller.js
Normal file
43
app/partials/report/course_report.controller.js
Normal file
@@ -0,0 +1,43 @@
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('app.reports')
|
||||
.controller('CourseReportCtrl', CourseReportCtrl)
|
||||
|
||||
CourseReportCtrl.$inject =
|
||||
['$scope', '$rootScope', '$state', 'professors', '$modal', 'profesorSeleccionado', 'selectedCourse'];
|
||||
function CourseReportCtrl($scope, $rootScope, $state, professors, $modal, profesorSeleccionado, selectedCourse) {
|
||||
var vm = this;
|
||||
var professorid = $rootScope.professorId;
|
||||
|
||||
professors.get({ id: professorid },
|
||||
function (successResult){
|
||||
vm.professor = successResult;
|
||||
vm.course = vm.professor.courses;
|
||||
},
|
||||
function (){
|
||||
console.log("Error al obtener los datos.");
|
||||
});
|
||||
|
||||
vm.courseReports = function (index) {
|
||||
selectedCourse._id = vm.course[index]._id;
|
||||
$state.go('courseAssist');
|
||||
};
|
||||
|
||||
vm.listSections = function (index) {
|
||||
selectedCourse._id = vm.course[index]._id;
|
||||
$state.go('sectionReport');
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$scope.modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$scope.modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
})();
|
53
app/partials/report/course_report.html
Normal file
53
app/partials/report/course_report.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<div class="row clearfix">
|
||||
<h4>Reportes de Materias</h4>
|
||||
<br>
|
||||
</br>
|
||||
<div>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%" style="text-align: center">
|
||||
Código
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Nombre
|
||||
</th>
|
||||
<th width="5%" style="text-align: center">
|
||||
Creditos
|
||||
</th>
|
||||
<th width="40%" style="text-align: center">
|
||||
Descripción
|
||||
</th>
|
||||
<th width="15%" style="text-align: center">
|
||||
Reportes de Materia
|
||||
</th>
|
||||
<th width="10%" style="text-align: center">
|
||||
Secciones
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="course in vm.course">
|
||||
<td style="vertical-align:middle">{{ course.code }}</td>
|
||||
<td style="vertical-align:middle">{{ course.name }}</td>
|
||||
<td style="vertical-align:middle">{{ course.credits }}</td>
|
||||
<td style="vertical-align:middle">{{ course.description }}</td>
|
||||
<td style="text-align: center">
|
||||
<span
|
||||
class="glyphicon glyphicon-list-alt"
|
||||
aria-hidden="true"
|
||||
ng-click="vm.courseReports($index)"
|
||||
style="cursor:pointer"></span>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<span
|
||||
class="glyphicon glyphicon-list"
|
||||
aria-hidden="true"
|
||||
ng-click="vm.listSections($index)"
|
||||
style="cursor:pointer"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@@ -1,105 +0,0 @@
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('app.reports')
|
||||
.controller('poblacionNacimientoCtrl', poblacionNacimientoCtrl)
|
||||
.controller('poblacionActivaCtrl', poblacionActivaCtrl)
|
||||
.controller('hombresEdadCtrl', hombresEdadCtrl)
|
||||
.controller('mujeresEdadCtrl', mujeresEdadCtrl)
|
||||
.controller('comidasDiaCtrl', comidasDiaCtrl)
|
||||
.controller('nivelEducacionCtrl', nivelEducacionCtrl)
|
||||
.controller('serviciosHogaresCtrl', serviciosHogaresCtrl)
|
||||
.controller('ingresosAnualesCtrl', ingresosAnualesCtrl)
|
||||
|
||||
poblacionNacimientoCtrl.$inject = ['$rootScope', 'ReportJson'];
|
||||
function poblacionNacimientoCtrl($rootScope, ReportJson){
|
||||
|
||||
$rootScope.labelPoblacionNacimiento = ['Extranjeros', 'Residentes'];
|
||||
ReportJson.get({id:$rootScope.elementId}, function(data) {
|
||||
|
||||
$rootScope.dataPoblacionNacimiento = data.Data[0].dataPoblacionNacimiento;
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
poblacionActivaCtrl.$inject = ['$rootScope', 'ReportJson'];
|
||||
function poblacionActivaCtrl($rootScope, ReportJson){
|
||||
|
||||
$rootScope.labelsPoblacionActiva = ['Hombres', 'Mujeres'];
|
||||
$rootScope.seriesPoblacionActiva = ['Economicamente Pasivos', 'Economicamente Activos'];
|
||||
$rootScope.dataPoblacionActiva = [];
|
||||
|
||||
ReportJson.get({id:$rootScope.elementId},function(data) {
|
||||
|
||||
$rootScope.dataPoblacionActiva = data.Data[0].dataPoblacionActiva;
|
||||
});
|
||||
};
|
||||
|
||||
hombresEdadCtrl.$inject = ['$rootScope', 'ReportJson'];
|
||||
function hombresEdadCtrl($rootScope, ReportJson){
|
||||
$rootScope.labelsHombresEdad = ['0-6', '7-12','13-18', '19-25','26-44', '45-60','61-99', '80-84', '90+'];
|
||||
$rootScope.seriesHombresEdad = ['Hombres por Generacion'];
|
||||
$rootScope.dataHombresEdad = [];
|
||||
|
||||
ReportJson.get({id:$rootScope.elementId},function(data) {
|
||||
|
||||
$rootScope.dataHombresEdad = data.Data[0].dataHombresEdad;
|
||||
});
|
||||
};
|
||||
|
||||
mujeresEdadCtrl.$inject = ['$rootScope', 'ReportJson'];
|
||||
function mujeresEdadCtrl($rootScope, ReportJson){
|
||||
$rootScope.labelsMujeresEdad = ['0-6', '7-12','13-18', '19-25','26-44', '45-60','61-99', '80-84', '90+'];
|
||||
$rootScope.seriesMujeresEdad = ['Mujeres por Generacion'];
|
||||
$rootScope.dataMujeresEdad = [];
|
||||
|
||||
ReportJson.get({id:$rootScope.elementId},function(data) {
|
||||
|
||||
$rootScope.dataMujeresEdad = data.Data[0].dataMujeresEdad;
|
||||
});
|
||||
};
|
||||
|
||||
comidasDiaCtrl.$inject = ['$rootScope', 'ReportJson'];
|
||||
function comidasDiaCtrl($rootScope, ReportJson){
|
||||
$rootScope.labelsComidasDia = ['Desayuno', 'Almuerzo', 'Cena'];
|
||||
$rootScope.dataComidasDia = [];
|
||||
|
||||
ReportJson.get({id:$rootScope.elementId},function(data) {
|
||||
|
||||
$rootScope.dataComidasDia = [data.Data[0].dataComidasDia];
|
||||
});
|
||||
};
|
||||
|
||||
nivelEducacionCtrl.$inject = ['$rootScope', 'ReportJson'];
|
||||
function nivelEducacionCtrl($rootScope, ReportJson){
|
||||
$rootScope.labelsNivelEducacion = ['Nivel de Educacion Superior', 'Nivel de Educacion Media'];
|
||||
|
||||
ReportJson.get({id:$rootScope.elementId},function(data) {
|
||||
|
||||
$rootScope.dataNivelEducacion = data.Data[0].dataNivelEducacion;
|
||||
});
|
||||
};
|
||||
|
||||
serviciosHogaresCtrl.$inject = ['$rootScope', 'ReportJson'];
|
||||
function serviciosHogaresCtrl($rootScope, ReportJson){
|
||||
$rootScope.labelsServiciosHogares = ['Agua', 'Gas', 'Electricidad' , 'Linea Telefonica'];
|
||||
$rootScope.dataServiciosHogares = [];
|
||||
|
||||
ReportJson.get({id:$rootScope.elementId},function(data) {
|
||||
|
||||
$rootScope.dataServiciosHogares = [data.Data[0].dataServiciosHogares];
|
||||
});
|
||||
};
|
||||
|
||||
ingresosAnualesCtrl.$inject = ['$rootScope', 'ReportJson'];
|
||||
function ingresosAnualesCtrl($rootScope, ReportJson){
|
||||
$rootScope.labelsIngresosAnuales = ['Menos de 10.000', 'De 11.000 a 20.000', 'De 21.000 a 35.000' , 'De 35.000 a 50.000'];
|
||||
|
||||
ReportJson.get({id:$rootScope.elementId},function(data) {
|
||||
|
||||
$rootScope.dataIngresosAnuales = data.Data[0].dataIngresosAnuales;
|
||||
});
|
||||
};
|
||||
|
||||
})();
|
@@ -1,116 +0,0 @@
|
||||
<section>
|
||||
<div class="page-header">
|
||||
<h1>Reportes</h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-12 ng-scope"
|
||||
ng-controller="poblacionNacimientoCtrl">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Reporte Alumno
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="chart-container">
|
||||
<canvas class="chart chart-pie"
|
||||
chart-data="dataPoblacionNacimiento"
|
||||
chart-labels="labelPoblacionNacimiento"></canvas>
|
||||
<chart-legend>
|
||||
<ul class="line-legend">
|
||||
<li><span style="background-color:rgba(151,187,205,1)"></span>{{'TAG_FOREIGN' }} </li>
|
||||
<li><span style="background-color:rgba(220,220,220,1)"></span>{{'TAG_RESIDENT' }} </li>
|
||||
</ul>
|
||||
</chart-legend>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-12 code">
|
||||
<div class="ng-isolate-scope">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-12 code">
|
||||
<div class="ng-isolate-scope">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-12 ng-scope"
|
||||
ng-controller="poblacionActivaCtrl">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Reporte por Clase
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="chart-container">
|
||||
<canvas class="chart chart-bar"
|
||||
chart-data="dataPoblacionActiva"
|
||||
chart-labels="labelsPoblacionActiva"
|
||||
chart-series="seriesPoblacionActiva"></canvas>
|
||||
<chart-legend>
|
||||
<ul class="line-legend">
|
||||
<li><span style="background-color:rgba(151,187,205,1)"></span>{{'TAG_ECONOMIC_PASSIVE' }} </li>
|
||||
<li><span style="background-color:rgba(220,220,220,1)"></span>{{'TAG_ECONOMIC_ACTIVE' }} </li>
|
||||
</ul>
|
||||
</chart-legend>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-12 code">
|
||||
<div class="ng-isolate-scope">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-12 ng-scope"
|
||||
ng-controller="hombresEdadCtrl">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Reporte por Sección
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="chart-container">
|
||||
<canvas class="chart chart-bar"
|
||||
chart-data="dataHombresEdad"
|
||||
chart-labels="labelsHombresEdad"
|
||||
chart-series="seriesHombresEdad"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-12 code">
|
||||
<div class="ng-isolate-scope">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-12 ng-scope"
|
||||
ng-controller="mujeresEdadCtrl">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Reporte por Materia
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="chart-container">
|
||||
<canvas class="chart chart-bar"
|
||||
chart-data="dataMujeresEdad"
|
||||
chart-labels="labelsMujeresEdad"
|
||||
chart-series="seriesMujeresEdad"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-12 code">
|
||||
<div class="ng-isolate-scope">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -14,68 +14,110 @@
|
||||
|
||||
getRoutes.$inject = ['$stateProvider', '$urlRouterProvider'];
|
||||
function getRoutes($stateProvider, $urlRouterProvider){
|
||||
$urlRouterProvider.otherwise('/reportes');
|
||||
$urlRouterProvider.otherwise('/reportesPorMateria');
|
||||
|
||||
$stateProvider
|
||||
|
||||
.state('poblacionNacimiento', {
|
||||
url: '/reportes',
|
||||
.state('courseReport', {
|
||||
url: '/reportesPorMateria',
|
||||
views: {
|
||||
sidebar: {
|
||||
templateUrl: 'partials/sidebar/sidebar.html',
|
||||
controller: 'sidebarCtrl'
|
||||
templateUrl: 'partials/sidebar/sidebar.html',
|
||||
controller: 'SidebarCtrl'
|
||||
},
|
||||
navbar: {
|
||||
templateUrl: 'partials/sidebar/navbar.html'
|
||||
templateUrl: 'partials/sidebar/navbar.html'
|
||||
},
|
||||
content: {
|
||||
templateUrl: 'partials/reportes/reportes.html',
|
||||
controller: 'poblacionNacimientoCtrl',
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
templateUrl: 'partials/report/course_report.html',
|
||||
controller: 'CourseReportCtrl',
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('poblacionActiva', {
|
||||
url: '/poblacionActivaCtrl',
|
||||
templateUrl: 'partials/reportes/reportes.html',
|
||||
controller: 'poblacionActivaCtrl',
|
||||
controllerAs: 'vm'
|
||||
.state('sectionReport', {
|
||||
url: '/reportesPorSeccion',
|
||||
views: {
|
||||
sidebar: {
|
||||
templateUrl: 'partials/sidebar/sidebar.html',
|
||||
controller: 'SidebarCtrl'
|
||||
},
|
||||
navbar: {
|
||||
templateUrl: 'partials/sidebar/navbar.html'
|
||||
},
|
||||
content: {
|
||||
templateUrl: 'partials/report/section_report.html',
|
||||
controller: 'SectionReportCtrl',
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('hombresEdad', {
|
||||
url: '/hombresEdad',
|
||||
templateUrl: 'partials/reportes/reportes.html',
|
||||
controller: 'hombresEdadCtrl',
|
||||
controllerAs: 'vm'
|
||||
.state('studentReport', {
|
||||
url: '/reportesPorEstudiante',
|
||||
views: {
|
||||
sidebar: {
|
||||
templateUrl: 'partials/sidebar/sidebar.html',
|
||||
controller: 'SidebarCtrl'
|
||||
},
|
||||
navbar: {
|
||||
templateUrl: 'partials/sidebar/navbar.html'
|
||||
},
|
||||
content: {
|
||||
templateUrl: 'partials/report/student_report.html',
|
||||
controller: 'StudentReportCtrl',
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('mujeresEdad', {
|
||||
url: '/mujeresEdad',
|
||||
templateUrl: 'partials/reportes/reportes.html',
|
||||
controller: 'mujeresEdadCtrl',
|
||||
controllerAs: 'vm'
|
||||
.state('studentAssist', {
|
||||
url: '/asistenciaPorEstudiante',
|
||||
views: {
|
||||
sidebar: {
|
||||
templateUrl: 'partials/sidebar/sidebar.html',
|
||||
controller: 'SidebarCtrl'
|
||||
},
|
||||
navbar: {
|
||||
templateUrl: 'partials/sidebar/navbar.html'
|
||||
},
|
||||
content: {
|
||||
templateUrl: 'partials/report/student_assist.html',
|
||||
controller: 'StudentAssistCtrl',
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('comidasDia', {
|
||||
url: '/comidasDia',
|
||||
templateUrl: 'partials/reportes/reportes.html',
|
||||
controller: 'comidasDiaCtrl',
|
||||
controllerAs: 'vm'
|
||||
.state('sectionAssist', {
|
||||
url: '/asistenciaPorSeccion',
|
||||
views: {
|
||||
sidebar: {
|
||||
templateUrl: 'partials/sidebar/sidebar.html',
|
||||
controller: 'SidebarCtrl'
|
||||
},
|
||||
navbar: {
|
||||
templateUrl: 'partials/sidebar/navbar.html'
|
||||
},
|
||||
content: {
|
||||
templateUrl: 'partials/report/section_assist.html',
|
||||
controller: 'SectionAssistCtrl',
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('nivelEducacion', {
|
||||
url: '/nivelEducacion',
|
||||
templateUrl: 'partials/reportes/reportes.html',
|
||||
controller: 'nivelEducacionCtrl',
|
||||
controllerAs: 'vm'
|
||||
})
|
||||
.state('serviciosHogares', {
|
||||
url: '/serviciosHogares',
|
||||
templateUrl: 'partials/reportes/reportes.html',
|
||||
controller: 'serviciosHogaresCtrl',
|
||||
controllerAs: 'vm'
|
||||
})
|
||||
.state('ingresosAnuales', {
|
||||
url: '/ingresosAnuales',
|
||||
templateUrl: 'partials/reportes/reportes.html',
|
||||
controller: 'ingresosAnualesCtrl',
|
||||
controllerAs: 'vm'
|
||||
.state('courseAssist', {
|
||||
url: '/asistenciaPorMateria',
|
||||
views: {
|
||||
sidebar: {
|
||||
templateUrl: 'partials/sidebar/sidebar.html',
|
||||
controller: 'SidebarCtrl'
|
||||
},
|
||||
navbar: {
|
||||
templateUrl: 'partials/sidebar/navbar.html'
|
||||
},
|
||||
content: {
|
||||
templateUrl: 'partials/report/course_assist.html',
|
||||
controller: 'CourseAssistCtrl',
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
})();
|
||||
|
@@ -3,14 +3,14 @@
|
||||
|
||||
angular
|
||||
.module('app.reports')
|
||||
.factory('ReportJson', ReportJson)
|
||||
//.factory('ReportJson', ReportJson)
|
||||
.value('id',{})
|
||||
|
||||
ReportJson.$inject = ['$resource','$rootScope'];
|
||||
/*ReportJson.$inject = ['$resource','$rootScope'];
|
||||
function ReportJson($resource, $rootScope){
|
||||
return $resource('http://'+$rootScope.domainUrl+'/api/reports/:id');
|
||||
//var json="data/data.json";
|
||||
//return $resource(json);
|
||||
};
|
||||
//return $resource('http://'+$rootScope.domainUrl+'/api/reports/:id');
|
||||
var json="data/data.json";
|
||||
return $resource(json);
|
||||
};*/
|
||||
|
||||
})();
|
54
app/partials/report/section_assist.controller.js
Normal file
54
app/partials/report/section_assist.controller.js
Normal file
@@ -0,0 +1,54 @@
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('app.reports')
|
||||
.controller('SectionAssistCtrl', SectionAssistCtrl)
|
||||
|
||||
SectionAssistCtrl.$inject =
|
||||
['$scope', '$rootScope','$state', 'professors', '$modal', 'selectedCourse', 'selectedSection', 'selectedStudent'];
|
||||
function SectionAssistCtrl($scope, $rootScope, $state, professors, $modal, selectedCourse, selectedSection, selectedStudent) {
|
||||
var vm = this;
|
||||
var professorid = $rootScope.professorId;
|
||||
vm.section = [];
|
||||
vm.lectures = 0;
|
||||
vm.percentage = 0;
|
||||
vm.positive = 0;
|
||||
vm.professor = null;
|
||||
vm.negative = 0;
|
||||
|
||||
professors.get({ id: professorid },
|
||||
function (successResult){
|
||||
vm.professor = successResult;
|
||||
angular.forEach (vm.professor.courses[selectedCourse.index].sections,
|
||||
function (value, key){
|
||||
if (value._id == selectedSection._id ) {
|
||||
selectedSection.index = key;
|
||||
vm.section = value;
|
||||
}
|
||||
});
|
||||
|
||||
angular.forEach (vm.section.students,
|
||||
function (value){
|
||||
vm.lectures = value.assistance;
|
||||
angular.forEach (value.assistanceTotal,
|
||||
function (valued){
|
||||
if (valued.assistance) {
|
||||
vm.positive++;
|
||||
} else {
|
||||
vm.negative++;
|
||||
}
|
||||
});
|
||||
});
|
||||
vm.total = vm.positive + vm.negative;
|
||||
vm.percentage = ((vm.positive/vm.total)/vm.lectures)*100;
|
||||
},
|
||||
function (){
|
||||
console.log("Error al obtener los datos.");
|
||||
});
|
||||
|
||||
vm.back = function (index) {
|
||||
$state.go('sectionReport');
|
||||
};
|
||||
};
|
||||
})();
|
16
app/partials/report/section_assist.html
Normal file
16
app/partials/report/section_assist.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="row clearfix col-md-12">
|
||||
<h4>Asistencia de Sección {{vm.section.name}}</h4>
|
||||
<br>
|
||||
</br>
|
||||
<div class= "row clearfix col-md-12">
|
||||
<div> Estadisticas </div>
|
||||
<div> Porcentaje de Asistencia: {{vm.percentage}} % </div>
|
||||
<div> Total de Dias de Clase: {{vm.lectures}} </div>
|
||||
</div>
|
||||
<button class = "btn-warning btn"
|
||||
type = "button"
|
||||
style = "margin: 10px"
|
||||
ng-click = "vm.back()">
|
||||
Regresar
|
||||
</button>
|
||||
</div>
|
56
app/partials/report/section_report.controller.js
Normal file
56
app/partials/report/section_report.controller.js
Normal file
@@ -0,0 +1,56 @@
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('app.reports')
|
||||
.controller('SectionReportCtrl', SectionReportCtrl)
|
||||
|
||||
SectionReportCtrl.$inject =
|
||||
['$scope', '$rootScope', '$state', 'professors', '$modal', 'profesorSeleccionado', 'selectedCourse', 'selectedSection'];
|
||||
function SectionReportCtrl($scope, $rootScope, $state, professors, $modal, profesorSeleccionado, selectedCourse, selectedSection) {
|
||||
var vm = this;
|
||||
var professorid = $rootScope.professorId;
|
||||
vm.section = [];
|
||||
vm.professor = null;
|
||||
|
||||
professors.get({ id: professorid },
|
||||
function (successResult){
|
||||
vm.professor = successResult;
|
||||
angular.forEach (vm.professor.courses,
|
||||
function (value, key){
|
||||
if (value._id == selectedCourse._id ) {
|
||||
vm.index = key;
|
||||
vm.section = value.sections;
|
||||
}
|
||||
});
|
||||
},
|
||||
function (){
|
||||
console.log("Error al obtener los datos.");
|
||||
});
|
||||
|
||||
vm.back = function (index) {
|
||||
$state.go('courseReport');
|
||||
};
|
||||
|
||||
vm.sectionReport = function (index) {
|
||||
selectedSection._id = vm.section[index]._id;
|
||||
selectedCourse.index = vm.index;
|
||||
$state.go('sectionAssist');
|
||||
};
|
||||
|
||||
vm.listStudents = function (index) {
|
||||
selectedSection._id = vm.section[index]._id;
|
||||
selectedCourse.index = vm.index;
|
||||
$state.go('studentReport');
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$scope.modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$scope.modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
||||
})();
|
57
app/partials/report/section_report.html
Normal file
57
app/partials/report/section_report.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<div class="row clearfix">
|
||||
<h4>Reportes de Secciones</h4>
|
||||
<br>
|
||||
</br>
|
||||
<div>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%" style="text-align: center">
|
||||
Sección
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Nombre de la Materia
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Codigo de la Materia
|
||||
</th>
|
||||
<th width="10%" style="text-align: center">
|
||||
Semestre
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Reportes por Sección
|
||||
</th>
|
||||
<th width="10%" style="text-align: center">
|
||||
Estudiantes
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat = "section in vm.section">
|
||||
<td style="vertical-align:middle">{{ section.name }}</td>
|
||||
<td style="vertical-align:middle">{{ section.course }}</td>
|
||||
<td style="vertical-align:middle">{{ section.code }}</td>
|
||||
<td style="vertical-align:middle">{{ section.semester }}</td>
|
||||
<td style="text-align: center">
|
||||
<span class="glyphicon glyphicon-list-alt"
|
||||
aria-hidden="true"
|
||||
ng-click="vm.sectionReport($index)"
|
||||
style="cursor:pointer"></span>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<span class="glyphicon glyphicon-list"
|
||||
aria-hidden="true"
|
||||
ng-click="vm.listStudents($index)"
|
||||
style="cursor:pointer"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<button class = "btn-warning btn"
|
||||
type = "button"
|
||||
style = "margin: 10px"
|
||||
ng-click = "vm.back()">
|
||||
Regresar
|
||||
</button>
|
||||
</div>
|
52
app/partials/report/student_assist.controller.js
Normal file
52
app/partials/report/student_assist.controller.js
Normal file
@@ -0,0 +1,52 @@
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('app.reports')
|
||||
.controller('StudentAssistCtrl', StudentAssistCtrl)
|
||||
|
||||
StudentAssistCtrl.$inject =
|
||||
['$scope', '$rootScope','$state', 'professors', '$modal', 'selectedCourse', 'selectedSection', 'selectedStudent'];
|
||||
function StudentAssistCtrl($scope, $rootScope, $state, professors, $modal, selectedCourse, selectedSection, selectedStudent) {
|
||||
var vm = this;
|
||||
var professorid = $rootScope.professorId;
|
||||
vm.section = [];
|
||||
vm.lectures = 0;
|
||||
vm.percentage = 0;
|
||||
vm.positive = 0;
|
||||
vm.professor = null;
|
||||
vm.negative = 0;
|
||||
|
||||
professors.get({ id: professorid },
|
||||
function (successResult){
|
||||
vm.professor = successResult;
|
||||
angular.forEach (vm.professor.courses[selectedCourse.index].sections[selectedSection.index].students,
|
||||
function (value, key){
|
||||
if (value._id == selectedStudent._id ) {
|
||||
selectedStudent.index = key;
|
||||
vm.assistances = value.assistanceTotal;
|
||||
vm.student = value;
|
||||
vm.lectures = value.assistance;
|
||||
}
|
||||
});
|
||||
|
||||
angular.forEach (vm.assistances,
|
||||
function (value){
|
||||
if (value.assistance) {
|
||||
vm.positive++;
|
||||
} else {
|
||||
vm.negative++;
|
||||
}
|
||||
});
|
||||
vm.total = vm.positive + vm.negative;
|
||||
vm.percentage = ((vm.positive/vm.total)/vm.lectures)*100;
|
||||
},
|
||||
function (){
|
||||
console.log("Error al obtener los datos.");
|
||||
});
|
||||
|
||||
vm.back = function (index) {
|
||||
$state.go('studentReport');
|
||||
};
|
||||
};
|
||||
})();
|
42
app/partials/report/student_assist.html
Normal file
42
app/partials/report/student_assist.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<div class="row clearfix col-md-6">
|
||||
<h4>Asistencia - {{vm.student.lastname}}, {{vm.student.name}}</h4>
|
||||
<br>
|
||||
</br>
|
||||
<div class= "row clearfix col-md-6">
|
||||
<div> Estadisticas </div>
|
||||
<div ng-style="vm.percentage < 75 && {'color': 'red'} || vm.percentage >76 && {'color': 'green'}"> Porcentaje de Asistencia: {{vm.percentage}} % </div>
|
||||
<div> Total de Dias de Clase: {{vm.lectures}} </div>
|
||||
<div> Total de Asistencias: {{vm.positive}} </div>
|
||||
<div> Total de Inasistencias: {{vm.negative}} </div>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%" style="text-align: center">
|
||||
Dia
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Asistencia
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="assistance in vm.assistances">
|
||||
<td style="vertical-align:middle">{{ assistance.day }}</td>
|
||||
<td ng-style="assistance.assistance === false && {'color': 'red'} || assistance.assistance === true && {'color': 'green'}"
|
||||
style="vertical-align:middle">{{ assistance.assistance }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<button class = "btn-warning btn"
|
||||
type = "button"
|
||||
style = "margin: 10px"
|
||||
ng-click = "vm.back()">
|
||||
Regresar
|
||||
</button>
|
||||
</div>
|
49
app/partials/report/student_report.controller.js
Normal file
49
app/partials/report/student_report.controller.js
Normal file
@@ -0,0 +1,49 @@
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('app.reports')
|
||||
.controller('StudentReportCtrl', StudentReportCtrl)
|
||||
|
||||
StudentReportCtrl.$inject =
|
||||
['$scope', '$rootScope', '$state', 'professors', '$modal', 'selectedCourse', 'selectedSection', 'selectedStudent'];
|
||||
function StudentReportCtrl($scope, $rootScope, $state, professors, $modal, selectedCourse, selectedSection, selectedStudent) {
|
||||
var vm = this;
|
||||
var professorid = $rootScope.professorId;
|
||||
vm.section = [];
|
||||
vm.professor = null;
|
||||
|
||||
professors.get({ id: professorid },
|
||||
function (successResult){
|
||||
vm.professor = successResult;
|
||||
angular.forEach (vm.professor.courses[selectedCourse.index].sections,
|
||||
function (value, key){
|
||||
if (value._id == selectedSection._id ) {
|
||||
selectedSection.index = key;
|
||||
vm.students = value.students;
|
||||
vm.section = value;
|
||||
}
|
||||
});
|
||||
},
|
||||
function (){
|
||||
console.log("Error al obtener los datos.");
|
||||
});
|
||||
|
||||
vm.studentReports = function (index) {
|
||||
selectedStudent._id = vm.students[index]._id;
|
||||
$state.go('studentAssist');
|
||||
};
|
||||
|
||||
vm.back = function (index) {
|
||||
$state.go('sectionReport');
|
||||
};
|
||||
|
||||
$scope.ok = function () {
|
||||
$scope.modalInstance.dismiss('cancel');
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$scope.modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
})();
|
44
app/partials/report/student_report.html
Normal file
44
app/partials/report/student_report.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<div class="row clearfix">
|
||||
<h4>Reportes de Estudiantes</h4>
|
||||
<br>
|
||||
</br>
|
||||
<div>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%" style="text-align: center">
|
||||
Cedula
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Nombre
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Apellido
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Reportes por Estudiante
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="student in vm.students">
|
||||
<td style="vertical-align:middle">{{ student.id }}</td>
|
||||
<td style="vertical-align:middle">{{ student.name }}</td>
|
||||
<td style="vertical-align:middle">{{ student.lastname }}</td>
|
||||
<td style="text-align: center">
|
||||
<span class="glyphicon glyphicon-list-alt"
|
||||
aria-hidden="true"
|
||||
ng-click="vm.studentReports($index)"
|
||||
style="cursor:pointer"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<button class = "btn-warning btn"
|
||||
type = "button"
|
||||
style = "margin: 10px"
|
||||
ng-click = "vm.back()">
|
||||
Regresar
|
||||
</button>
|
||||
</div>
|
Reference in New Issue
Block a user