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
|
<?php require_once('Connections/webalix.php'); ?>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<?php
// récup des $var dans url
if (isset($_GET['menu']) || isset($_GET['rubrique']) || isset($_GET['reference'])) {
$ID_Rub = mysql_real_escape_string($_GET['menu']);
$ID_Srub = mysql_real_escape_string($_GET['rubrique']);
$Refer = mysql_real_escape_string($_GET['reference']);
} else {
$ID_Rub = "1";
$ID_Srub = "0";
$Refer = "0";
}
//echo $ID_Rub;
//echo $ID_Srub;
//echo $Refer;
?>
<?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;
}
}
?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
//param des affichages
$maxRows_rs_Pdt = 1;
$pageNum_rs_Pdt = 0;
if (isset($_GET['pageNum_rs_Pdt'])) {
$pageNum_rs_Pdt = $_GET['pageNum_rs_Pdt'];
}
$startRow_rs_Pdt = $pageNum_rs_Pdt * $maxRows_rs_Pdt;
// REQUETE
mysql_select_db($database_webalix, $webalix);
//Si la variable est vide
if($ID_Rub != 0 && $ID_Srub == 0)
{
$query_rs_Pdt = "SELECT pdt.`Ref`, pdt.Int_Prod, pdt.Descr, pdt.ID_Rub, pdt.picto, pdt.ID_Srub, pdt.V1, pdt.V2, pdt.V3, pdt.Z1, pdt.Z2, pdt.Z3, rub.Int_Rub, srub.Int_Srub FROM pdt LEFT JOIN rub ON rub.ID_Rub = pdt.ID_Rub LEFT JOIN srub ON srub.ID_Srub = pdt.ID_Srub WHERE pdt.ID_Rub = '$ID_Rub'";
}
//Sinon si la Rub n'est pas vide et Srub n'est pas vide
else if($ID_Rub != 0 && $ID_Srub != 0)
{
$query_rs_Pdt = "SELECT pdt.`Ref`, pdt.Int_Prod, pdt.Descr, pdt.ID_Rub, pdt.picto, pdt.ID_Srub, pdt.V1, pdt.V2, pdt.V3, pdt.Z1, pdt.Z2, pdt.Z3, rub.Int_Rub, srub.Int_Srub FROM pdt LEFT JOIN rub ON rub.ID_Rub = pdt.ID_Rub LEFT JOIN srub ON srub.ID_Srub = pdt.ID_Srub WHERE pdt.ID_Rub ='$ID_Rub' AND pdt.ID_Srub ='$ID_Srub'";
}
$rs_Pdt = mysql_query($query_rs_Pdt, $webalix) or die(mysql_error());
$row_rs_Pdt = mysql_fetch_assoc($rs_Pdt);
$totalRows_rs_Pdt = mysql_num_rows($rs_Pdt);
?>
<?php
$query_limit_rs_Pdt = sprintf("%s LIMIT %d, %d", $query_rs_Pdt, $startRow_rs_Pdt, $maxRows_rs_Pdt);
$rs_Pdt = mysql_query($query_limit_rs_Pdt, $webalix) or die(mysql_error());
$row_rs_Pdt = mysql_fetch_assoc($rs_Pdt);
if (isset($_GET['totalRows_rs_Pdt'])) {
$totalRows_rs_Pdt = $_GET['totalRows_rs_Pdt'];
} else {
$all_rs_Pdt = mysql_query($query_rs_Pdt);
$totalRows_rs_Pdt = mysql_num_rows($all_rs_Pdt);
}
$totalPages_rs_Pdt = ceil($totalRows_rs_Pdt/$maxRows_rs_Pdt)-1;
$queryString_rs_Pdt = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_rs_Pdt") == false &&
stristr($param, "totalRows_rs_Pdt") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_rs_Pdt = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_rs_Pdt = sprintf("&totalRows_rs_Pdt=%d%s", $totalRows_rs_Pdt, $queryString_rs_Pdt);
?>
<div id="resultats">
<div id="fiche">
<div id="texte">
<div>
<img src="images/<?php echo $row_rs_Pdt['picto']; ?>.png" />
<a href="liste.php?menu=<?php echo $ID_Rub ?>&rubrique=<?php echo $ID_Srub ?>" Onclick="javascript:window.history.go(0)" title="Rubrique" class="couleur<?php echo $ID_Rub ?>" style="font-size:12px; float:right; margin:10px;" ><br /><br />Liste de la rubrique</a><br /><br />
</div>
<div style="padding:10px;">
<span class="couleur<?php echo $ID_Rub ?>"><strong>Réf : <?php echo $row_rs_Pdt['Ref']; ?><br /></strong></span>
<span class="couleur<?php echo $ID_Rub ?>" style="display:block;"><strong><?php echo $row_rs_Pdt['Int_Prod']; ?></strong></span>
</div>
<p class="texte"><?php echo $row_rs_Pdt['Descr']; ?></p>
</div>
<div id="vignettes">
<?php if ($row_rs_Pdt['Z1']!=NULL) { ?>
<a onMouseOver="update('images/produits/<?php echo $row_rs_Pdt['Z1']; ?>', 0, false); return false;">
<img class="vignette<?php echo $ID_Rub ?>" src="images/produits/<?php echo $row_rs_Pdt['V1']; ?>" /></a>
<?php } else { echo "" ?>
<?php } ?>
<?php if ($row_rs_Pdt['Z2']!=NULL) { ?>
<a onMouseOver="update('images/produits/<?php echo $row_rs_Pdt['Z2']; ?>', 0, false); return false;">
<img class="vignette<?php echo $ID_Rub ?>" src="images/produits/<?php if ($row_rs_Pdt['Z2']) echo $row_rs_Pdt['V2']; ?>" /></a>
<?php } else { echo "" ?>
<?php } ?>
<?php if ($row_rs_Pdt['Z3']!=NULL) { ?>
<a onMouseOver="update('images/produits/<?php echo $row_rs_Pdt['Z3']; ?>', 0, false); return false;">
<img class="vignette<?php echo $ID_Rub ?>" src="images/produits/<?php if($row_rs_Pdt['Z3']) echo $row_rs_Pdt['V3']; ?>" /></a>
<?php } else { echo "" ?>
<?php } ?>
</div>
<div align="center">
<?php if ($pageNum_rs_Pdt > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_rs_Pdt=%d%s", $currentPage, max(0, $pageNum_rs_Pdt - 1), $queryString_rs_Pdt); ?>">
<img src="images/bt_back<?php echo $ID_Rub ?>.png" border="none /></a>
<?php } // Show if not first page ?>
<?php if ($pageNum_rs_Pdt < $totalPages_rs_Pdt) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rs_Pdt=%d%s", $currentPage, min($totalPages_rs_Pdt, $pageNum_rs_Pdt + 1), $queryString_rs_Pdt); ?>">
<img src="images/bt_next<?php echo $ID_Rub ?>.png" border="none" /></a>
<?php } // Show if not last page ?>
</div>
</div>
<div id="separation" style="float:left;"></div>
<div style="background-color:#FFF; float:right; width:600px; height:600px;"><img src="images/produits/<?php echo $row_rs_Pdt['Z1']; ?>" name="zoom"></div>
</div>
<?php mysql_free_result($rs_Pdt);?> |
Partager