- if (isset($dataProvider) && count($dataProvider->data)>0)

  - $events = $dataProvider->data
  - $accessReport = Yii::app()->user->checkAccess('show_event_report');
  - $veichleClasses = VehicleTypes::localized()

  .tableContainer.pagination-data-container
    %table#results.table.table-striped.table-bordered.table-hover.span12
      %thead
        %tr
          %th= Yii::t("app", "License plate")
          %th= Yii::t("app", "External Code")
          %th= Yii::t("app", "Date")
          %th= Yii::t("app", "Time")
          %th= Yii::t("app", "Gate")
          %th= Yii::t("app", "Vehicle class")
          %th= Yii::t("app", "Speed")
          - if ($accessReport)
            %th= Yii::t("app", "Report")
      %tbody
        - foreach($events as $event)
          %tr
            %td
              - if(Yii::app()->user->checkAccess('license_plate_visibility'))
                = $event->Plate
              - else
                ="#######"  
            %td
              - if ($event->ext_code!='')
                .btn-group
                  %a.btn.btn-small.dropdown-toggle(data-toggle="dropdown" href="#")
                    = $event->ext_code
                    %span.caret
                  - if(Yii::app()->user->checkAccess('show_event_violation_document'))    
                    %ul.dropdown-menu.pull-right
                      - foreach ($event->eventBehaviors as $index => $eventBehavior)
                        -if($eventBehavior->definitive)
                          %li
                            %a(href="#{Yii::app()->createAbsoluteUrl('event/violationDocumentPreview', array('violationDocumentId' => $eventBehavior->definitive->id))}" target="_blank")= t("{$eventBehavior->behavior->name}")
                      - foreach($event->videos as $index => $video)
                        %li
                          %a(href="#{$video->url}" target="_blank")
                            %i.icon-play
                            = t("Video #vindex", array('vindex'=> ($index+1)))
                               
            
            %td= DateHelper::formatISO9075Date($event->StartTime)
            %td= DateHelper::formatISO9075Time($event->StartTime)
            %td= $event->Gate
            %td= $veichleClasses[$event->custom_vehicle_type]
            %td
              - if ($event->Speed > 0)
                = "$event->Speed Km/h"
              - else
                = "-"
            - if ($accessReport)
              %td
                %a.btn.btn-mini(href="#{Yii::app()->createAbsoluteUrl('event/report', array('id' => $event->ID))}" target="_blank") =Yii::t("app", "Generate")
              %td
                -#----Mod. Unable to export from Rapid Search -- Task Id #12757024 06-02-2019. Ng ---
                -#%a.btn.btn-mini(href="#{Yii::app()->createAbsoluteUrl('event/exportpdf', array('id' => $event->ID))}") =Yii::t("app", "Export")
                %a.btn.btn-mini(href="#{Yii::app()->createAbsoluteUrl('event/view', array('id' => $event->ID))}") =Yii::t("app", "Export")
                

  - if (isset($dataProvider->pagination))
    .pagination-links-container.pagination
      - $this->widget('bootstrap.widgets.TbPager', array('pages' => $dataProvider->pagination))

- else

  %h4= Yii::t("app", "No results")
