예제 #1
0
function editDbTaniere()
{
    global $db_vue_rm;
    $page = "engine_view.php";
    // Récupération des variables du formulaire
    $id_taniere = $_REQUEST['id_taniere'];
    $id_troll_taniere = $_REQUEST['id_troll_taniere'];
    $description_taniere = $_REQUEST['description_taniere'];
    $contenu_taniere = $_REQUEST['contenu_taniere'];
    $vente_taniere = $_REQUEST['vente_taniere'];
    $date_maj_taniere = $_REQUEST['date_maj_taniere'];
    $act = $_REQUEST['act'];
    $date = date("Y-m-d H-i-s");
    // Si l'on veut ajouter la tanière
    if ($act == "new") {
        $lesLieux = selectDbLieux($id_taniere);
        $nbLieux = count($lesLieux);
        if ($nbLieux == 0) {
            $msg = "<br><font color=red><b>La tanière n'existe pas dans la base de données, il faut la voir pour le ";
            $msg .= " rajouter en tant que Tanière.</font></br>";
            die($msg);
        }
        // On l'ajoute dans la base de données
        mysql_query("INSERT into tanieres (id_taniere, id_troll_taniere) VALUES ({$id_taniere}, {$id_troll_taniere})");
        echo mysql_error();
        $info_action = "ajouté";
    } else {
        $info_action = "modifié";
    }
    $sql = " UPDATE tanieres";
    $sql .= " SET id_troll_taniere={$id_troll_taniere},";
    $sql .= " description_taniere='" . addslashes($description_taniere) . "',";
    $sql .= " contenu_taniere='" . addslashes($contenu_taniere) . "',";
    $sql .= " vente_taniere='" . addslashes($vente_taniere) . "',";
    $sql .= " date_maj_taniere='" . $date . "'";
    $sql .= " WHERE id_taniere={$id_taniere}";
    if (!($result = mysql_query($sql, $db_vue_rm))) {
        echo mysql_error();
        echo "<br>chaine sql = {$sql}<br>";
        echo "Erreur dans la mise à jour de la Tanière. Copiez / Collez ce que vous voyez et postez";
        echo " cela dans le forum outils. Merci (ou contactez Bodéga 49145).";
    } else {
        echo "<h1>La tanière {$id_taniere} est {$info_action}</h1>";
        echo "<h2>Id Troll Propriétaire  : {$id_troll_taniere}</h2>";
        echo "<a href='{$page}?troll={$id_troll_taniere}'>Retour à la fiche du troll propriétaire</a> ";
        echo "<a href='{$page}?taniere={$id_taniere}'>Retour à la fiche de la tanière</a>";
    }
}
예제 #2
0
function selectDbMicheline($id_objet_depart, $id_objet_arrivee, $type_objet_depart, $type_objet_arrivee)
{
    global $db_vue_rm;
    $id_objet = $id_objet_depart;
    $type_objet = $type_objet_depart;
    for ($i = 0; $i <= 1; $i++) {
        if ($i == 1) {
            $id_objet = $id_objet_arrivee;
            $type_objet = $type_objet_arrivee;
            $x1 = $x;
            $y1 = $y;
            $z1 = $z;
            $nom1 = $nom;
        }
        switch ($type_objet) {
            case "troll":
                $res = selectDbTrolls($id_objet);
                $res = $res[1];
                if (!userIsGroupSpec() && $res[maj_groupe_spec_troll] == 'oui') {
                    $res[x_troll] = 0;
                    $res[y_troll] = 0;
                    $res[z_troll] = 0;
                }
                $x = $res[x_troll];
                $y = $res[y_troll];
                $z = $res[z_troll];
                $nom = $res[nom_troll];
                break;
            case "monstre":
                $res = selectDbRechercheMonstres($id_objet);
                $x = $res[x_monstre];
                $y = $res[y_monstre];
                $z = $res[z_monstre];
                $nom = $res[nom_monstre];
                break;
            case "lieux":
                $res = selectDbLieux($id_objet);
                $x = $res[x_lieu];
                $y = $res[y_lieu];
                $z = $res[z_lieu];
                $nom = $res[nom_lieu];
                break;
            case "champignons":
                $res = selectDbRechercheChampignons($id_objet);
                $x = $res[x_champi];
                $y = $res[y_champi];
                $z = $res[z_champi];
                $nom = $res[nom_champi];
                break;
        }
    }
    $tab[0]['x'] = $x1;
    $tab[0]['y'] = $y1;
    $tab[0]['z'] = $z1;
    $tab[0]['nom'] = $nom1;
    $tab[1]['x'] = $x;
    $tab[1]['y'] = $y;
    $tab[1]['z'] = $z;
    $tab[1]['nom'] = $nom;
    return $tab;
}
예제 #3
0
function afficherRechercheLieuxResultat($id_lieu, $nom_lieu, $x_lieu, $y_lieu, $z_lieu, $limite, $lesLieux = "")
{
    if (!isset($lesLieux)) {
        $lesLieux = selectDbLieux($id_lieu, $nom_lieu, $x_lieu, $y_lieu, $z_lieu, $limite);
    }
    $nbLieux = count($lesLieux);
    ?>
<br>
   <table  border='0' cellpadding='0' cellspacing='2' class='mh_tdborder' align='center'width='100%'>
    <tr class='mh_tdtitre'>
      <td align='center' colspan='15'>
				<?php 
    echo "R&eacute;sultat de la recherche sur les Lieux : {$nbLieux} trouv&eacute;(s). Position d&eacute;part : ";
    echo " X={$x_lieu}/Y={$y_lieu}/Z={$z_lieu}";
    ?>
			</td>
		</tr>
		<?php 
    if ($nbLieux == 0) {
        echo "</table>";
        return;
    }
    ?>
     	 <tr class='mh_tdtitre'>
			<?php 
    if (is_numeric($x_lieu) && is_numeric($y_lieu) && is_numeric($z_lieu)) {
        echo "<td>Distance en PA</td>";
    }
    ?>
				<td>Nom</td>
				<td colspan=3>Info</td>
				<td>Date de Mise &agrave; jour </td>
				<td>Acc&egrave;s</td>
<?php 
    usort($lesLieux, "callbackSortDistancePa");
    while (list($key, $res) = each($lesLieux)) {
        $i++;
        echo "<tr class='mh_tdpage'>";
        if (is_numeric($x_lieu) && is_numeric($y_lieu) && is_numeric($z_lieu)) {
            echo "<td>{$res['distance_pa']}</td>";
        }
        echo "<td>" . htmlentities($res[nom_lieu]) . " ({$res['id_lieu']})</td>";
        echo "<td width=10>X={$res['x_lieu']}</td>";
        echo "<td width=10>Y={$res['y_lieu']}</td>";
        echo "<td width=40>N={$res['z_lieu']}</td>";
        echo "<td>{$res['date_lieu']}</td>";
        echo "<td>";
        afficherLien("lieu", "vue2d", $res[id_lieu], $res[x_lieu], $res[y_lieu], $res[z_lieu]);
        afficherLien("lieu", "gps", $res[id_lieu], $res[x_lieu], $res[y_lieu], $res[z_lieu]);
        echo "</td>";
        echo "</tr>";
        if ($i > 99) {
            echo "<tr><td colspan='10'><h2><b>Il n'y a que les 100 premiers r&eacute;sultats d'affich&eacute;s, ";
            echo "affinez votre recherche si vous voulez...</b></h2></td></tr>";
            break;
        }
    }
    echo "</table>";
}
예제 #4
0
 function recherche_lieu($val)
 {
     $s = split(",", $val);
     $x_lieu = $this->troll->get_x_troll();
     $y_lieu = $this->troll->get_y_troll();
     $z_lieu = $this->troll->get_z_troll();
     if (!is_numeric($s[0])) {
         $nom_lieu = $s[0];
     }
     if (count($s) == 4) {
         $x_lieu = $s[1];
         $y_lieu = $s[2];
         $z_lieu = $s[3];
     }
     $lesLieux = selectDbLieux($id_lieu, $nom_lieu, $x_lieu, $y_lieu, $z_lieu, $limite);
     afficherRechercheLieuxResultat($id_lieu, $nom_lieu, $x_lieu, $y_lieu, $z_lieu, $limite, $lesLieux);
 }