08-04-2007, 11:10 PM
Code PHP :
<?php
session_start();
$id = $_SESSION['id'];
include 'connexion.php';
$sql= "SELECT qstockvehicule, stock1, qstock1 stockvehicule FROM membres WHERE id = " . $id ."";
$res=mysql_query($sql) or die('Erreur SQL '.$sql.'<br>'.mysql_error());
$data = mysql_fetch_object($res);
$data = $row->qstockvehicule;
$var= $row->stock1;
$variable= $row->stockvehicule;
$donnee = $row->qstock1;
if ($data['qstockvehicule'] < 30 && $var['stock1'] != $variable['stockvehicule']);
{
echo '<center><font color="red">transfert impossible, ce ne sont pas les memes ressources !</font></center><center><font color="black"><a href="affichestock1.php">retour</a></font></center>';
}
else
//{
if ($data['qstockvehicule'] < 30 && $var['stock1'] == $variable['stockvehicule']);
{
$rsa = "UPDATE membres SET qstockvehicule= qstockvehicule + qstock1, stockvehicule=stock1, ustockvehicule=ustock1+0.1,
stock1='./objet/rien.gif', qstock1='0', exp=exp+0.1, hab=hab+0.1, mp='Vous venez de stocker dans votre véhicule' WHERE id = " . $id ."";
$rsa = mysql_query($rsa) or die('Erreur SQL '.$rsa.'<br>'.mysql_error());
if($rsa)
{
$_SESSION['qstockvehicule']= $data['qstockvehicule'] + $donnee['qstock1'];
$_SESSION['stockvehicule']= $_SESSION['stock1'];
$_SESSION['ustockvehicule']=$_SESSION['ustock1']+0.1;
$_SESSION['stock1']= './objet/rien.gif';
$_SESSION['qstock1']= '0';
$_SESSION['exp']=$_SESSION['exp']+0.1;
$_SESSION['hab']=$_SESSION['hab']+0.1;
$_SESSION['mp']= 'vous venez de stocker dans votre véhicule';
}
// }
header("Location: page_membre.php");
}
mysql_close();
?>