//********************************** // DISCORAMA.FR // Code HTML/PHP: PROXIS Interactif // Août 2008 //********************************** // Accueil v0.1 //********************************** require_once("includes/config.inc.php"); require_once("includes/main.inc.php"); require_once("includes/functions.inc.php"); $mycon = openDB(); require_once("caddie.inc.php"); session_register("compte"); $compte = $_SESSION['compte']; include_once("includes/login.inc.php"); $action = getVar("action"); $titreid = getVar("titreid"); $albumid = getVar("albumid"); $formuleid = getVar("formuleid"); $ret = getVar("ret"); if ($action=="addcaddie" && $caddieId!="" && $caddieId!=0) { if ($albumid!="") addAlbumToCaddie($caddieId,$albumid); else if ($formuleid!="") addFormuleToCaddie($caddieId,$formuleid); else if (titreid!="") addTitreToCaddie($caddieId,$titreid,getClientIdByLogin($compte)); } else if ($action=="updatecaddie" && $caddieId!="" && $caddieId!=0) { $nba = getVar("nba"); if ($nba!="" && $nba!=0 && is_numeric($nba)) { for ($i=0;$i<$nba;$i++) { $cid = getVar("cid_".$i); $fquantite = getVar("fquantite_".$i); if ($cid!="" && is_numeric($cid)) { if ($fquantite!="" && $fquantite!=0 && is_numeric($fquantite)) { // update quantite $myquery = "UPDATE caddie_contenus SET quantite='$fquantite' WHERE caddie='$caddieId' AND id='$cid'"; mysql_query($myquery,$mycon); if (isCaddieEmpty($caddieId)) setEtatCaddie($caddieId,"empty"); } else if ($fquantite==0) { // delete $myquery = "DELETE FROM caddie_contenus WHERE caddie='$caddieId' AND id='$cid'"; mysql_query($myquery,$mycon); if (isCaddieEmpty($caddieId)) setEtatCaddie($caddieId,"empty"); } } } } } else if ($action=="delcaddie" && $caddieId!="" && $caddieId!=0) { $cid = getVar("cid"); if ($cid!="" && $cid!=0 && is_numeric($cid)) { // delete $myquery = "DELETE FROM caddie_contenus WHERE caddie='$caddieId' AND id='$cid'"; mysql_query($myquery,$mycon); if (isCaddieEmpty($caddieId)) setEtatCaddie($caddieId,"empty"); } } ?>