1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
| <?php
require_once('../xajax_core/xajax.inc.php');
$xajax = new xajax(); // On initialise l'objet xajax.
$xajax->register(XAJAX_FUNCTION, 'MaFonctionPHP'); // Déclaration de la fonction MaFonctionPHP.
$xajax->processRequest(); // Fonction qui va se charger de générer le Javascript à partir des données que l'on a fournies à xAjax.
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>Administrateur</title>
<link href="member1.css" rel="stylesheet" type="text/css">
<style type="text/css">
body,td,th {
font-size: 0.9em;
}
body {
background-color: #CED8F6;
}
<?php $xajax->printJavascript();?>
<?php include('config.php') ?>
</style>
<script language="javascript">
function confirme(op)
{
var val=(confirm("Voulez-vous vraiment supprimer la ligne "))?true:false;
if(val==true)
RecoReac(op);
}
function RecoReac(NumReac){
var xhr_object = null;
if(window.XMLHttpRequest) // Firefox
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // Internet Explorer
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else { // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
return;
}
xhr_object.open("POST", "supp.php", true);
xhr_object.onreadystatechange = function anonymous() {
if(xhr_object.readyState == 4)
eval(xhr_object.responseText);
}
xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
var data = "NUMREAC="+NumReac;
xhr_object.send(data);
}
</script>
</head>
<body>
<div id="content">
<header id="banner" ;>
</header>
</div>
<div>
<ul id="menu">
<li><a href="../index.php">Acceuil</a></li>
<li><a href="../poc.php">Poc</a></li>
<li><a href="../Configuration.php">Config.matos</a></li>
<li><a href="#">Contact</a></li>
<li>
<a href="#">Gestion Moie</a>
<ul>
<li><a href="sign_up.php">Inscription</a></li>
<li><a href="users.php">Utilisateur</a></li>
</ul>
</li>
</ul>
</div>
<div id ='montab'>
<?php
//=========================================
// includes du fichier fonctions
//=========================================
require '../fonctions.php';
require_once('../connexion.inc.php');
//=========================================
// information pour la connection à le DB
//=========================================
//=========================================
// initialisation des variables
//=========================================
// on va afficher 5 résultats par page.
$nombre = 20;
// si limite n'existe pas on l'initialise à zéro
if (!$limite) $limite = 0;
// on cherche le nom de la page.
$path_parts = pathinfo($_SERVER['PHP_SELF']);
$page = $path_parts["basename"];
//=========================================
// connection à la DB
//=========================================
//=========================================
// requête SQL qui compte le nombre total
// d'enregistrements dans la table.
//=========================================
$select = 'SELECT count(Id) FROM configurations';
$result = mysql_query($select);
$row = mysql_fetch_row($result);
$total = $row[0];
//=========================================
// vérifier la validité de notre variable
// $limite;
//=========================================
$verifLimite= verifLimite($limite,$total,$nombre);
// si la limite passée n'est pas valide on la remet à zéro
if(!$verifLimite) {
$limite = 0;
}
//=========================================
// requête SQL qui ne prend que le nombre
// d'enregistrement necessaire à l'affichage.
//=========================================
$select = 'SELECT Id,Bigramme,Installation,1,2,3,4,5,6,Materiel,Commentaire,En_charge FROM configurations LIMIT ' .$limite.','.$nombre;
$result = mysql_query($select);
$lien_de_l_image = "default/images/modif.png";
$lien_de_l_imagesupp = "default/images/supp.png";
//=========================================
// si on a récupéré un resultat on l'affiche.
//=========================================
if($total) {
// début du tableau
echo '<table bgcolor="#FFFFFF">'."\n";
//
echo '<tr>';
echo '<td bgcolor="#669999"><b><u>Id</u></b></td>';
echo '<td bgcolor="#669999"><b><u>Id</u></b></td>';
echo '<td bgcolor="#669999"><b><u>Bigramme</u></b></td>';
echo '<td bgcolor="#669999"><b><u>Installation</u></b></td>';
echo '<td bgcolor="#669999"><b><u>Materiel</u></b></td>';
echo '<td bgcolor="#669999"><b><u>1</u></b></td>';
echo '<td bgcolor="#669999"><b><u>2</u></b></td>';
echo '<td bgcolor="#669999"><b><u>3</u></b></td>';
echo '<td bgcolor="#669999"><b><u>4</u></b></td>';
echo '<td bgcolor="#669999"><b><u>5</u></b></td>';
echo '<td bgcolor="#669999"><b><u>6</u></b></td>';
echo '<td bgcolor="#669999"><b><u>Commentaire</u></b></td>';
echo '<td bgcolor="#669999"><b><u>En_charge</u></b></td>';
echo '</tr>'."\n";
while($row = mysql_fetch_array($result)) {
echo '<tr>';
?>
<td bgcolor="#CCCCCC"><a href="../espace_membre/modif_conf.php?var=<?php echo $row['Id'] ?>">
<?php
echo "<img src='".$lien_de_l_image."' alt='' title='Modifier'/a>";
?>
</td>
<td bgcolor="#CCCCCC"><a href="#">
<?php
echo "<img src='".$lien_de_l_imagesupp."' alt='' title='Supprimer' onclick='confirme(".$row['Id'].")'/a>";
?>
</td>
<?php
echo '<td bgcolor="#CCCCCC">'.$row["Bigramme"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["Installation"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["Materiel"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["1"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["2"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["3"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["4"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["5"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["6"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["Commentaire"].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row["En_charge"].'</td>';
echo '</tr>'."\n";
}
echo '</table>'."\n";
}
else echo 'Pas d\'enregistrements dans cette table...';
mysql_free_result($result);
//=========================================
// si le nombre d'enregistrement à afficher
// est plus grand que $nombre
//=========================================
if($total > $nombre) {
// affichage des liens vers les pages
affichePages($nombre,$page,$total);
// affichage des boutons
}
?>
</div>
</body>
</html> |
Partager