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 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
| <?php require_once('../Connections/maBoutique.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "-1";
if (isset($_GET['rubriqueID'])) {
$colname_Recordset1 = $_GET['rubriqueID'];
}
mysql_select_db($database_maBoutique, $maBoutique);
$query_Recordset1 = sprintf("SELECT * FROM articles WHERE rubriqueID = %s", GetSQLValueString($colname_Recordset1, "int"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $maBoutique) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$maxRows_Recordset2 = 10;
$pageNum_Recordset2 = 0;
if (isset($_GET['pageNum_Recordset2'])) {
$pageNum_Recordset2 = $_GET['pageNum_Recordset2'];
}
$startRow_Recordset2 = $pageNum_Recordset2 * $maxRows_Recordset2;
mysql_select_db($database_maBoutique, $maBoutique);
$query_Recordset2 = "SELECT * FROM rubriques";
$query_limit_Recordset2 = sprintf("%s LIMIT %d, %d", $query_Recordset2, $startRow_Recordset2, $maxRows_Recordset2);
$Recordset2 = mysql_query($query_limit_Recordset2, $maBoutique) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
if (isset($_GET['totalRows_Recordset2'])) {
$totalRows_Recordset2 = $_GET['totalRows_Recordset2'];
} else {
$all_Recordset2 = mysql_query($query_Recordset2);
$totalRows_Recordset2 = mysql_num_rows($all_Recordset2);
}
$totalPages_Recordset2 = ceil($totalRows_Recordset2/$maxRows_Recordset2)-1;
$colname_Recordset3 = "-1";
if (isset($_GET['reference'])) {
$colname_Recordset3 = $_GET['reference'];
}
mysql_select_db($database_maBoutique, $maBoutique);
$query_Recordset3 = sprintf("SELECT * FROM articles WHERE reference = %s", GetSQLValueString($colname_Recordset3, "text"));
$Recordset3 = mysql_query($query_Recordset3, $maBoutique) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
function toutmajuscule($chaine){
$acc = array('ç','à','á','â','è','é','ê','ò','ó','ô','ù','ú','û','À','Á','Â','È','É','Ê','Ì','Í','Î','Ò','Ó','Ô','Ù','Ú','Û');
$sans = array('C','A','A','A','E','E','E','O','O','O','U','U','U','A','A','A','E','E','E','I','I','I','O','O','O','U','U','U');
$mot = str_replace($acc,$sans,$chaine);
return strtoupper($mot);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
}
div#header {
text-align: center;
background-color: #CCCCCC;
height: 60px;
margin: 0px;
padding: 1px;
}
div#column1 {
margin: 0;
padding: 0;
background-image: url(images/side1.gif);
background-position: right;
background-repeat: repeat-y;
width: 100%;
background-color: #FFFF99;
}
div#column2 {
margin: 0px;
padding: 0px;
background-image: url(images/side1.gif);
background-repeat: repeat-y;
width: 100%;
}
div#navcol {
padding: 10px;
width: 260px;
float: left;
}
div#navcolb {
padding: 10px;
width: 130px;
float: left;
background-color:#009;
}
div#main {
padding: 10px;
margin-left: 300px;
margin-right: 160px;
}
div#sidecol {
padding: 10px;
width: 130px;
float: right;
}
div#foot {
border-top: solid #000 1px;
background-color: #CCCCCC;
padding: 10px;
text-align: center;
clear: both;
}
.clear {
clear: both;
display: block;
height: 1px;
overflow: hidden;
margin: 0;
padding: 0;
}
#container {
position: relative;
width: 600px;
text-align: left;
border: 4px solid #AF9D4C;
background-color: #AF9D4C;
margin-top: 3em;
margin-right: auto;
margin-bottom: 3em;
margin-left: 10px;
}
#container * {
margin: 0;
padding: 0;
}
#container ul#menu {
position: relative;
width: 100%;
font-weight: bold;
}
#container ul#menu li {
float: left;
display: inline;
}
#container ul#menu li a {
text-align: center;
display: block;
width: 200px;
height: 25px;
line-height: 25px;
text-decoration: none;
}
#container ul#menu li a:hover {
background-color: #EFDC86;
}
#container h1,
#container h2 {
margin: 0.5em 0 0.5em 0;
font-size: 1.4em;
}
#container .content {
padding: 1em 2em;
margin: -2px 0 0 0;
_margin: -16px 0 0 0;
background-color: #E7FFCF;
}
#container hr {
clear: both;
visibility: hidden;
}
#container a.current {
background-color: #E7FFCF;
color: #000;
}
#container a.ghost {
background-color: #AF9D4C;
color: #000;
}
#container .on {
display: block;
}
#container .off {
display: none;
}
-->
</style>
<script type="text/javascript" src="carte/js/swfobject.js"></script>
<script type="text/javascript" src="carte/js/jquery-1.2.6.min.js"></script>
<script language="javascript">
<!--
$(document).ready( function () {
// On cache les sous-menus :
$(".navigation ul.subMenu").hide();
// On sélectionne tous les items de liste portant la classe "toggleSubMenu"
// et on remplace l'élément span qu'ils contiennent par un lien :
$(".navigation li.toggleSubMenu span").each( function () {
// On stocke le contenu du span :
var TexteSpan = $(this).text();
$(this).replaceWith('<a href="" title="Afficher le sous-menu">' + TexteSpan + '<\/a>') ;
} ) ;
// On modifie l'évènement "click" sur les liens dans les items de liste
// qui portent la classe "toggleSubMenu" :
$(".navigation li.toggleSubMenu > a").click( function () {
// Si le sous-menu était déjà ouvert, on le referme :
if ($(this).next("ul.subMenu:visible").length != 0) {
$(this).next("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") });
}
// Si le sous-menu est caché, on ferme les autres et on l'affiche :
else {
$(".navigation ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") });
$(this).next("ul.subMenu").slideDown("normal", function () { $(this).parent().addClass("open") });
}
// On empêche le navigateur de suivre le lien :
return false;
});
} ) ;
</script>
</head>
<body>
<div id="header">
<h1>EN TETE</h1>
</div>
<div id="column2">
<div id="column1">
<div id="navcol">
<span id="menu">
<ul class="navigation">
<?php
//---- menu des regions et des departements
$selreg = mysql_query("SELECT * FROM rubriques");
while($reg=mysql_fetch_array($selreg)) {
echo '<li class="toggleSubMenu"><span>'.toutmajuscule($reg['theme']).'</span>';
echo '<ul class="subMenu">';
$seldep= mysql_query("SELECT * FROM articles WHERE rubriqueID ='".$reg['ID']."'");
while($dep = mysql_fetch_array($seldep)) {
echo "<li><a href='test_exo.php?reference=$dep[reference]'>".$dep['titre']."</a></li>";
}
echo '</ul>';
echo '</li>';
}
?>
</ul>
</span>
</div>
<div id="main">
<h2><?php echo $row_Recordset3['titre']; ?></h2>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
mysql_free_result($Recordset3);
?> |
Partager