[abase table=”wamblee_w8users”]
get_results($query);
$usrs=$current_user->user_login;
$usrsmail = $current_user->user_email;
if(!empty($res))
{
do_alert(“Attenzione : risulta già presente un cliente con questo indirizzo email al quale è già stato assegnato un codice cliente. Contattare Wamblee per maggiori dettagli”);
}
else
{
$answer= mysql_query(“INSERT INTO wamblee_W830users
(Name,Surname,Company,Address,AddressNext,CAP,City,Country,Email,Www,FirstPhone,SecondPhone,Boat,Fax,Login)
VALUES
(‘$_GET[Name]’, ‘$_GET[Surname]’, ‘$_GET[Company]’, ‘$_GET[Address]’, ‘$_GET[AddressNext]’, ‘$_GET[CAP]’, ‘$_GET[City]’, ‘$_GET[Country]’, ‘$_GET[Email]’, ‘$_GET[Www]’, ‘$_GET[FirstPhone]’, ‘$_GET[SecondPhone]’,’$_GET[BoatName]’, ‘$_GET[Fax]’,’$usrs’)”);
if (!$answer)
{
$message = ‘Invalid query: ‘ . mysql_error() . “\n”;
die($message);
}
else
{
// registrazione effettuata, si invia email e si passa a pagina di ringraziamento.
$CustomerEmail=$_GET[Email];
$found = mysql_query(“SELECT IdCode FROM wamblee_w830users WHERE Email=’$CustomerEmail'”);
$row = mysql_fetch_row($found);
$IdCode = $row[0];
$lang_selected = $_GET[Country];
$found = mysql_query(“SELECT email_answer_text email_object_text FROM wamblee_language_text WHERE country=’$lang_selected’ AND id_msg=’3′”);
$row = mysql_fetch_row($found);
$testo=$row[0];
$oggetto=$row[1];
// si controlla se la lingua esiste oppure no, se non esiste si imposta inglese
if ($testo == “”)
{
$found = mysql_query(“SELECT email_answer_text , email_object_text FROM wamblee_language_text WHERE country=’826′ AND id_msg=’3′”);
$row = mysql_fetch_row($found);
$testo=$row[0];
$oggetto=$row[1];
}
// invio email al cliente in HTML
$email=$_GET[Email];
$testo_formattato = sprintf($testo, $_GET[Surname],$IdCode);
$headers = “From: robomail@wamblee.it\r\n” ;
$headers .= “Reply-To: info@wamblee.it\r\n” ;
$headers .= “Content-type: text/html; charset=iso-8859-1\r\n”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “X-Mailer: PHP/” . phpversion() . “\r\n”;
$risposta=mail($email,$oggetto,$testo_formattato,$headers,”-f robomail@wamblee.it”);
// invio email a noi e chi ha fatto login per ricevuta di registrazione
$email=”info@wamblee.it,”;
$email .= “$usrsmail”;
$testo_formattato = “Registrazione ID cliente per W830
“;
$testo_formattato .= “Customer name : $_GET[Name]
“;
$testo_formattato .= “Customer surname : $_GET[Surname]
“;
$testo_formattato .= “Customer company : $_GET[Company]
“;
$testo_formattato .= “Customer email : $_GET[Email]
“;
$testo_formattato .= “Customer IdCode : $IdCode
“;
$testo_formattato .= “Boat Name : $_GET[BoatName]
“;
$headers = “From: robomail@wamblee.it\r\n” ;
$headers .= “Reply-To: info@wamblee.it\r\n” ;
$headers .= “Content-type: text/html; charset=iso-8859-1\r\n”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “X-Mailer: PHP/” . phpversion() . “\r\n”;
$risposta=mail($email,”Registrazione prodotto Wamblee nel database”,$testo_formattato,$headers,”-f robomail@wamblee.it”);
// salta a pagina di ringraziamento
if($risposta)
{
echo ““;
echo ““;
}
else
{
echo ““;
echo ““;
}
}
}
}
else
{
echo ““;
}
mysql_close();
?>[abase table=”wamblee_w8users”][abase table=”wamblee_w8users”][abase table=”wamblee_w8users”][abase table=”wamblee_w8users”]