コード例 #1
0
<!-- -------------------------------------------------------------
//TEST UNITAIRE FONCTIONALITÉ AFFICHAGE D'UNE OEUVRE
<div id="contenu">
-->
<h2>Test unitaire - affichage d'une oeuvre</h2>
<div id="contenu">
<?php 
$idOeuvre = 3;
$langue = "FR";
$oeuvre = new Oeuvre();
$oeuvreAffichee = $oeuvre->getOeuvreById($idOeuvre, $langue);
echo "<h3>informations sur l'oeuvre</h3>";
echo "<details>";
echo '<summary>Oeuvre::getOeuvreById($idOeuvre = ' . $idOeuvre . ', $langue = ' . $langue . ')</summary>';
var_dump($oeuvreAffichee);
echo "</details>";
$commentaire = new Commentaire();
$commentairesOeuvre = $commentaire->getCommentairesByOeuvre($idOeuvre, $langue);
echo "<h3>commentaires sur l'oeuvre</h3>";
echo "<details>";
echo '<summary>Commentaire::getCommentairesByOeuvre = ' . $idOeuvre . ', $langue = ' . $langue . ')</summary>';
var_dump($commentairesOeuvre);
echo "</details>";
$photo = new Photo();
$photosOeuvre = $photo->getPhotosByOeuvre($idOeuvre);
echo "<h3>photos associées à l'oeuvre</h3>";
echo "<details>";
echo '<summary>Photo::getPhotosByOeuvre($idOeuvre = ' . $idOeuvre . ')</summary>';
var_dump($photosOeuvre);
echo "</details>";
?>
コード例 #2
0
ファイル: testGestionJson.php プロジェクト: MontreArt/origin
<!-- -------------------------------------------------------------
//TEST UNITAIRE FONCTIONALITÉ GESTION JSON
<div id="contenu">
-->
<h2>Test unitaire - résultats insertion / update des oeuvres du Json</h2>
<div id="contenu">
<br>
<form name="formTestJson" method="get">
    <input type="submit" name="testJson" value="Tester">
</form>
<?php 
$oeuvre = new Oeuvre();
if (isset($_GET["testJson"])) {
    $oeuvre->updaterOeuvresVille();
    $date = $oeuvre->getDateDernierUpdate();
}
$oeuvre->afficherTestJson();
if (!empty($date)) {
    echo "<br>La dernière mise à jour a été effectuée le " . $date["dateDernierUpdate"] . " à " . $date["heureDernierUpdate"];
}
?>
</div>





コード例 #3
0
<h2>Test unitaire - ajout oeuvre BDD</h2>
<div id="contenu">
<?php 
$oeuvre = new Oeuvre();
$arrondissement = new Arrondissement();
$categorie = new Categorie();
$idOeuvre = "";
$arrondissementsBDD = $arrondissement->getAllArrondissements();
$categoriesBDD = $categorie->getAllCategories('FR');
if (isset($_GET["testajoutOeuvre"])) {
    if (!empty($_GET["titreAjout"]) && !empty($_GET["prenomArtisteAjout"]) && !empty($_GET["adresseAjout"]) && !empty($_GET["descriptionAjout"]) && !empty($_GET["nomArtisteAjout"]) && !empty($_GET["selectArrondissement"]) && !empty($_GET["selectCategorie"])) {
        $oeuvre->ajouterOeuvrePourTest($_GET['titreAjout'], $_GET['adresseAjout'], $_GET['prenomArtisteAjout'], $_GET['nomArtisteAjout'], $_GET['descriptionAjout'], $_GET["selectCategorie"], $_GET["selectArrondissement"], true, 'FR');
        $idOeuvre = $oeuvre->getIdOeuvreByTitreandAdresse($_GET['titreAjout'], $_GET['adresseAjout']);
        //aller chercher id oeuvre insérée
    } else {
        echo "ne laissez rien en blanc";
    }
}
?>
   
    
    <form method="get" name="formTestsuppOeuvre" enctype="multipart/form-data">                
                <input type='text' name='titreAjout' value="" placeholder="Titre de l'oeuvre (si connu)"/>  
                <input type='text' name='prenomArtisteAjout' value="" placeholder="Prénom de l'artiste (si connu)"/>
                <input type='text' name='nomArtisteAjout' value="" placeholder="Nom de l'artiste (si connu)"/>
                <input type='text' name='adresseAjout' value="" placeholder="Adresse (obligatoire)"/>   
                <textarea name='descriptionAjout' placeholder="Description (obligatoire)"></textarea>
                <select name="selectArrondissement">
                    <option value="">Choisir un arrondissement</option>
                    <?php 
