0byt3m1n1
Path:
/
home
/
kassiope
/
www
/
achat
/
[
Home
]
File: stock_alertes.php
<? include("../configuration.inc.php"); switch (vb($_REQUEST['mode'])) { case "insere" : insere_alerte($_POST); break; default : formulaire_alerte($_GET['prodid']); break; } /****************************************************************************** * FONCTIONS *****************************************************************************/ function formulaire_alerte(&$prodid) { GLOBAL $wwwroot, $frm, $repertoire_css, $site, $support, $langfile, $dirroot; $frm["id_utilisateur"] = ""; $frm["id_produit"] = ""; $frm["email"] = ""; ?> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <title><?echo STOCK ?></title> <link REL="stylesheet" type="text/css" href="<?=$repertoire_css?>/css/style.css"> </head> <body> <table border="0" cellpadding="8" cellspacing="0" width="100%" class="tabstock" > <form name="entryform" method="post" action="<?=$_SERVER['PHP_SELF']?>"> <input type="hidden" name="mode" value="insere"> <input type="hidden" name="id_utilisateur" value="<?=$_SESSION['utilisateur']['id_utilisateur']?>"> <input type="hidden" name="email" value="<?=$_SESSION['utilisateur']['email']?>"> <tr> <td align="center" style="border-bottom:0"> <table border="0" cellspacing="0" cellpadding="1" bgcolor="#FFFFFF"> <tr> <td style="border-bottom:0"> <table border="0" cellspacing="0" cellpadding="10" width="280" height="280"> <tr> <td width="280" colspan="2" style="line-height: 17px;"> <? $produit = mysql_query_override("SELECT id, reference, nom_".$_SESSION['langue']." FROM gaia_produits WHERE id = '".$prodid."'"); $prod = mysql_fetch_array_override($produit) or DIE('Une erreur de connexion à la base s est produite ' . __LINE__ . '.<p>' . MYSQL_ERROR()); $nom = stripslashes($prod['nom_'.$_SESSION['langue'].'']); $reference = stripslashes($prod['reference']); echo $nom.nl2br(stripslashes(MSG_NO_STOCK)); ?> </td> </tr> <tr> <td width="280" colspan="2" align="center" style="border-bottom:0"> <table border="0" cellspacing="1" cellpadding="0"> <tr> <td align="right"><?echo NAME ?>:</td> <td><input type="text" name="nom" value="<?=vb($_SESSION["utilisateur"]["nom_famille"])?>" size="20" ></td> </tr> <tr> <td align="right"><?echo SOCIETE ?> :</td> <td><input type="text" name="societe" value="" size="20" ></td> </tr> <tr> <td align="right"><?echo EMAIL ?> : </td> <td><input type="text" name="email" value="<?=vb($_SESSION["utilisateur"]["email"])?>" size="20" ></td> </tr> <tr> <td align="right"><?echo TELEPHONE ?> : </td> <td><input type="text" name="telephone" value="" size="20"></td> </tr> </table> </td> </tr> <tr> <td width="50%" align="center"><input class="btn btn-default-filled " type="submit" value="<?echo VAlIDE ?>" name="validate"></td> <td width="50%" align="center"><input class="btn btn-default-filled " type="button" value="<?echo CANCEL ?>" name="Fermer" onclick="javascript:window.close()"></td> </tr> </table> </td> </tr> </table> </td> </tr> <input type="hidden" name="id_produit" value="<?=$prod["id"]?>"> <input type="hidden" name="nom_produit" value="<?=addslashes($prod['nom_'.$_SESSION['langue'].''])?>"> </form> </table> </body> </html> <? } function insere_alerte($frm) { GLOBAL $wwwroot, $stylefile; /*ajoute les infos dans la table alertes*/ $qid = mysql_query_override(" INSERT INTO gaia_alertes ( id_produit , nom_produit , id_utilisateur , email , telephone , datestamp ) VALUES ( '$frm[id_produit]' , '".$frm['nom_produit']."' , '$frm[id_utilisateur]' , '$frm[email]' , '$frm[telephone]' ,now()) "); ?> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <title><?echo STOCK ?></title> <link REL="stylesheet" type="text/css" href="<?=$stylefile?>"></head> <body> <table border="0" cellpadding="8" cellspacing="0" width="100%" > <tr> <td align="center"> <table border="0" cellspacing="0" cellpadding="1" bgcolor="#FFFFFF"> <tr> <td> <table border="0" cellspacing="0" cellpadding="10" width="280" height="280"> <tr> <td width="280" colspan="2" class=normal align=center> <?echo nl2br(REQUEST_OK);?> <input class="bouton" type="button" value="<?echo CLOSE?>" name="Fermer" onclick="javascript:window.close()"> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> </html> <?} ?>