//**********************************
// 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");
$formaction = getVar("formaction");
$ret = getVar("ret");
$action = getVar("action");
$cid = getVar("cid");
if ($formaction=="mod" && $cid!="")
{
$myquery = "SELECT nom,prenom,adresse,cp,ville,pays,phone,mobile,email,login,mdp FROM clients WHERE id='$cid'";
$result = mysql_query($myquery,$mycon);
if (mysql_num_rows($result)>0)
{
$fnom = mysql_result($result,0,"nom");
$fprenom = mysql_result($result,0,"prenom");
$fadresse = mysql_result($result,0,"adresse");
$fcp = mysql_result($result,0,"cp");
$fville = mysql_result($result,0,"ville");
$fpays = mysql_result($result,0,"pays");
if ($fpays!="Reunion" && $fpays!="France Metropolitaine")
{
$fpays1 = "Autre";
$fpays2 = $fpays;
}
else $fpays1 = $fpays;
$fphone = mysql_result($result,0,"phone");
$fmobile = mysql_result($result,0,"mobile");
$femail = mysql_result($result,0,"email");
$flogin = mysql_result($result,0,"login");
$fmdp = mysql_result($result,0,"mdp");
}
else
{
$ret = str_replace("#","?",$ret);
$ret = str_replace("-","&",$ret);
header("Location: $ret");
}
}
if ($action=="add")
{
$fnom = getVar("fnom");
$fprenom = getVar("fprenom");
$fadresse = getVar("fadresse");
$fcp = getVar("fcp");
$fville = getVar("fville");
$fpays1 = getVar("fpays1");
$fpays2 = getVar("fpays2");
$femail = getVar("femail");
$fphone = getVar("fphone");
$fmobile = getVar("fmobile");
$flogin = getVar("flogin");
$fmdp = getVar("fmdp");
//echo "action ok
"; //**********************
if(isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] == $_POST['keystring'])
{
//echo "captcha ok
"; //************************
if ($fnom!="" && $fprenom!="" && $fadresse!="" && $fcp!="" && $fville!="" && (($fpays1=="Autre" && $fpays2!="") || $fpays1!="") && $femail!="" && isValidEmail($femail) && $flogin!="" && $fmdp!="")
{
//echo "conditions ok"; //******************************
if ($fpays1=="Autre")
$fpays = $fpays2;
else $fpays = $fpays1;
$myquery = "INSERT INTO clients (nom,prenom,adresse,cp,ville,pays,phone,mobile,email,login,mdp) VALUES ('$fnom','$fprenom','$fadresse','$fcp','$fville','$fpays','$fphone','$fmobile','$femail','$flogin','$fmdp')";
mysql_query($myquery,$mycon);
// send email to client welcome message
sendWelcomeEmail($femail,$fnom,$fprenom,$flogin,$fmdp);
// account session
$compte = $flogin;
// redirection to $ret (else to accueil.php)
if ($ret=="" || !(strpos("signup.php",$ret)===false))
$ret = "accueil.php";
$ret = str_replace("#","?",$ret);
$ret = str_replace("-","&",$ret);
header("Location: $ret");
}
}
else $errmess = "Code incorrect.";
}
else if ($action=="mod")
{
$cid = getVar("cid");
$fnom = getVar("fnom");
$fprenom = getVar("fprenom");
$fadresse = getVar("fadresse");
$fcp = getVar("fcp");
$fville = getVar("fville");
$fpays1 = getVar("fpays1");
$fpays2 = getVar("fpays2");
$femail = getVar("femail");
$fphone = getVar("fphone");
$fmobile = getVar("fmobile");
$flogin = getVar("flogin");
$fmdp = getVar("fmdp");
if ($fnom!="" && $fprenom!="" && $fadresse!="" && $fcp!="" && $fville!="" && (($fpays1=="Autre" && $fpays2!="") || $fpays1!="") && $femail!="" && isValidEmail($femail) && $flogin!="" && $fmdp!="")
{
if ($fpays1=="Autre")
$fpays = $fpays2;
else $fpays = $fpays1;
$myquery = "UPDATE clients SET nom='$fnom',prenom='$fprenom',adresse='$fadresse',cp='$fcp',ville='$fville',pays='$fpays',phone='$fphone',mobile='$fmobile',email='$femail',login='$flogin',mdp='$fmdp' WHERE id='$cid'";
mysql_query($myquery,$mycon);
// redirection to $ret (else to accueil.php)
if ($ret=="")
$ret = "accueil.php";
$ret = str_replace("#","?",$ret);
$ret = str_replace("-","&",$ret);
header("Location: $ret");
}
}
?>
REGIE PUB
Conformément à la Loi Informatique et Liberté du 6 Janvier 1978, vous bénéficiez d’un droit d’accès, de modification ou de suppression des données vous concernant.
Pour l’exercer, merci de contacter par courrier :
Discorama production
9 chemin Grand Canal
97 490 Sainte-Clotilde