- $encodedViolationsCountByTimespanStatsData = CJSON::encode($violationsCountByTimespanStatsData);
- $encodedApprovedViolationsCountByTimespanStatsData = CJSON::encode($approvedViolationsCountByTimespanStatsData);
- $encodedInvalidViolationsCountByTimespanStatsData = CJSON::encode($invalidViolationsCountByTimespanStatsData);
- $encodedPendingViolationsCountByTimespanStatsData = CJSON::encode($pendingViolationsCountByTimespanStatsData);
- $encodedExportedEventsCountByTimespanStatsData = CJSON::encode($exportedEventsCountByTimespanStatsData);
- $encodedViolationsCountByGate = CJSON::encode($violationsCountByGate);
- $encodedApprovedViolationsCountByGate = CJSON::encode($approvedViolationsCountByGate);
- $encodedInvalidViolationsCountByGate = CJSON::encode($invalidViolationsCountByGate);
- $encodedExportedEventsCountByGate = CJSON::encode($exportedEventsCountByGate);

- $searchGateList = ""
- foreach($gates as $gate)
  - if (isset($eventsStatisticsSearchForm->gates) && in_array($gate['ID'], $eventsStatisticsSearchForm->gates))
    - $searchGateList.= $gate->Descrizione . ", "
- $searchGateList = rtrim($searchGateList, ", ")

.stats-violation-management-search-results

  %div.print-only(style="margin-left: 1cm;margin-top: 1cm;margin-bottom:2cm")
    %h1(style="text-align:center;margin-bottom: 1cm;")
      = t('Violations Management')
    %p(style="font-size:22px;")
      %strong
        =t('Date') . ":"
      =t('From')
      =$eventsStatisticsSearchForm->startDateTime
      =t('To')
      =$eventsStatisticsSearchForm->endDateTime
      - if (isset($eventsStatisticsSearchForm->gates))
        %br
        %br
        %strong
          =t('Gates') . ":"
        =$searchGateList

  .row.stats-violations-management-overview
    .span12
      #violations-management-graph-container
        %canvas#violations-management-graph(style="height:70%;width:40%;")
        
  .row.stats-violations-management-overview
    .span12
      #violations-management-exported-graph-container
        %canvas#violations-management-exported-graph(style="height:70%;width:40%;")
        
  .row.stats-violations-management-overview
    .span12
      #violations-management-by-gate-graph-container
        %canvas#violations-management-by-gate-graph(style="height:70%;width:40%;")
    
%input#violations-count-by-timespan-graph-data(type='hidden' value="#{$encodedViolationsCountByTimespanStatsData}")
%input#approved-violations-count-by-timespan-graph-data(type='hidden' value="#{$encodedApprovedViolationsCountByTimespanStatsData}")
%input#invalid-violations-count-by-timespan-graph-data(type='hidden' value="#{$encodedInvalidViolationsCountByTimespanStatsData}")
%input#pending-violations-count-by-timespan-graph-data(type='hidden' value="#{$encodedPendingViolationsCountByTimespanStatsData}")
%input#exported-violations-count-by-timespan-graph-data(type='hidden' value="#{$encodedExportedEventsCountByTimespanStatsData}")
%input#violations-count-by-gate-graph-data(type='hidden' value="#{$encodedViolationsCountByGate}")
%input#approved-violations-count-by-gate-graph-data(type='hidden' value="#{$encodedApprovedViolationsCountByGate}")
%input#invalid-violations-count-by-gate-graph-data(type='hidden' value="#{$encodedInvalidViolationsCountByGate}")
%input#exported-violations-count-by-gate-graph-data(type='hidden' value="#{$encodedExportedEventsCountByGate}")