foreach ($arrondissementsBDD as $arrondissement) {
コード例 #4
0
ファイル: ajaxControler.php プロジェクト: MontreArt/origin
function googleMapTrajet($lat, $lng)
{
    $dom = new DOMDocument("1.0");
    $node = $dom->createElement("markers");
    $parnode = $dom->appendChild($node);
    $center_lat = $lat;
    $center_lng = $lng;
    $oeuvre = new Oeuvre();
    $infoOeuvre = $oeuvre->getOeuvresProximite($center_lat, $center_lng);
    // ADD TO XML DOCUMENT NODE
    for ($i = 0; $i < count($infoOeuvre); $i++) {
        $node = $dom->createElement("marker");
        $newnode = $parnode->appendChild($node);
        $newnode->setAttribute("name", $infoOeuvre[$i]["titre"]);
        $newnode->setAttribute("lat", $infoOeuvre[$i]["latitude"]);
        $newnode->setAttribute("lng", $infoOeuvre[$i]["longitude"]);
        $newnode->setAttribute("distance", $infoOeuvre[$i]['distance']);
    }
    header("Content-type: text/xml");
    //echo $dom->saveXML();
}
コード例 #5
0
ファイル: Oeuvre.class.php プロジェクト: cmahneke/origin
 function __construct()
 {
     $this->nbPassesUpdater = 0;
     $this->nbPassesAjouter = 0;
     if (!isset(self::$database)) {
         //Connection à la BDD si pas déjà connecté
         self::$database = BaseDeDonnees::getInstance();
     }
 }
コード例 #6
0
ファイル: Controler.class.php プロジェクト: cmahneke/origin
 /**
  * @brief Méthode qui affiche les résultats de la recherche utilisateur
  * @access private
  * @return void
  */
 private function recherche()
 {
     $oeuvres = array();
     if (isset($_POST["boutonRecherche"])) {
         if (isset($_POST["selectArrondissement"]) && $_POST["selectArrondissement"] != "") {
             $oeuvre = new Oeuvre();
             $oeuvres = $oeuvre->getAllOeuvresByArrondissement($_POST["selectArrondissement"]);
         } else {
             if (isset($_POST["selectCategorie"]) && $_POST["selectCategorie"] != "") {
                 $oeuvre = new Oeuvre();
                 $oeuvres = $oeuvre->getAllOeuvresByCategorie($_POST["selectCategorie"]);
             }
         }
     } else {
         if (isset($_GET["rechercheParArtiste"])) {
             $oeuvre = new Oeuvre();
             $oeuvres = $oeuvre->getAllOeuvresByArtiste($_GET["rechercheParArtiste"]);
         } else {
             if (isset($_POST["boutonRechercheMobile"])) {
                 if (isset($_POST["selectArrondissementMobile"]) && $_POST["selectArrondissementMobile"] != "") {
                     $oeuvre = new Oeuvre();
                     $oeuvres = $oeuvre->getAllOeuvresByArrondissement($_POST["selectArrondissementMobile"]);
                 } else {
                     if (isset($_POST["selectCategorieMobile"]) && $_POST["selectCategorieMobile"] != "") {
                         $oeuvre = new Oeuvre();
                         $oeuvres = $oeuvre->getAllOeuvresByCategorie($_POST["selectCategorieMobile"]);
                     }
                 }
             } else {
                 if (isset($_GET["rechercheParArtisteMobile"])) {
                     $oeuvre = new Oeuvre();
                     $oeuvres = $oeuvre->getAllOeuvresByArtiste($_GET["rechercheParArtisteMobile"]);
                 }
             }
         }
     }
     $this->oVue = new VueRecherche();
     $this->oVue->setDataGlobal('recherche', 'page de recherche', $this->langueAffichage, $this->pRecherche);
     $this->oVue->setOeuvres($oeuvres);
     $this->oVue->afficherMeta();
     $this->oVue->afficherEntete();
     $this->oVue->afficherBody();
     $this->oVue->afficherPiedPage();
 }
コード例 #7
0
<h2>Test unitaire - recherche autocomplete</h2>
<div id="contenu">
<?php 
if (isset($_GET['testAutocomplete'])) {
    if (isset($_GET["titre"]) && $_GET["titre"] != "") {
        $oeuvre = new Oeuvre();
        $data = $oeuvre->chercheParTitre($_GET['keyword']);
        echo "recherche par titre :<br>";
        var_dump($data);
        echo "<br><br><br>";
    }
    if (isset($_GET["artiste"]) && $_GET["artiste"] != "") {
        $artiste = new Artiste();
        $data = $artiste->chercheParArtiste($_GET['keyword']);
        echo "recherche par artiste :<br>";
        var_dump($data);
        echo "<br><br><br>";
    }
}
?>
    <form name="formTestAutocomplete" method="get">
        <input type="text" name="titre" placeholder="par titre">
        <input type="text" name="artiste" placeholder="par artiste">
        <input type="submit" name="testAutocomplete" value="Tester">
    </form>
</div>
コード例 #8
0
<h2>Test unitaire - suppresion oeuvre BDD</h2>
<div id="contenu">
<?php 
$oeuvre = new Oeuvre();
if (isset($_GET["testsuppOeuvre"])) {
    if (!empty($_GET["selectOeuvre"])) {
        $oeuvre->supprimerOeuvre($_GET["selectOeuvre"]);
    } else {
        echo "aucune oeuvre sélectionnée";
    }
}
$oeuvresBDD = $oeuvre->getAllOeuvres();
?>
    <form name="formTestsuppOeuvre" method="get">
        <select name="selectOeuvre">
            <option value="">choisir une oeuvre à supprimer</option>
            <?php 
foreach ($oeuvresBDD as $oeuvreBDD) {
    echo "<option value='" . $oeuvreBDD["idOeuvre"] . "'>" . $oeuvreBDD["titre"] . "</option>";
}
?>
        </select>
        <input type="submit" name="testsuppOeuvre" value="supprimer">
    </form>
</div>
コード例 #9
0
ファイル: Controler.class.php プロジェクト: MontreArt/origin
 /**
  * @brief Méthode qui affiche les résultats de la recherche utilisateur
  * @access private
  * @return void
  */
 private function recherche()
 {
     $oeuvres = array();
     $typeRecherche = "";
     $nomRecherche = "";
     if (isset($_POST["boutonRecherche"])) {
         if (isset($_POST["selectArrondissement"]) && $_POST["selectArrondissement"] != "") {
             $oeuvre = new Oeuvre();
             $oeuvres = $oeuvre->getAllOeuvresByArrondissement($_POST["selectArrondissement"]);
             $typeRecherche = "par arrondissement";
             $arrondissement = new Arrondissement();
             $nomRecherche = $arrondissement->getArrondissementNameById($_POST["selectArrondissement"]);
         } else {
             if (isset($_POST["selectCategorie"]) && $_POST["selectCategorie"] != "") {
                 $oeuvre = new Oeuvre();
                 $oeuvres = $oeuvre->getAllOeuvresByCategorie($_POST["selectCategorie"]);
                 $typeRecherche = "par catégorie";
                 $categorie = new Categorie();
                 $nomRecherche = $categorie->getCategorieNameById($_POST["selectCategorie"]);
             }
         }
     } else {
         if (isset($_GET["rechercheParArtiste"])) {
             $oeuvre = new Oeuvre();
             $oeuvres = $oeuvre->getAllOeuvresByArtiste($_GET["rechercheParArtiste"]);
             $typeRecherche = "par artiste";
             $nomRecherche = $_GET["nomArtiste"];
         } else {
             if (isset($_POST["boutonRechercheMobile"])) {
                 if (isset($_POST["selectArrondissementMobile"]) && $_POST["selectArrondissementMobile"] != "") {
                     $oeuvre = new Oeuvre();
                     $oeuvres = $oeuvre->getAllOeuvresByArrondissement($_POST["selectArrondissementMobile"]);
                     $typeRecherche = "par arrondissement";
                     $arrondissement = new Arrondissement();
                     $nomRecherche = $arrondissement->getArrondissementNameById($_POST["selectArrondissementMobile"]);
                 } else {
                     if (isset($_POST["selectCategorieMobile"]) && $_POST["selectCategorieMobile"] != "") {
                         $oeuvre = new Oeuvre();
                         $oeuvres = $oeuvre->getAllOeuvresByCategorie($_POST["selectCategorieMobile"]);
                         $typeRecherche = "par catégorie";
                         $categorie = new Categorie();
                         $nomRecherche = $categorie->getCategorieNameById($_POST["selectCategorieMobile"]);
                     }
                 }
             } else {
                 if (isset($_GET["rechercheParArtisteMobile"])) {
                     $oeuvre = new Oeuvre();
                     $oeuvres = $oeuvre->getAllOeuvresByArtiste($_GET["rechercheParArtisteMobile"]);
                     $typeRecherche = "par artiste";
                     $nomRecherche = $_GET["nomArtiste"];
                 }
             }
         }
     }
     if (isset($oeuvres)) {
         $photo = new Photo();
         $oeuvresTemp = array();
         foreach ($oeuvres as $oeuvre) {
             if ($photoOeuvre = $photo->getPhotoByOeuvre($oeuvre["idOeuvre"])) {
                 $oeuvre["photo"] = $photoOeuvre["image"];
             }
             $oeuvresTemp[] = $oeuvre;
         }
         $oeuvres = $oeuvresTemp;
     }
     $this->oVue = new VueRecherche();
     $this->oVue->setDataGlobal('recherche', 'page de recherche', $this->langueAffichage, $this->pRecherche);
     $this->oVue->setData($oeuvres, $typeRecherche, $nomRecherche);
     $this->oVue->afficherMeta();
     $this->oVue->afficherEntete();
     $this->oVue->afficherBody();
     $this->oVue->afficherPiedPage();
 }