Files

222 lines
5.9 KiB
PHP
Executable File

<?php
session_start();
$deconnect=$HTTP_GET_VARS["deconnect"];
$deconnetc=$HTTP_GET_VARS["deconnetc"];
// session_unregister("compt");
?>
<html>
<head>
<title></title>
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="./style.css">
</head>
<?php
require("connexion.php");
$conn = mysql_connect($host, $user, $password);
mysql_select_db($bdd) or die("Impossible d'ouvrir la base de donnee $bdd");
?>
<?php
if (isset($_SESSION['idadm']))
{
if($deconnect==1)
{
session_unregister("idadm");
}
}
if (isset($_SESSION['idcli']))
{
if($deconnetc==1)
{
session_unregister("idcli");
}
}
?>
<body text="#FFFFFF" vlink="#FFFFFF" class="bgcolor">
<table width="200" border="1">
<tr>
<td><form name="frech" action="produit/recherche.php" method="POST">
<table border=0>
<tr align=center>
<td valign=top>
<?php
if ($type=="marq")
{
?>
<h4><font size="-1">Recherche par marque : </font>
<?php
} else {
?>
<h4><font size="-1">Recherche rapide <br>
</font>
<?php
}
?>
<?php
if ($type=="marq")
{
$requete = "select idmarque,marque from marques";
$result=mysql_query($requete) or die ("Erreur SQL :$requete<br>".mysql_error()."...");
?>
<h4>
<select name="marq">
<?php
while ($ligne=mysql_fetch_row($result))
{
$idmarque=$ligne[0];
$marque=$ligne[1];
?>
<option value="<?php print $idmarque?>"><?php print $marque?></option>
<?php
}
?>
</select>
</h4>
<?php
} else {
?>
<h4>
<h4>
<h4>
<h4>
<input type="text" name="rech" size=10/>
</h4>
<?php
}
?>
<p>
<input type="submit" name="Submit" value="Ok">
</p>
</h4>
</h4>
</h4>
</h4>
</h4></td>
</tr>
</table>
</form>
<?php
if ( !isset($_SESSION['idcli']) )
{
?>
<a href="membres/login.php">Espace Membres</a>
<?php
} else {
?>
<a href="membres/index.php">Membres</a>
<?php
}
?>
<br>
<br>
<?php
if ( !(isset($_SESSION['idcli']) || isset($_SESSION['idadm'])) )
{
?>
<a href="inscription/inscription1.php">Inscription</a> <br>
<br>
<?php
}
?>
<?php
if (!isset($_SESSION['idadm']))
{
?>
<a href="admin/login.php">Administrateur</a>
<?php
} else {
?>
<a href="admin/index.php">Administrateur</a>
<?php
}
?>
<br>
<br>
<a href="produit/index.php">Nos Produits</a> <br>
<br>
<br>
<?php
if (isset($_SESSION['idadm']))
{
if($deconnect)
{
session_unregister("idadm");
} else {
?>
<br>
<br>
<a href="navig.php?deconnect=1"><b>Deconnection Administrateur</b></a> <br>
<?php
}
}
if (isset($_SESSION['idcli']))
{
if($deconnetc)
{
session_unregister("idcli");
} else {
?>
<br>
<br>
<a href="navig.php?deconnetc=1">Deconnection membre</a> <br>
<?php
}
}
?>
<table align="left" border=0>
<tr border=0>
<td colspan=3 bordercolor="0">&nbsp; </td>
</tr>
<tr>
<td colspan=3 align=center bordercolor="0">
<?php
if ($type=="marq")
{
?>
<?php
} else {
?>
<h6>&nbsp;</h6>
<?php
}
?>
</td>
</tr>
</table></td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>