CVE-2022-4444 (JavaScript, published 2022-12-13T09:15Z)
Description: value: 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.
Severity: nan (CVSS v3 base score: 6.1)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
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.
Repository: https://github.com/ipti/br.tag
Files changed:
app/controllers/ClassesController.php
app/modules/calendar/resources/common/js/calendar.js
app/modules/quiz/resources/common/js/quiz.js
app/modules/timesheet/resources/common/js/timesheet.js
js/classes/class-contents/_initialization.js
js/classes/frequency/_initialization.js
themes/default/views/reports/index.php
Commit message: Resolvido issues do XSS


Vulnerable code:
            echo CHtml::tag('option', array('value' => $discipline['id']), CHtml::encode($disciplinesLabels[$discipline['id']]), true);
                echo CHtml::tag('option', array('value' => $discipline['discipline_fk']), CHtml::encode($disciplinesLabels[$discipline['discipline_fk']]), true);
                form.find(".alert").html(data.error).show();
                $("#edit-calendar-title-modal").find(".alert").html(data.error).show();
            $("#removeCalendar").find(".alert").html(data.error).show();
            $("#myChangeEvent").find(".alert").html(data.error).show();
                    date.prepend("<i class='calendar-icon fa " + data.icon + "'></i>");
                form.find(".alert").html(data.error).show();
            $("#changeCalendarStatus").find(".alert").html(data.error).show();
$('#save_button').click(function() { 
    } 
$('#save_group_button').click(function() { 
    } 
$('#save_question_group_button').click(function() { 
    } 
$('#save_question_button').click(function() { 
    } 
$('#save_answer_button').click(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();
    });
});
                        $("#disciplines").html(response).trigger("change.select2").show();
                        $("#disciplines").html(response).trigger("change.select2").show();
<div class="row-fluid">
    <div class="span12">
        <h3 class="heading-mosaic"><?php echo Yii::t('default', 'Reports'); ?></h3>  
    </div>
</div>

<div class="innerLR home">
        <?php if (Yii::app()->user->hasFlash('success')): ?>
            <div class="alert alert-success">
                <?php echo Yii::app()->user->getFlash('success') ?>
            </div>
            <br/>
        <?php endif ?>
                    <!-- <a  href="<?php //echo Yii::app()->createUrl('reports/BFReport')?>" class="widget-stats"> -->
                    <a href="<?php echo Yii::app()->createUrl('reports/NumberStudentsPerClassroomReport')?>" class="widget-stats" target="_blank">
                    <a href="<?php echo Yii::app()->createUrl('reports/InstructorsPerClassroomReport')?>" class="widget-stats" target="_blank">
            <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 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/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 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="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">            
                                     <?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(
                                            'update' => '#disciplines',
                                    )));
                                ?>
                </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>
$cs->registerScript('buildReport',"  
$cs->registerScript('buildReportBF',"  
 ?>

Fixed code:
            echo htmlspecialchars(CHtml::tag('option', array('value' => $discipline['id']), CHtml::encode($disciplinesLabels[$discipline['id']]), true));
                echo htmlspecialchars(CHtml::tag('option', array('value' => $discipline['discipline_fk']), CHtml::encode($disciplinesLabels[$discipline['discipline_fk']]), true));
                form.find(".alert").html(DOMPurify.sanitize(data.error)).show();
                $("#edit-calendar-title-modal").find(".alert").html(DOMPurify.sanitize(data.error)).show();
            $("#removeCalendar").find(".alert").html(DOMPurify.sanitize(data.error)).show();
            $("#myChangeEvent").find(".alert").html(DOMPurify.sanitize(data.error)).show();
                    date.prepend("<i class='calendar-icon fa " + DOMPurify.sanitize(data.icon) + "'></i>");
                form.find(".alert").html(DOMPurify.sanitize(data.error)).show();
            $("#changeCalendarStatus").find(".alert").html(DOMPurify.sanitize(data.error)).show();
$('#save_button').click(function() {
    }
$('#save_group_button').click(function() {
    }
$('#save_question_group_button').click(function() {
    }
$('#save_question_button').click(function() {
    }
$('#save_answer_button').click(function() {
                    data = JSON.stringify(data);
                    data = DOMPurify.sanitize(data);
                    data = JSON.parse(data);
                    data = JSON.stringify(data);
                    data = DOMPurify.sanitize(data);
                    data = JSON.parse(data);


                    data = JSON.stringify(data);
                    data = DOMPurify.sanitize(data);
                    data = JSON.parse(data);
// $(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();
//     });
// });
                        $("#disciplines").html(decodeHtml(response)).trigger("change.select2").show();
                        $("#disciplines").html(decodeHtml(response)).trigger("change.select2").show();
            <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">
                        <!-- <a  href="<?php //echo Yii::app()->createUrl('reports/BFReport')?>" class="widget-stats"> -->
                    <a href="<?php echo Yii::app()->createUrl('reports/NumberStudentsPerClassroomReport') ?>"
                       class="widget-stats" target="_blank">
                    <a href="<?php echo Yii::app()->createUrl('reports/InstructorsPerClassroomReport') ?>"
                       class="widget-stats" target="_blank">
                <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 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 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 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 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 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">
                                    <?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(
                                            'success' => 'function(data){
                                                $("#disciplines").html(decodeHtml(data));
                                            }'
                                        )));
                                    ?>
                                </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>
$cs->registerScript('buildReport', "  
$cs->registerScript('buildReportBF', "  
?>