<commit_before><?php

namespace App\Bundle\BackOfficeBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use App\Bundle\BackOfficeBundle\Entity\Element;
use App\Bundle\BackOfficeBundle\Entity\Note;
use App\Bundle\BackOfficeBundle\Entity\Module;
use App\Bundle\BackOfficeBundle\Entity\Etudiant;

use App\Bundle\BackOfficeBundle\Form\ImportFormType;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use PHPExcel\PHPExcel;



class ImportController extends Controller
{
    public function updateAction(Request $request)
    {
    	//abdelatif karoum todo here
        $message = "Les donnees sont inseres ";
        $form  = $this->createForm(new ImportFormType());
        $status = false;
        $form->handleRequest($request);
        if ($request->isMethod('POST'))

            if($form->isValid()){  
                $folder = "upload/excel/";        
                $data = $form->getData();              
                $attachement = $data['attachement'];
                $table = $data['table'];
                $type = $attachement->guessExtension();
                $nomFichier = uniqid().".".$type;
                $attachement->move($folder,$nomFichier);
                $path = $folder.$nomFichier;
                switch ($table) {
                    case 'etudiant':
                         $status = $this->importEtudiants($path);
                         break;

                    case 'filiere':
                         $status = $this->importFiliere($path);
                         break;

                    case 'module':
                         $status = $this->importModules($path);
                         break;

                    case 'note':
                         $status = $this->importNotes($path);
                         break;<commit_msg>fixer le nom du fichier upload<commit_after><?php

namespace App\Bundle\BackOfficeBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use App\Bundle\BackOfficeBundle\Entity\Element;
use App\Bundle\BackOfficeBundle\Entity\Note;
use App\Bundle\BackOfficeBundle\Entity\Module;
use App\Bundle\BackOfficeBundle\Entity\Etudiant;

use App\Bundle\BackOfficeBundle\Form\ImportFormType;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use PHPExcel\PHPExcel;



class ImportController extends Controller
{
    public function updateAction(Request $request)
    {
    	//abdelatif karoum todo here
        $message = "Les donnees sont inseres ";
        $form  = $this->createForm(new ImportFormType());
        $status = false;
        $form->handleRequest($request);
        if ($request->isMethod('POST'))

            if($form->isValid()){  
                $folder = "upload/excel/";        
                $data = $form->getData();              
                $attachement = $data['attachement'];
                $table = $data['table'];
                $type = $attachement->guessExtension();
                $nomFichier = $table.uniqid().".".$type;
                $attachement->move($folder,$nomFichier);
                $path = $folder.$nomFichier;
                switch ($table) {
                    case 'etudiant':
                         $status = $this->importEtudiants($path);
                         break;

                    case 'filiere':
                         $status = $this->importFiliere($path);
                         break;

                    case 'module':
                         $status = $this->importModules($path);
                         break;

                    case 'note':
                         $status = $this->importNotes($path);
                         break;
{'fraction_non_alphanumeric': 0.1167618059159315, 'fraction_numerical': 0.0, 'mean_word_length': 1.7995642701525054, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '5011470', 'n_tokens_mistral': 1048, 'n_tokens_neox': 978, 'n_words': 176}