CVE-2022-4444 (published 2022-12-13T09:15Z)

A vulnerability was found in ipti br.tag. It has been declared as problematic. Affected by this vulnerability is an unknown functionality. The manipulation leads to cross site scripting. The attack can be launched remotely. Upgrading to version 2.13.0 is able to address this issue. The name of the patch is 7e311be22d3a0a1b53e61cb987ba13d681d85f06. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-215431.

CVSS v3 base score: 6.1, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N)

Weakness information:
cwe_id: CWE-79
cwe_name: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
extended_description: 
            Cross-site scripting (XSS) vulnerabilities occur when:
            
               Untrusted data enters a web application, typically from a web request.
               The web application dynamically generates a web page that contains this untrusted data.
               During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
               A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
               Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
               This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
            
            There are three main kinds of XSS:
            
               
                  Type 1: Reflected XSS (or Non-Persistent) - 
         			The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
               
                  Type 2: Stored XSS (or Persistent) - 
               The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
            
               
                  Type 0: DOM-Based XSS - 
               In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
            
            
            Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as "drive-by hacking."
            In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.
         
         

Fix information:
repo_url: https://github.com/ipti/br.tag
commit_details: repo_url: https://github.com/ipti/br.tag
author: Paulo
author_date: 2022-08-28 18:47:00-03:00
msg: Resolvido issues do XSS
repository: repo_url: https://github.com/ipti/br.tag
repo_name: ipti/br.tag
description: Software de apoio a gestão escolar baseado em Tecnologia Social
repo_language: PHP
owner: ipti
file_changes: filename: ClassesController.php
change_type: ModificationType.MODIFY
diff: @@ -301,14 +301,14 @@ function actionGetDisciplines()
                         left join instructor_identification ii on t.instructor_fk = ii.id 
                         where ii.users_fk = " . Yii::app()->user->loginInfos->id . " and t.classroom_id_fk = " . $crid . " order by d.name")->queryAll();
         foreach ($disciplines as $discipline) {
-            echo CHtml::tag('option', array('value' => $discipline['id']), CHtml::encode($disciplinesLabels[$discipline['id']]), true);
+            echo htmlspecialchars(CHtml::tag('option', array('value' => $discipline['id']), CHtml::encode($disciplinesLabels[$discipline['id']]), true));
         }
     } else {
         echo CHtml::tag('option', array('value' => ""), CHtml::encode('Selecione a disciplina'), true);
         $classr = Yii::app()->db->createCommand("select distinct discipline_fk from schedule join edcenso_discipline on edcenso_discipline.id = schedule.discipline_fk where classroom_fk = " . $crid . " order by edcenso_discipline.name")->queryAll();
         foreach ($classr as $i => $discipline) {
             if (isset($discipline['discipline_fk'])) {
-                echo CHtml::tag('option', array('value' => $discipline['discipline_fk']), CHtml::encode($disciplinesLabels[$discipline['discipline_fk']]), true);
+                echo htmlspecialchars(CHtml::tag('option', array('value' => $discipline['discipline_fk']), CHtml::encode($disciplinesLabels[$discipline['discipline_fk']]), true));
             }
         }
     }

