コード例 #1
0
function editDbGowap()
{
    global $db_vue_rm;
    $page = "engine_view.php";
    // Récupération des variables du formulaire
    $id_gowap = $_REQUEST['id_gowap'];
    $id_troll_gowap = $_REQUEST['id_troll_gowap'];
    $description_gowap = $_REQUEST['description_gowap'];
    $profil_gowap = $_REQUEST['profil_gowap'];
    $chargement_gowap = $_REQUEST['chargement_gowap'];
    $act = $_REQUEST['act'];
    $date = date("Y-m-d H-i-s");
    // Si l'on veut ajouter le gowap
    if ($act == "new") {
        // On regarde si le gowap existe dans la table monstres
        $lesMonstres = selectDbRechercheMonstres($id_gowap);
        $nbMonstres = count($lesMonstres);
        if ($nbMonstres == 0) {
            $msg = "<br><font color=red><b>Le gowap n'existe pas dans la base de données, il faut le voir pour le ";
            $msg .= " rajouter en tant que Gowap.</font></br>";
            die($msg);
        }
        // On l'ajoute dans la base de données
        mysql_query("INSERT into gowaps (id_gowap, id_troll_gowap) VALUES ({$id_gowap}, {$id_troll_gowap})");
        echo mysql_error();
        $info_action = "ajouté";
    } else {
        $info_action = "modifié";
    }
    $sql = " UPDATE gowaps";
    $sql .= " SET id_troll_gowap={$id_troll_gowap},";
    if ($description_gowap != "") {
        $sql .= " description_gowap='" . addslashes($description_gowap) . "',";
    }
    if ($profil_gowap != "") {
        $sql .= " profil_gowap='" . addslashes($profil_gowap) . "',";
    }
    if ($chargement_gowap != "") {
        $sql .= " chargement_gowap='" . addslashes($chargement_gowap) . "',";
    }
    $sql .= " date_chargement_gowap='" . $date . "'";
    $sql .= " WHERE id_gowap={$id_gowap}";
    if (!($result = mysql_query($sql, $db_vue_rm))) {
        echo mysql_error();
        echo "<br>chaine sql = {$sql}<br>";
        echo "Erreur dans la mise à jour du Gowap. Copiez / Collez ce que vous voyez et postez";
        echo " cela dans le forum outils. Merci (ou contactez Bodéga 49145).";
    } else {
        echo "<h1>Le Gowap {$id_gowap} est {$info_action}</h1>";
        echo "<h2>Id Troll Maître  : {$id_troll_gowap}</h2>";
        echo "<a href='{$page}?troll={$id_troll_gowap}'>Retour à la fiche du troll maître</a> ";
        echo "<a href='{$page}?gowap={$id_gowap}'>Retour à la fiche du gowap</a>";
    }
}
コード例 #2
0
ファイル: gps_advanced_db.php プロジェクト: relaismago/outils
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
ファイル: admin_functions.php プロジェクト: relaismago/outils
function afficherRechercheMonstresResultat($id_monstre, $nom_monstre, $x_monstre, $y_monstre, $z_monstre, $limite, $race, $famille, $niveau, $lesMonstres = "")
{
    if (!isset($lesMonstres)) {
        $lesMonstres = selectDbRechercheMonstres($id_monstre, $nom_monstre, $x_monstre, $y_monstre, $z_monstre, $limite, $race, $famille, $niveau);
    }
    $nbMonstres = count($lesMonstres);
    ?>
 <br>
   <table  border='0' cellpadding='0' cellspacing='0' class='mh_tdborder' align='center'width='100%'>
   	<tr class='mh_tdtitre'>
      <td align='center' colspan='15'>
				<?php 
    echo "R&eacute;sultat de la recherche de Monstres : {$nbMonstres} trouv&eacute;(s). Position d&eacute;part : ";
    echo "X={$x_monstre}/Y={$y_monstre}/Z={$z_monstre} Limite={$limite}";
    ?>
			</td>
		</tr>
	<?php 
    if ($nbMonstres == 0) {
        echo "</table>";
        return;
    }
    ?>
   	<tr class='mh_tdtitre'>
			<?php 
    if (is_numeric($x_monstre) && is_numeric($y_monstre) && is_numeric($z_monstre)) {
        echo "<td>Distance en PA</td>";
    }
    ?>
			<td>Nom</td>
			<td colspan=3>Position</td>
			<td>Race</td>
			<td>Famille</td>
			<td>Niveau</td>
			<td>Date de Mise &agrave; jour </td>
			<td>Acc&egrave;s</td>

<?php 
    usort($lesMonstres, "callbackSortDistancePa");
    while (list($key, $res) = each($lesMonstres)) {
        $i++;
        echo "<tr class='mh_tdpage'>";
        if (is_numeric($x_monstre) && is_numeric($y_monstre) && is_numeric($z_monstre)) {
            echo "<td width='1%'>{$res['distance_pa']}</td>";
        }
        echo "<td>" . htmlentities(utf8_encode($res[nom_monstre])) . " ({$res['id_monstre']})</td>";
        echo "<td width=10>X={$res['x_monstre']}</td>";
        echo "<td width=10>Y={$res['y_monstre']}</td>";
        echo "<td width=40>N={$res['z_monstre']}</td>";
        echo "<td>" . htmlentities(utf8_encode($res[race])) . "</td>";
        echo "<td>" . htmlentities(utf8_encode($res[famille])) . "</td>";
        echo "<td align='center'>" . htmlentities($res[niveau]) . "</td>";
        echo "<td>{$res['date_monstre']}</td>";
        echo "<td>";
        afficherLien("gowap", "vue2d", $res[id_monstre], $res[x_monstre], $res[y_monstre], $res[z_monstre]);
        afficherLien("gowap", "gps", $res[id_monstre], $res[x_monstre], $res[y_monstre], $res[z_monstre]);
        afficherLien("gowap", "mh_evenements", $res[id_monstre], $res[x_monstre], $res[y_monstre], $res[z_monstre]);
        echo "</td>";
        if ($i > 99) {
            echo "</tr><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>";
            break;
        }
        echo "</tr>";
    }
    echo "</table>";
    echo "</td></tr></table>";
}
コード例 #4
0
ファイル: recherche.class.php プロジェクト: relaismago/outils
 function recherche_monstre($val)
 {
     $s = split(",", $val);
     $x_monstre = $this->troll->get_x_troll();
     $y_monstre = $this->troll->get_y_troll();
     $z_monstre = $this->troll->get_z_troll();
     for ($i = 0; $i <= count($s); $i++) {
         if (preg_match("/race=/", $s[$i])) {
             $r = split("=", $s[$i]);
             // $r[1] => nom de la race
             $race = $r[1];
         } elseif (preg_match("/famille=/", $s[$i])) {
             $r = split("=", $s[$i]);
             // $r[1] => nom de la famille
             $famille = $r[1];
         } elseif (preg_match("/niveau=/", $s[$i])) {
             $r = split("=", $s[$i]);
             // $r[1] => niveau
             $niveau = $r[1];
         } else {
             if ($i == 0) {
                 $nom_monstre = $s[0];
             }
         }
         if (is_numeric($s[$i])) {
             $x_monstre = $s[$i];
             $y_monstre = $s[$i + 1];
             $z_monstre = $s[$i + 2];
             $limite = $s[$i + 3];
             break;
         }
     }
     $lesMonstres = selectDbRechercheMonstres($id_monstre, $nom_monstre, $x_monstre, $y_monstre, $z_monstre, $limite, $race, $famille, $niveau);
     afficherRechercheMonstresResultat($id_monstre, $nom_monstre, $x_monstre, $y_monstre, $z_monstre, $limite, $race, $famille, $niveau, $lesMonstres);
 }