public function connection()
 {
     /*--------------- recherche de la configuration du fichier conf.init-----------------*/
     include_once 'Mutilitaire.php';
     $utilisateur = Mutilitaire::configuration('utilisateur');
     $mdp = Mutilitaire::configuration('mdp');
     $path = Mutilitaire::configuration('path');
     /*------------------------------------------------------------------------------*/
     $connect = oci_connect(trim($utilisateur), trim($mdp), trim($path));
     return $connect;
 }
예제 #2
0
 public static function resultats($data)
 {
     $path = Mutilitaire::configuration('java_path');
     echo "<div style='width:400px;'>";
     if (shell_exec('java')) {
         if (empty($data)) {
             echo "<div style='Background-color:#FFF'><strong>Votre entrée n'est pas valide !!!</strong></div>";
         } else {
             if ($output = shell_exec($data)) {
                 echo "<div style='Background-color:#FFF'><strong>Commande exécutée : " . $data . "</strong><br/>";
                 echo $output . "<br/><br/><br/><br/></div>";
             } else {
                 echo "<div style='Background-color:#FFF'><strong>Erreur, vérifiez le path dans le fichier conf.ini</strong></div>";
             }
         }
     } else {
         echo "<strong>Votre ordinateur nécéssite l'installation de l'environnement Java</strong><br/>\r\n\t\t\t\t<span style='font-size:10px;'>(Le téléchargement est disponible <a href='http://www.java.com/fr/download/index.jsp'>>>ici<<</a>)</span>";
     }
     echo "</div>";
 }
<?php

session_start();
include 'modeles/Mconnect.php';
include_once 'modeles/Mfilms.php';
include_once 'modeles/Mutilitaire.php';
//je récupère la recherche
$recherche = $_POST['recherche'];
$recherche = utf8_decode($recherche);
//je remplace les caractères spéciaux pour améliorer la recherche dans la BDD
$recherche = str_replace("àáâãäåòóôõöøèéêëçìíîïùúûüÿñ", "aaaaaaooooooeeeeciiiiuuuuyn", $recherche);
$bd = new Mconnect();
$tab = Mfilms::parNom($recherche);
$bd->close();
$nb_element_par_page = Mutilitaire::configuration("nb_pagination");
$nb_pages = ceil(count($tab) / $nb_element_par_page);
$_SESSION['tab'] = $tab;
$_SESSION['nbpages'] = $nb_pages;
$_SESSION['elemparpage'] = $nb_element_par_page;
if ($tab == NULL) {
    echo "<center><div id='avertissement'>";
    echo "<img src='vues/img/attention.gif'/>";
    echo utf8_encode("<span style='color:red;'><strong>&nbsp;&nbsp;&nbsp;&nbsp;Aucun résultat n'à été trouvé&nbsp;&nbsp;&nbsp;&nbsp;</strong></span>");
    echo "<img src='vues/img/attention.gif'/>";
    echo "</div></center>";
} else {
    include 'vues/Vfilm.php';
}
 public function parNom($rech, $nom)
 {
     switch ($rech) {
         case "genre":
             $tab = Mfilms::parGenres($nom);
             $nb_element_par_page = Mutilitaire::configuration("nb_pagination");
             $nb_pages = ceil(count($tab) / $nb_element_par_page);
             $_SESSION['tab'] = $tab;
             $_SESSION['nbpages'] = $nb_pages;
             $_SESSION['elemparpage'] = $nb_element_par_page;
             if ($tab == NULL) {
                 include 'vues/Vfilm_absent.php';
             } else {
                 include 'vues/Vfilm.php';
             }
             break;
         case "alphabet":
             $tab = Mfilms::parAlphabet($nom);
             $nb_element_par_page = Mutilitaire::configuration("nb_pagination");
             $nb_pages = ceil(count($tab) / $nb_element_par_page);
             $_SESSION['tab'] = $tab;
             $_SESSION['nbpages'] = $nb_pages;
             $_SESSION['elemparpage'] = $nb_element_par_page;
             if ($tab == NULL) {
                 include 'vues/Vfilm_absent.php';
             } else {
                 include 'vues/Vfilm.php';
             }
             break;
         case "date":
             echo "date";
             $tab = Mfilms::parDate($nom);
             $nb_element_par_page = Mutilitaire::configuration("nb_pagination");
             $nb_pages = ceil(count($tab) / $nb_element_par_page);
             $_SESSION['tab'] = $tab;
             $_SESSION['nbpages'] = $nb_pages;
             $_SESSION['elemparpage'] = $nb_element_par_page;
             if ($tab == NULL) {
                 include 'vues/Vfilm_absent.php';
             } else {
                 include 'vues/Vfilm.php';
             }
             break;
         case "nom":
             echo "nom";
             $tab = Mfilms::parNom($nom);
             $nb_element_par_page = Mutilitaire::configuration("nb_pagination");
             $nb_pages = ceil(count($tab) / $nb_element_par_page);
             $_SESSION['tab'] = $tab;
             $_SESSION['nbpages'] = $nb_pages;
             $_SESSION['elemparpage'] = $nb_element_par_page;
             if ($tab == NULL) {
                 include 'vues/Vfilm_absent.php';
             } else {
                 include 'vues/Vfilm.php';
             }
             break;
         case "acteur":
             $tab = Mfilms::parActeur($nom);
             $nb_element_par_page = Mutilitaire::configuration("nb_pagination");
             $nb_pages = ceil(count($tab) / $nb_element_par_page);
             $_SESSION['tab'] = $tab;
             $_SESSION['nbpages'] = $nb_pages;
             $_SESSION['elemparpage'] = $nb_element_par_page;
             if ($tab == NULL) {
                 include 'vues/Vfilm_absent.php';
             } else {
                 include 'vues/Vfilm.php';
             }
             break;
         case "realisateur":
             $tab = Mfilms::parRealisateur($nom);
             $nb_element_par_page = Mutilitaire::configuration("nb_pagination");
             $nb_pages = ceil(count($tab) / $nb_element_par_page);
             $_SESSION['tab'] = $tab;
             $_SESSION['nbpages'] = $nb_pages;
             $_SESSION['elemparpage'] = $nb_element_par_page;
             if ($tab == NULL) {
                 include 'vues/Vfilm_absent.php';
             } else {
                 include 'vues/Vfilm.php';
             }
             break;
         case "everything":
             $tab = Mfilms::everything();
             $nb_element_par_page = Mutilitaire::configuration("nb_pagination");
             $nb_pages = ceil(count($tab) / $nb_element_par_page);
             $_SESSION['tab'] = $tab;
             $_SESSION['nbpages'] = $nb_pages;
             $_SESSION['elemparpage'] = $nb_element_par_page;
             if ($tab == NULL) {
                 include 'vues/Vfilm_absent.php';
             } else {
                 include 'vues/Vfilm.php';
             }
             break;
         case "id":
             $tab = Mfilms::parId($nom);
             $acteurs = Mpersonne::acteurParId($nom);
             $realisateurs = Mpersonne::realisateurParId($nom);
             include 'vues/Vafficher_film.php';
             break;
     }
 }