programming_language: PHP
filename: calendar.js
change_type: ModificationType.MODIFY
diff: @@ -27,7 +27,7 @@ $(document).on("click", ".create-calendar", function () {
         }).success(function (data) {
             data = JSON.parse(data);
             if (!data.valid) {
-                form.find(".alert").html(data.error).show();
+                form.find(".alert").html(DOMPurify.sanitize(data.error)).show();
                 $("#myNewCalendar .centered-loading-gif").hide();
                 $("#myNewCalendar .modal-body").css("opacity", 1).css("pointer-events", "auto");
                 $("#myNewCalendar button").removeAttr("disabled");
@@ -68,7 +68,7 @@ $(document).on("click", ".edit-calendar-title-button", function () {
                 $(".calendar-container[data-id=" + $("#edit-calendar-title-modal").find("#Calendar_id").val() + "]").closest(".accordion-group").find(".accordion-title").text($("#edit-calendar-title-modal").find("#Calendar_title").val());
                 $("#edit-calendar-title-modal").modal("hide");
             } else {
-                $("#edit-calendar-title-modal").find(".alert").html(data.error).show();
+                $("#edit-calendar-title-modal").find(".alert").html(DOMPurify.sanitize(data.error)).show();
             }
         }).complete(function () {
             $("#edit-calendar-title-modal").find(".modal-body").css("opacity", 1).css("pointer-events", "auto");
@@ -106,7 +106,7 @@ $(document).on("click", ".remove-calendar-button", function () {
                 : $(".no-calendars-alert").show();
             $("#removeCalendar").modal("hide");
         } else {
-            $("#removeCalendar").find(".alert").html(data.error).show();
+            $("#removeCalendar").find(".alert").html(DOMPurify.sanitize(data.error)).show();
         }
     }).complete(function () {
         $("#removeCalendar .centered-loading-gif").hide();
@@ -137,7 +137,7 @@ $(document).on("click", ".remove-event-button", function () {
             eventDays.find(".calendar-icon").remove();
             $("#myChangeEvent").modal("hide");
         } else {
-            $("#myChangeEvent").find(".alert").html(data.error).show();
+            $("#myChangeEvent").find(".alert").html(DOMPurify.sanitize(data.error)).show();
         }
     }).complete(function () {
         $("#myChangeEvent .centered-loading-gif").hide();
@@ -238,12 +238,12 @@ $(document).on("click", ".save-event", function (e) {
                     date.attr("data-id", data.eventId).attr("data-toggle", "tooltip").attr("data-placement", "top").attr("data-original-title", data.eventName);
                     date.parent().addClass("calendar-" + data.color);
                     date.children(".calendar-icon").remove();
-                    date.prepend("<i class='calendar-icon fa " + data.icon + "'></i>");
+                    date.prepend("<i class='calendar-icon fa " + DOMPurify.sanitize(data.icon) + "'></i>");
                     $("#myChangeEvent").modal("hide");
                 });
                 $('[data-toggle="tooltip"]').tooltip({container: "body"});
             } else {
-                form.find(".alert").html(data.error).show();
+                form.find(".alert").html(DOMPurify.sanitize(data.error)).show();
             }
         }).complete(function () {
             $("#myChangeEvent .centered-loading-gif").hide();
@@ -320,7 +320,7 @@ $(document).on("click", ".change-calendar-status-button", function () {
             $(icon).tooltip({container: "body"});
             $("#changeCalendarStatus").modal("hide");
         } else {
-            $("#changeCalendarStatus").find(".alert").html(data.error).show();
+            $("#changeCalendarStatus").find(".alert").html(DOMPurify.sanitize(data.error)).show();
         }
     }).complete(function () {
         $("#changeCalendarStatus .centered-loading-gif").hide();

programming_language: JavaScript
filename: quiz.js
change_type: ModificationType.MODIFY
diff: @@ -1,4 +1,4 @@
-$('#save_button').click(function() { 
+$('#save_button').click(function() {
     $('#quiz-form').submit();
 });
 
@@ -9,10 +9,10 @@ $('#delete_button').click(function() {
         var action = 'index.php?' + (url.indexOf("update") == -1 ? url.replace('create','delete') : url.replace('update','delete'));
         $('#quiz-form').attr('action', action);
         $('#quiz-form').submit();
-    } 
+    }
 });
 
-$('#save_group_button').click(function() { 
+$('#save_group_button').click(function() {
     $('#group-form').submit();
 });
 
@@ -23,10 +23,10 @@ $('#delete_group_button').click(function() {
         var action = 'index.php?' + (url.indexOf("update") == -1 ? url.replace('create','delete') : url.replace('update','delete'));
         $('#group-form').attr('action', action);
         $('#group-form').submit();
-    } 
+    }
 });
 
-$('#save_question_group_button').click(function() { 
+$('#save_question_group_button').click(function() {
     $('#questiongroup-form').submit();
 });
 
@@ -37,11 +37,11 @@ $('#delete_question_group_button').click(function() {
         var action = 'index.php?' + (url.indexOf("update") == -1 ? url.replace('create','delete') : url.replace('update','delete'));
         $('#questiongroup-form').attr('action', action);
         $('#questiongroup-form').submit();
-    } 
+    }
 });
 
 
-$('#save_question_button').click(function() { 
+$('#save_question_button').click(function() {
     $('#question-form').submit();
 });
 
@@ -52,10 +52,10 @@ $('#delete_question_button').click(function() {
         var action = 'index.php?' + (url.indexOf("update") == -1 ? url.replace('create','delete') : url.replace('update','delete'));
         $('#question-form').attr('action', action);
         $('#question-form').submit();
-    } 
+    }
 });
 
-$('#save_answer_button').click(function() { 
+$('#save_answer_button').click(function() {
     $('#answer-form').submit();
 });
 
@@ -80,6 +80,9 @@ var Option = function(){
                     contentType: "application/json; charset=utf-8"
                   })
                 .done(function(data){
+                    data = JSON.stringify(data);
+                    data = DOMPurify.sanitize(data);
+                    data = JSON.parse(data);
                     if(typeof data.errorCode != 'undefined' && data.errorCode == '0'){
                         var element = $('<tr></tr>')
                             .attr({'option-id': data.id, 'option-description': data.description, 'option-answer': data.answer, 'option-complement': data.complement})
@@ -109,6 +112,9 @@ var Option = function(){
                     contentType: "application/json; charset=utf-8"
                   })
                 .done(function(data){
+                    data = JSON.stringify(data);
+                    data = DOMPurify.sanitize(data);
+                    data = JSON.parse(data);
                     if(typeof data.errorCode != 'undefined' && data.errorCode == '0'){
                        var elementActive = container.find('tr[option-id="'+data.id+'"]');
                         var element = $('<tr></tr>')
@@ -235,12 +241,12 @@ var Option = function(){
             else if(type == 'radio'){
                 var partialUid = uid.substring(0,(uid.length -1));
                 var elementChecked = $('input[id^="'+partialUid+'"]:checked');
-                
+
                 if(isChecked){
                     $('div[id^="'+partialUid+'"]').each(function(){
                         $(this).hide();
                     });
-    
+
                     $('input[id^="'+partialUid+'"]').each(function(){
                         if($(this).attr('type') == 'text')
                             $(this).prop('disabled',true);
@@ -286,6 +292,9 @@ var QuizQuestion = function(){
                     contentType: "application/json; charset=utf-8"
                   })
                 .done(function(data){
+                    data = JSON.stringify(data);
+                    data = DOMPurify.sanitize(data);
+                    data = JSON.parse(data);
                     if(typeof data.errorCode != 'undefined' && data.errorCode == '0'){
                         var element = $('<tr></tr>')
                             .attr({'key': data.quizId + '' + data.questionId, 'quiz-id': data.quizId, 'question-id': data.questionId, 'question-description': data.description})

programming_language: JavaScript
filename: timesheet.js
change_type: ModificationType.MODIFY
diff: @@ -439,29 +439,29 @@ $(document).on("click", ".workloads-activator", function () {
     }
 });
 
-$(document).on("click", ".schedule-selected .instructor-name", function () {
-    var instructorId = $(this).attr("instructor_id");
-    var disciplineId = $(this)
-        .parent()
-        .find(".discipline-name")
-        .attr("discipline_id");
-    var scheduleId = $(this)
-        .parent()
-        .attr("schedule");
-
-    $.ajax({
-        url: getInstructorsUrl,
-        type: "POST",
-        data: {
-            discipline: disciplineId
-        }
-    }).success(function (result) {
-        $("#change-instructor-schedule").val(scheduleId);
-        $("#change-instructor-id").html(result);
-        $("#change-instructor-id").val(instructorId).select2();
-        $("#change-instructor-modal").modal();
-    });
-});
+// $(document).on("click", ".schedule-selected .instructor-name", function () {
+//     var instructorId = $(this).attr("instructor_id");
+//     var disciplineId = $(this)
+//         .parent()
+//         .find(".discipline-name")
+//         .attr("discipline_id");
+//     var scheduleId = $(this)
+//         .parent()
+//         .attr("schedule");
+//
+//     $.ajax({
+//         url: getInstructorsUrl,
+//         type: "POST",
+//         data: {
+//             discipline: disciplineId
+//         }
+//     }).success(function (result) {
+//         $("#change-instructor-schedule").val(scheduleId);
+//         $("#change-instructor-id").html(result);
+//         $("#change-instructor-id").val(instructorId).select2();
+//         $("#change-instructor-modal").modal();
+//     });
+// });
 $(document).on("click", "#change-instructor-button", function () {
     $.ajax({
         url: changeInstructorUrl,

programming_language: JavaScript
filename: _initialization.js
change_type: ModificationType.MODIFY
diff: @@ -76,7 +76,7 @@ $("#classroom").on("change", function () {
                     if (response == "") {
                         $("#disciplines").html("<option value='-1'></option>").trigger("change.select2").show();
                     } else {
-                        $("#disciplines").html(response).trigger("change.select2").show();
+                        $("#disciplines").html(decodeHtml(response)).trigger("change.select2").show();
                     }
                     $(".disciplines-container").show();
                 },

programming_language: JavaScript
filename: _initialization.js
change_type: ModificationType.MODIFY
diff: @@ -89,7 +89,7 @@ $("#classroom").on("change", function () {
                     if (response === "") {
                         $("#disciplines").html("<option value='-1'></option>").trigger("change.select2").show();
                     } else {
-                        $("#disciplines").html(response).trigger("change.select2").show();
+                        $("#disciplines").html(decodeHtml(response)).trigger("change.select2").show();
                     }
                     $(".disciplines-container").show();
                 },

programming_language: JavaScript
filename: index.php
change_type: ModificationType.MODIFY
diff: @@ -11,178 +11,243 @@ $this->breadcrumbs = array(
 );
 ?>
 
-<div class="row-fluid">
-    <div class="span12">
-        <h3 class="heading-mosaic"><?php echo Yii::t('default', 'Reports'); ?></h3>  
-    </div>
-</div>
-
-<div class="innerLR home">
     <div class="row-fluid">
-        <?php if (Yii::app()->user->hasFlash('success')): ?>
-            <div class="alert alert-success">
-                <?php echo Yii::app()->user->getFlash('success') ?>
-            </div>
-            <br/>
-        <?php endif ?>
         <div class="span12">
+            <h3 class="heading-mosaic"><?php echo Yii::t('default', 'Reports'); ?></h3>
+        </div>
+    </div>
+
+    <div class="innerLR home">
+        <div class="row-fluid">
+            <?php if (Yii::app()->user->hasFlash('success')): ?>
+                <div class="alert alert-success">
+                    <?php echo Yii::app()->user->getFlash('success') ?>
+                </div>
+                <br/>
+            <?php endif ?>
+            <div class="span12">
                 <div class="span2">
                     <a href="#" data-toggle="modal" data-target="#reportFamilyBag" class="widget-stats" target="_blank">
-                    <!-- <a  href="<?php //echo Yii::app()->createUrl('reports/BFReport')?>" class="widget-stats"> -->
+                        <!-- <a  href="<?php //echo Yii::app()->createUrl('reports/BFReport')?>" class="widget-stats"> -->
                         <div><i class="fa-percent fa fa-4x"></i></div>
                         <span class="report-title">Frequência para o Bolsa Família</span>
                         <div class="clearfix"></div>
                     </a>
                 </div>
                 <div class="span2">
-                    <a href="<?php echo Yii::app()->createUrl('reports/NumberStudentsPerClassroomReport')?>" class="widget-stats" target="_blank">
+                    <a href="<?php echo Yii::app()->createUrl('reports/NumberStudentsPerClassroomReport') ?>"
+                       class="widget-stats" target="_blank">
                         <div><i class="fa fa-sort-numeric-asc fa-4x"></i></div>
                         <span class="report-title">Número de Alunos por Turma</span>
                         <div class="clearfix"></div>
                     </a>
                 </div>
                 <div class="span2">
-                    <a href="<?php echo Yii::app()->createUrl('reports/InstructorsPerClassroomReport')?>" class="widget-stats" target="_blank">
+                    <a href="<?php echo Yii::app()->createUrl('reports/InstructorsPerClassroomReport') ?>"
+                       class="widget-stats" target="_blank">
                         <div><i class="fa fa-graduation-cap fa-4x"></i></div>
                         <span class="report-title">Professores por Turma</span>
                         <div class="clearfix"></div>
                     </a>
                 </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/studentsbetween5and14yearsoldreport',array('id'=>Yii::app()->user->school))?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-heartbeat fa-4x"></i></div>
-                    <span class="report-title">Alunos com Idade entre 5 e 14 Anos (SUS)</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/enrollmentcomparativeanalysisreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-exchange fa-4x"></i></div>
-                    <span class="report-title">Análise Comparativa de Matrículas</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/schoolprofessionalnumberbyclassroomreport')?>" class="widget-stats" target="_blank">
-                    <div><span class="glyphicons signal"><i></i></span></div>
-                    <span class="report-title">Número de Profissionais por turma</span>
-                    <div class="clearfix"></div>
-                </a>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/studentsbetween5and14yearsoldreport', array('id' => Yii::app()->user->school)) ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-heartbeat fa-4x"></i></div>
+                        <span class="report-title">Alunos com Idade entre 5 e 14 Anos (SUS)</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/enrollmentcomparativeanalysisreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-exchange fa-4x"></i></div>
+                        <span class="report-title">Análise Comparativa de Matrículas</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/schoolprofessionalnumberbyclassroomreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><span class="glyphicons signal"><i></i></span></div>
+                        <span class="report-title">Número de Profissionais por turma</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
             </div>
-        </div>
-        <div class="span12" style="margin: 10px 0 0 0">
+            <div class="span12" style="margin: 10px 0 0 0">
 
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/educationalassistantperclassroomreport',array('id'=>Yii::app()->user->school))?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-handshake-o fa-4x"></i></div>
-                    <span class="report-title">Auxiliar/Assistente Educacional por Turma</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/disciplineandinstructorrelationreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-podcast fa-4x"></i></div>
-                    <span class="report-title">Relação Disciplina/Docente</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/complementaractivityassistantbyclassroomreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-dot-circle-o fa-4x"></i></div>
-                    <span class="report-title">Monitores de Atividade Complementar por Turma</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/classroomwithoutinstructorrelationreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-ban fa-4x"></i></div>
-                    <span class="report-title">Relação Turmas sem Instrutor</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/studentinstructornumbersrelationreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-users fa-4x"></i></div>
-                    <span class="report-title">Número de Alunos e Professores por Turma</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/studentsbyclassroomreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-address-book fa-4x"></i></div>
-                    <span class="report-title">Relação de alunos por turma</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-        </div>
-        <div class="span12" style="margin: 10px 0 0 0">
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/studentsinalphabeticalorderrelationreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-sort-alpha-asc fa-4x"></i></div>
-                    <span class="report-title">Relaçao de Alunos em ordem Alfabética</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/studentswithdisabilitiesrelationreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-wheelchair fa-4x"></i></div>
-                    <span class="report-title">Relação Acessibilidade</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/studentsusingschooltransportationrelationreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-bus fa-4x"></i></div>
-                    <span class="report-title">Relação Transporte Escolar</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/incompatiblestudentagebyclassroomreport')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-street-view fa-4x"></i></div>
-                    <span class="report-title">Alunos com Idade Incompatível por Turma</span>
-                    <div class="clearfix"></div>
-                </a>
-            </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/bfrstudentReport')?>" class="widget-stats" target="_blank">
-                    <div><span class="glyphicons justify"><i></i></span></div>
-                    <span class="report-title">Alunos participantes Bolsa Familia</span>
-                    <div class="clearfix"></div>
-                </a>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/educationalassistantperclassroomreport', array('id' => Yii::app()->user->school)) ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-handshake-o fa-4x"></i></div>
+                        <span class="report-title">Auxiliar/Assistente Educacional por Turma</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/disciplineandinstructorrelationreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-podcast fa-4x"></i></div>
+                        <span class="report-title">Relação Disciplina/Docente</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/complementaractivityassistantbyclassroomreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-dot-circle-o fa-4x"></i></div>
+                        <span class="report-title">Monitores de Atividade Complementar por Turma</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/classroomwithoutinstructorrelationreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-ban fa-4x"></i></div>
+                        <span class="report-title">Relação Turmas sem Instrutor</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/studentinstructornumbersrelationreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-users fa-4x"></i></div>
+                        <span class="report-title">Número de Alunos e Professores por Turma</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/studentsbyclassroomreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-address-book fa-4x"></i></div>
+                        <span class="report-title">Relação de alunos por turma</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
             </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/studentpendingdocument')?>" class="widget-stats" target="_blank">
-                    <div><i class="fa fa-list-ol fa-4x"></i></div>
-                    <span class="report-title">Alunos com Documentos Pendentes</span>
-                    <div class="clearfix"></div>
-                </a>
+            <div class="span12" style="margin: 10px 0 0 0">
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/studentsinalphabeticalorderrelationreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-sort-alpha-asc fa-4x"></i></div>
+                        <span class="report-title">Relaçao de Alunos em ordem Alfabética</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/studentswithdisabilitiesrelationreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-wheelchair fa-4x"></i></div>
+                        <span class="report-title">Relação Acessibilidade</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/studentsusingschooltransportationrelationreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-bus fa-4x"></i></div>
+                        <span class="report-title">Relação Transporte Escolar</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/incompatiblestudentagebyclassroomreport') ?>"
+                       class="widget-stats" target="_blank">
+                        <div><i class="fa fa-street-view fa-4x"></i></div>
+                        <span class="report-title">Alunos com Idade Incompatível por Turma</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/bfrstudentReport') ?>" class="widget-stats"
+                       target="_blank">
+                        <div><span class="glyphicons justify"><i></i></span></div>
+                        <span class="report-title">Alunos participantes Bolsa Familia</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/studentpendingdocument') ?>" class="widget-stats"
+                       target="_blank">
+                        <div><i class="fa fa-list-ol fa-4x"></i></div>
+                        <span class="report-title">Alunos com Documentos Pendentes</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
             </div>
-        </div>
-        <div class="span12" style="margin: 10px 0 0 0">
-            <div class="span2">
-                <a href="#" data-toggle="modal" data-target="#report" class="widget-stats" target="_blank">
-                    <div><span class="glyphicons signal"><i></i></span></div>
-                    <span class="report-title">Alunos por turma</span>
-                    <div class="clearfix"></div>
-                </a>
+            <div class="span12" style="margin: 10px 0 0 0">
+                <div class="span2">
+                    <a href="#" data-toggle="modal" data-target="#report" class="widget-stats" target="_blank">
+                        <div><span class="glyphicons signal"><i></i></span></div>
+                        <span class="report-title">Alunos por turma</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
+                <div class="span2">
+                    <a href="<?php echo Yii::app()->createUrl('reports/studentspecialfood') ?>" class="widget-stats"
+                       target="_blank">
+                        <span class="glyphicons fast_food"><i></i></span>
+                        <span class="txt">Alunos - Cardápios Especiais</span>
+                        <div class="clearfix"></div>
+                    </a>
+                </div>
             </div>
-            <div class="span2">
-                <a href="<?php echo Yii::app()->createUrl('reports/studentspecialfood')?>" class="widget-stats" target="_blank">
-                    <span class="glyphicons fast_food"><i></i></span>
-                    <span class="txt">Alunos - Cardápios Especiais</span>
-                    <div class="clearfix"></div>
-                </a>
+            <div class="modal fade" id="report" tabindex="-1" role="dialog" aria-labelledby="New Calendar">
+                <div class="modal-dialog" role="document">
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
+                                        aria-hidden="true">×</span></button>
+                            <h4 class="modal-title" id="myModalLabel">Escolha a Turma</h4>
+                        </div>
+                        <form class="form-vertical" id="createCalendar" action="/br.tag/?r=calendar" method="post">
+                            <div class="modal-body">
+                                <div class="row-fluid">
+                                    <div class=" span12" style="margin: 10px 0 10px 0;">
+                                        <div class="span4">
+                                            <?php echo CHtml::label(yii::t('default', 'Classroom'), 'classroom', array('class' => 'control-label')); ?>
+                                        </div>
+                                        <div class="span8">
+                                            <?php
+                                            echo CHtml::dropDownList('classroom', '', CHtml::listData(Classroom::model()->findAll(array('condition' => 'school_inep_fk=' . Yii::app()->user->school . ' && school_year = ' . Yii::app()->user->year, 'order' => 'name')), 'id', 'name'), array(
+                                                'key' => 'id',
+                                                'class' => 'select-search-on',
+                                                'prompt' => 'Selecione a turma',
+                                                'ajax' => array(
+                                                    'type' => 'POST',
+                                                    'url' => CController::createUrl('classes/getDisciplines'),
+                                                    'success' => 'function(data){
+                                                        $("#disciplines").html(decodeHtml(data));
+                                                    }'
+                                                )));
+                                            ?>
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div class="modal-footer" style="background-color:#FFF;">
+                                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
+                                    <a class="btn btn-primary"
+                                       url="<?php echo Yii::app()->createUrl('reports/studentbyclassroomreport'); ?>"
+                                       type="button" value="Gerar" id="buildReport"> Gerar </a>
+                                </div>
+                        </form>
+                    </div>
+                </div>
             </div>
         </div>
-        <div class="modal fade" id="report" tabindex="-1" role="dialog" aria-labelledby="New Calendar">
-            <div class="modal-dialog" role="document">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
-                        <h4 class="modal-title" id="myModalLabel">Escolha a Turma</h4>
-                    </div>
-                    <form class="form-vertical" id="createCalendar" action="/br.tag/?r=calendar" method="post">            
+    </div>
+
+    <div class="modal fade" id="reportFamilyBag" tabindex="-1" role="dialog">
+        <div class="modal-dialog" role="documentBag">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
+                                aria-hidden="true">×</span></button>
+                    <h4 class="modal-title">Frequência Bolsa Família - Escolha a Turma</h4>
+                </div>
+                <form class="form-vertical" action="/br.tag/?r=calendar" method="post">
                     <div class="modal-body">
                         <div class="row-fluid">
                             <div class=" span12" style="margin: 10px 0 10px 0;">
@@ -190,76 +255,38 @@ $this->breadcrumbs = array(
                                     <?php echo CHtml::label(yii::t('default', 'Classroom'), 'classroom', array('class' => 'control-label')); ?>
                                 </div>
                                 <div class="span8">
-                                     <?php
-                                        echo CHtml::dropDownList('classroom', '', CHtml::listData(Classroom::model()->findAll(array('condition'=>'school_inep_fk=' . Yii::app()->user->school . ' && school_year = ' . Yii::app()->user->year,'order' => 'name')), 'id', 'name'), array(
-                                            'key' => 'id',
-                                            'class' => 'select-search-on',
-                                            'prompt' => 'Selecione a turma',
-                                            'ajax' => array(
-                                                'type' => 'POST',
-                                                'url' => CController::createUrl('classes/getDisciplines'),
-                                                'update' => '#disciplines',
-                                        )));
-                                    ?>
-                                </div>
-                            </div>
-                        </div>
-
-                        <div class="modal-footer" style="background-color:#FFF;">
-                            <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
-                            <a class="btn btn-primary" url="<?php echo Yii::app()->createUrl('reports/studentbyclassroomreport'); ?>" type="button" value="Gerar" id="buildReport"> Gerar </a>         
-                        </div>
-                    </form>        
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-
-<div class="modal fade" id="reportFamilyBag" tabindex="-1" role="dialog">
-    <div class="modal-dialog" role="documentBag">
-        <div class="modal-content">
-            <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
-                <h4 class="modal-title">Frequência Bolsa Família - Escolha a Turma</h4>
-            </div>
-            <form class="form-vertical" action="/br.tag/?r=calendar" method="post">            
-                <div class="modal-body">
-                    <div class="row-fluid">
-                        <div class=" span12" style="margin: 10px 0 10px 0;">
-                            <div class="span4">
-                                <?php echo CHtml::label(yii::t('default', 'Classroom'), 'classroom', array('class' => 'control-label')); ?>
-                            </div>
-                            <div class="span8">
-                                <?php
-                                    echo CHtml::dropDownList('classroom2', '', CHtml::listData(Classroom::model()->findAll(array('condition'=>'school_inep_fk=' . Yii::app()->user->school . ' && school_year = ' . Yii::app()->user->year,'order' => 'name')), 'id', 'name'), array(
+                                    <?php
+                                    echo CHtml::dropDownList('classroom2', '', CHtml::listData(Classroom::model()->findAll(array('condition' => 'school_inep_fk=' . Yii::app()->user->school . ' && school_year = ' . Yii::app()->user->year, 'order' => 'name')), 'id', 'name'), array(
                                         'key' => 'id',
                                         'class' => 'select-search-on',
                                         'prompt' => 'Todas as turmas',
                                         'ajax' => array(
                                             'type' => 'POST',
                                             'url' => CController::createUrl('classes/getDisciplines'),
-                                            'update' => '#disciplines',
-                                    )));
-                                ?>
+                                            'success' => 'function(data){
+                                                $("#disciplines").html(decodeHtml(data));
+                                            }'
+                                        )));
+                                    ?>
+                                </div>
                             </div>
                         </div>
                     </div>
-                </div>
 
-                <div class="modal-footer" style="background-color:#FFF;">
-                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
-                    <a class="btn btn-primary" url="<?php echo Yii::app()->createUrl('reports/BFReport'); ?>" type="button" value="Gerar" id="buildReportBF"> Gerar </a>         
-                </div>
-            </form>        
+                    <div class="modal-footer" style="background-color:#FFF;">
+                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
+                        <a class="btn btn-primary" url="<?php echo Yii::app()->createUrl('reports/BFReport'); ?>"
+                           type="button" value="Gerar" id="buildReportBF"> Gerar </a>
+                    </div>
+                </form>
+            </div>
         </div>
     </div>
-</div>
 
 <?php
 
 $cs = Yii::app()->getClientScript();
-$cs->registerScript('buildReport',"  
+$cs->registerScript('buildReport', "  
     $('#buildReport').live('click', function(event) {
         var url = $(this).attr('url');
         var id = $('#classroom').val();
@@ -267,7 +294,7 @@ $cs->registerScript('buildReport',"
     });
     registerAndOpenTab('#buildReport');", CClientScript::POS_END);
 
-$cs->registerScript('buildReportBF',"  
+$cs->registerScript('buildReportBF', "  
     $('#buildReportBF').live('click', function(event) {
         var url = $(this).attr('url');
         var id = $('#classroom2').val();
@@ -275,4 +302,4 @@ $cs->registerScript('buildReportBF',"
     });
     registerAndOpenTab('#buildReportBF');", CClientScript::POS_END);
 
- ?>
\ No newline at end of file
+?>
\ No newline at end of file

programming_language: PHP