$fin = $_SESSION['post']['fin']; $date_fin = strtotime(implode('-', array_reverse(explode('-', $_SESSION['post']['fin'])))); } if ($_POST['disc'] != null) { $pas = $_POST['disc']; } else { $pas = $_SESSION['post']['disc']; } if ($pas == null) { $pas = 10; } if ($_POST['internet'] == 'oui' || $_SESSION['post']['internet'] == 'oui') { //Recherche internet activé $_SESSION['post'] = $_POST; $_SESSION['post']['internet'] = 'non'; recup_tweet($mc); } else { //Affichage des résultats de recherche session_destroy(); if ($date_deb > $date_fin) { $datedeb = strtotime(implode('-', array_reverse(explode('-', $fin))) . " 00:00:00"); $datefin = strtotime(implode('-', array_reverse(explode('-', $deb))) . " 23:59:59"); } else { $datedeb = strtotime(implode('-', array_reverse(explode('-', $deb))) . " 00:00:00"); $datefin = strtotime(implode('-', array_reverse(explode('-', $fin))) . " 23:59:59"); } $data_var = historique($mc, $datedeb, $datefin); $data = courbe_radar($mc, $datedeb, $datefin); $graph = "'" . quadri($pas, $datedeb, $datefin, "") . "'"; $polarity = "'" . courbe_1($datedeb, $datefin, $pas, $mc, "polarity", "rgb(187,187,187)") . "'"; $joy = "'" . courbe_1($datedeb, $datefin, $pas, $mc, "joy", "rgb(255,0,0)") . "'";
//echo "corr : ".$corr.'<br/>'; //sleep(2); $lemm = lemm(strtolower($corr)); //echo "lemm : ";print_r ($lemm);echo "<br/>"; if (count($lemm) > 1) { $vect = vect($lemm); //echo "vect : ";print_r ($vect);echo "<br/>"; if ($vect[7] == 1) { $strtotime = strtotime($data['date'] . " " . $data['heure']); $sql_2 = "UPDATE `post` SET `strtotime`='" . $strtotime . "',`polarity`='" . $vect[0] . "',`joy`='" . $vect[1] . "',`fear`='" . $vect[2] . "',`sadness`='" . $vect[3] . "',`anger`='" . $vect[4] . "',`surprise`='" . $vect[5] . "',`disgust`='" . $vect[6] . "' WHERE `id`= " . $data['id']; $rep_2 = $bdd->query($sql_2); echo "MAJ " . $data['id'] . "<br/>"; } else { $sql_3 = "DELETE FROM `post` WHERE `id`= " . $data['id']; $rep_3 = $bdd->query($sql_3); echo "SUP " . $data['id'] . "<br/>"; } $i++; } else { $sql_3 = "DELETE FROM `post` WHERE `id`= " . $data['id']; $rep_3 = $bdd->query($sql_3); echo "erreur lemmatisation " . $data['id'] . "<br/>"; } } echo $i; header("Refresh: 1;url='http://localhost/projet/index.php'"); } recup_tweet('MAJ 2'); ?> </body> </html>