<commit_before><?php

namespace Cacic\CommonBundle\Controller;

use Cacic\CommonBundle\Entity\LogUserLogado;
use Doctrine\Common\Util\Debug;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Cacic\CommonBundle\Entity\InsucessoInstalacao;
use Cacic\CommonBundle\Entity\Log;
use Cacic\CommonBundle\Form\Type\LogPesquisaType;
use Cacic\CommonBundle\Form\Type\InsucessoInstalacaoPesquisaType;
use Cacic\CommonBundle\Form\Type\SrcacicConexaoPesquisaType;
use Cacic\CommonBundle\Form\Type\LogUserLogadoType;


/**
 *
 * CRUD da Entidade Log
 * @author lightbase
 *
 */
class LogController extends Controller
{

	/**
	 * 
	 * Tela de pesquisa dos LOGS de ACESSO
	 * @param Symfony\Component\HttpFoundation\Request $request
	 */
    public function acessoAction( Request $request )
    {
    	$form = $this->createForm( new LogPesquisaType() );
    				
        if ( $request->isMethod('POST') )
        {
        	$form->bind( $request );
        	$data = $form->getData();
            $locale = $request->getLocale();

            $filtroLocais = array(); // Inicializa array com locais a pesquisar
            foreach ( $data['idLocal'] as $locais )
                array_push( $filtroLocais, $locais->getIdLocal() );
			
            $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Log')
            							->pesquisar( 'ACE', $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais);

        }
        
        return $this->render( 'CacicCommonBundle:Log:acesso.html.twig',
			array(
                'local'=>$locale ,
				'form' => $form->createView(),
				'logs' => ( isset( $logs ) ? $logs : null )
			)
		);
    }
    
    /**
     * 
     * Tela de pesquisa dos LOGs de Atividades
     * @param Symfony\Component\HttpFoundation\Request $request
     */
    public function atividadeAction( Request $request )
    {
        $form = $this->createForm( new LogPesquisaType() );<commit_msg>Corrige erro do locale na data<commit_after><?php

namespace Cacic\CommonBundle\Controller;

use Cacic\CommonBundle\Entity\LogUserLogado;
use Doctrine\Common\Util\Debug;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Cacic\CommonBundle\Entity\InsucessoInstalacao;
use Cacic\CommonBundle\Entity\Log;
use Cacic\CommonBundle\Form\Type\LogPesquisaType;
use Cacic\CommonBundle\Form\Type\InsucessoInstalacaoPesquisaType;
use Cacic\CommonBundle\Form\Type\SrcacicConexaoPesquisaType;
use Cacic\CommonBundle\Form\Type\LogUserLogadoType;


/**
 *
 * CRUD da Entidade Log
 * @author lightbase
 *
 */
class LogController extends Controller
{

	/**
	 * 
	 * Tela de pesquisa dos LOGS de ACESSO
	 * @param Symfony\Component\HttpFoundation\Request $request
	 */
    public function acessoAction( Request $request )
    {
    	$form = $this->createForm( new LogPesquisaType() );
        $locale = $request->getLocale();
    				
        if ( $request->isMethod('POST') )
        {
        	$form->bind( $request );
        	$data = $form->getData();

            $filtroLocais = array(); // Inicializa array com locais a pesquisar
            foreach ( $data['idLocal'] as $locais )
                array_push( $filtroLocais, $locais->getIdLocal() );
			
            $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:Log')
            							->pesquisar( 'ACE', $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais);

        }
        
        return $this->render( 'CacicCommonBundle:Log:acesso.html.twig',
			array(
                'local'=>$locale ,
				'form' => $form->createView(),
				'logs' => ( isset( $logs ) ? $logs : null )
			)
		);
    }
    
    /**
     * 
     * Tela de pesquisa dos LOGs de Atividades
     * @param Symfony\Component\HttpFoundation\Request $request
     */
    public function atividadeAction( Request $request )
    {
        $form = $this->createForm( new LogPesquisaType() );
{'fraction_non_alphanumeric': 0.1288723667905824, 'fraction_numerical': 0.0, 'mean_word_length': 2.996039603960396, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6340169', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1298, 'n_words': 237}