|
| 1 | +<?php print("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); ?> |
| 2 | +<?php |
| 3 | + |
| 4 | +include("lib-general.php"); |
| 5 | +include("../mysql.php"); |
| 6 | +###################################################################### |
| 7 | +# variables # |
| 8 | +###################################################################### |
| 9 | +# différentes variables |
| 10 | +$pseudo = testPostVar("pseudo","aucun pseudo fourni"); |
| 11 | +$adresse_ip = $_SERVER['REMOTE_ADDR']; |
| 12 | +$poids = 1; |
| 13 | + |
| 14 | +###################################################################### |
| 15 | +# base de données # |
| 16 | +###################################################################### |
| 17 | +# connnexion à la base de données |
| 18 | +$connexion = mysql_connect($mon_hote, $mon_pseudo, $mon_mdp) or die("impossible de se connecter... <!-- ".mysql_error()." -->\n"); |
| 19 | + |
| 20 | +# création de la base si elle n'existe pas |
| 21 | +mysql_query("CREATE DATABASE IF NOT EXISTS myah"); |
| 22 | +# selection de la base de donnees |
| 23 | +mysql_select_db($ma_base) or die("impossible d'ouvrir la base de donnees."); |
| 24 | +# création de la table si elle n'existe pas |
| 25 | +mysql_query("CREATE TABLE IF NOT EXISTS myah ( |
| 26 | + id_user MEDIUMINT (9) NOT NULL AUTO_INCREMENT, |
| 27 | + adr_IP VARCHAR (15) NOT NULL, |
| 28 | + pseudo VARCHAR (20) NOT NULL, |
| 29 | + poids SMALLINT (9) NOT NULL default '1', |
| 30 | + date_crea DATETIME DEFAULT NULL, |
| 31 | + date_visit DATETIME DEFAULT NULL, |
| 32 | + INDEX(id_user))") or die("impossible de créer la table 'myah'\n <!-- ".mysql_error()." -->\n"); |
| 33 | + |
| 34 | +$select_IP = mysql_query("SELECT * FROM myah") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n"); |
| 35 | + |
| 36 | +?> |
| 37 | + |
| 38 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 39 | +<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"> |
| 40 | + <head> |
| 41 | + <title>myah / administration</title> |
| 42 | + |
| 43 | + <meta http-equiv="Content-language" content="fr" /> |
| 44 | + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
| 45 | + <meta name="robots" content="noindex,nofollow" /> |
| 46 | + <link rel="stylesheet" type="text/css" href="../css/defaut/defaut.css" title="défaut" /> |
| 47 | + </head> |
| 48 | + |
| 49 | + <body> |
| 50 | + <div id="contenant"> |
| 51 | + <h1> |
| 52 | + <a href="../"> |
| 53 | + <strong>m</strong>ake <strong>y</strong>ourself <strong>a</strong> <strong>h</strong>ome |
| 54 | + </a> |
| 55 | + </h1> |
| 56 | + <div id="console"> |
| 57 | + <table> |
| 58 | + <caption> |
| 59 | + les dix dernières visites : |
| 60 | + </caption> |
| 61 | + <tr> |
| 62 | + <th>date de dernière visite</th> |
| 63 | + <th>pseudo</th> |
| 64 | + <th>poids</th> |
| 65 | + <th>numéro d'inscription</th> |
| 66 | + <th>adresse IP</th> |
| 67 | + </tr> |
| 68 | + |
| 69 | +<?php |
| 70 | + $select_IP = mysql_query("SELECT * FROM myah WHERE date_visit != '0000-00-00 00:00:00' ORDER BY date_visit DESC LIMIT 10") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n"); |
| 71 | + while($col = mysql_fetch_object($select_IP)) { |
| 72 | + print(" |
| 73 | + <tr> |
| 74 | + <td>".date_validation($col->date_visit, "d.m.Y - H:i")."</td> |
| 75 | + <td>".$col->pseudo."</td> |
| 76 | + <td>".$col->poids."</td> |
| 77 | + <td>".$col->id_user."</td> |
| 78 | + <td>".$col->adr_IP."</td> |
| 79 | + </tr>"); |
| 80 | + } |
| 81 | +?> |
| 82 | + </table> |
| 83 | + <table> |
| 84 | + <caption> |
| 85 | + les derniers referers : |
| 86 | + </caption> |
| 87 | + <tr> |
| 88 | + <th>date</th> |
| 89 | + <th><abbr title="Uniform resource locator">URL</abbr></th> |
| 90 | + <th>navigateur</th> |
| 91 | + </tr> |
| 92 | + |
| 93 | +<?php |
| 94 | + $select_referer = mysql_query("SELECT * FROM myah_referers ORDER BY date DESC LIMIT 10") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n"); |
| 95 | + while($col = mysql_fetch_object($select_referer)) { |
| 96 | + print(" |
| 97 | + <tr> |
| 98 | + <td>".date_validation($col->date, "d.m.Y - H:i")."</td> |
| 99 | + <td><a href=\"".$col->site_url."\">".$col->site_url."</a></td> |
| 100 | + <td>".$col->navig."</td> |
| 101 | + </tr>"); |
| 102 | + } |
| 103 | +?> |
| 104 | + </table> |
| 105 | + <table> |
| 106 | + <caption> |
| 107 | + les dix derniers inscrits : |
| 108 | + </caption> |
| 109 | + <tr> |
| 110 | + <th>numéro d'inscription</th> |
| 111 | + <th>date de première visite</th> |
| 112 | + <th>date de dernière visite</th> |
| 113 | + <th>pseudo</th> |
| 114 | + <th>poids</th> |
| 115 | + <th>adresse IP</th> |
| 116 | + </tr> |
| 117 | + |
| 118 | +<?php |
| 119 | + $select_IP = mysql_query("SELECT * FROM myah ORDER BY id_user DESC LIMIT 10") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n"); |
| 120 | + while($col = mysql_fetch_object($select_IP)) { |
| 121 | + print(" |
| 122 | + <tr> |
| 123 | + <td>".$col->id_user."</td> |
| 124 | + <td>".date_validation($col->date_crea, "d.m.Y - H:i")."</td> |
| 125 | + <td>".date_validation($col->date_visit, "d.m.Y - H:i")."</td> |
| 126 | + <td>".$col->pseudo."</td> |
| 127 | + <td>".$col->poids."</td> |
| 128 | + <td>".$col->adr_IP."</td> |
| 129 | + </tr>"); |
| 130 | + } |
| 131 | +?> |
| 132 | + </table> |
| 133 | + <table> |
| 134 | + <caption> |
| 135 | + les dix plus présents : |
| 136 | + </caption> |
| 137 | + <tr> |
| 138 | + <th>poids</th> |
| 139 | + <th>pseudo</th> |
| 140 | + <th>numéro d'inscription</th> |
| 141 | + </tr> |
| 142 | +<?php |
| 143 | + $select_IP = mysql_query("SELECT * FROM myah ORDER BY poids DESC, date_visit DESC LIMIT 10") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n"); |
| 144 | + while($col = mysql_fetch_object($select_IP)) { |
| 145 | + print(" |
| 146 | + <tr> |
| 147 | + <td>".$col->poids."</td> |
| 148 | + <td>".$col->pseudo."</td> |
| 149 | + <td>".$col->id_user."</td> |
| 150 | + </tr>"); |
| 151 | + } |
| 152 | +?> |
| 153 | + </table> |
| 154 | + </div> |
| 155 | + <div> |
| 156 | + <object type="model/vrml" data="../vrml_boxes.php" viewpoint_transition_mode="1" vrml_dashboard="false" standby="chargement en cours..." width="400" height="250"> |
| 157 | + <param name="classid" value="CLSID:86A88967-7A20-11d2-8EDA-00600818EDB1" /> |
| 158 | + <param name="codebase" value="http://www.parallelgraphics.com/bin/cortvrml.cab#Version=4,2,0,93" /> |
| 159 | + </object> |
| 160 | + </div> |
| 161 | + </div> |
| 162 | + </body> |
| 163 | +</html> |
| 164 | +<?php |
| 165 | +# deconnexion |
| 166 | +mysql_close($connexion) or die("probleme durant la deconnexion."); |
| 167 | +?> |
0 commit comments