// Um welchen Kunden handelt es sich?? Die ersten zwei Buchstaben der image_id sind eindeutig!
$customer = substr($i,0,2);
$customer = strtolower($customer);
$blIsFaceBook = 0;
if($customer == '89')
{
$blIsFaceBook = 1;
$i = substr($i,2,16);
$customer = substr($i,0,2);
$customer = strtolower($customer);
}
if ($customer == '73' || $customer == '74' )
header("Location: /E08/pickup.php?i=$i");
// Initialisierung der Pfadkonstanten, diese aendern sich je Kunde bzw. liveweb-Version
$subject_path = '';
$mailtext_path = '';
$coupon = 0;
$Error = 0;
$replyemail = 'pricelessphoto@mastercard.com';
if ($customer == '43' || $customer == '44' || $customer == '53' || $customer == '63' || $customer == '64' || $customer == '73' || $customer == '74' || $customer == '33' || $customer == '34' || $customer == '23' || $customer == '24'){ // Pricelessphoto
include ("../liveweb_1/php/version_2/pricelessphoto/connection_data.php");
include ("../liveweb_1/php/version_2/pricelessphoto/table_data.php");
include ("../liveweb_1/php/version_2/pricelessphoto/cardcam_handles.php");
$template_path = 'pricelessphoto';
$subject_path = '/mail_subject';
$mailtext_path = '/mail_text';
}
else
{
$Error = 1;
}
/*Ermittel des aktuellen Datums*/
$first_reception_date = date ('Y-m-d');
$first_reception_time = date ('H:i:s');
$last_reception_date = date ('Y-m-d');
/*Format fuer den Emailtext*/
$reception_date_emailformat = date ('d.m.Y');
// End of config section ---------------------------------------------------------------
$i = trim($i," ");
if(get_magic_quotes_gpc() == 0)
$i = addslashes($i);
/*Check Input Params*/
if ((strlen($i) < 1) || $Error ==1 || (strlen($i) > 17))
{
//include "template/error.html";
include "index.php";
}else{
$iIsWM = 0;
$IsRecipient=0;
$DoSend = 0;
$iRecip = substr($i,1,1);
if(substr($i,0,1)=='4')
$iIsWM = 1;
if(substr($i,0,1)=='6' || substr($i,0,1)=='7')
$iIsWM = 2;
if(substr($i,0,1)=='3')
$iIsWM = 3;
if(substr($i,0,1)=='2')
$iIsWM = 4;
if($iRecip == '4')
{
$IsRecipient=1;
$DoSend = 1;
$iNewId = substr($i,0,1);
$iNewId .="3";
$iNewId .= substr($i,2,14);
$i = $iNewId;
}
// Suche des Datensatzes
$sql="SELECT * FROM $MySQL_Table WHERE image_id = '$i'";
// SQL-Befehl abschicken
if ($res=send_sql($MySQL_DB,$sql)){
// echo "Tabelle wird angezeigt
";
}
// wenn kein Datensatz gefunden werden konnte
if (mysql_num_rows($res) < 1)
{
//include "template/error.html";
include "index.php";
}else{
// lese Field-values aus
$image_id = mysql_result ($res,0,'image_id');
$image_ext = mysql_result ($res,0,'image_ext');
$language = mysql_result ($res,0,'language');
$sender_name = mysql_result ($res,0,'sender_name');
$sender_email = mysql_result ($res,0,'sender_email');
$recipient_name = mysql_result ($res,0,'recipient_name');
$recipient_email = mysql_result ($res,0,'recipient_email');
$message = mysql_result ($res,0,'message');
$send_date = mysql_result ($res,0,'send_date');
$sponsor = mysql_result ($res,0,'sponsor');
// Falls die Karte zum erstenmal abgerufen wird
if (mysql_result ($res,0,'reception_howmuch') == '0' && $sponsor == 0)
{
// Datenbank mit Datum des ersten Abrufs aktualisieren
if($IsRecipient != 1) // Karte wurde noch nicht vom Empfaenger abgerufen
{
$sql="UPDATE $MySQL_Table SET first_reception_date = '$first_reception_date', reception_howmuch = 1 WHERE image_id = '$i'";
}
else
{
$sql="UPDATE $MySQL_Table SET first_reception_date = '$first_reception_date', reception_howmuch = 1, sponsor = 1 WHERE image_id = '$i'";
}
if(substr($customer,0,1)=='6' || substr($customer,0,1)=='7'){
// ermitteln des Notification-Subject-Templates fuer die entsprechende Sprache
$myMailSubject = 'mail2_subjectcl08_'.strtolower($language).'.php';
$myMailText = 'mail2cl08_'.strtolower($language).'.php';
}
else{
$myMailSubject = 'mail2_subject_'.strtolower($language).'.php';
$myMailText = 'mail2_'.strtolower($language).'.php';
}
// Ist eine Sprache angegeben???
if ($language != ''){
// Wenn die Absenderemailadresse fehlt
if ($sender_email == 'nirwana@cardcam.de'){
// kann auch keine E-Mail verschickt werden ;)
}else{
if($DoSend)
{
// Abruf der Mailsubject und Mailtext-Templates
include ("template/$template_path$subject_path/$myMailSubject");
include ("template/$template_path$mailtext_path/$myMailText");
// mail($sender_email,"$myMailSubject Votre LIVEcard a ete lu par $recipient_name!",$mailtext,"From: $replyemail\nReply-To: $replyemail\nX-Mailer: PHP/" . phpversion());
// die Bestaetigungs-Notification fuer den Absender kommt - nicht mehr (siehe oben) - von info@cardcam.de
//mail($sender_email,$mailsubject,$mailtext,"From: \nReply-To: \nX-Mailer: PHP/" . phpversion());
mail($sender_email,$mailsubject,$mailtext,"From: $replyemail \nReply-To: $replyemail \nX-Mailer: PHP/" . phpversion());
}
}
}else{
// Keine Sprachangabe vorhanden!
$error_msg = 'No Language specified';
include "template/error.html";
}
}else{ // Wenn die Karte mehrfach abgerufen wird
// Anzahl der Mehrfachabrufe hochsetzen
$myValue = (mysql_result ($res,0,'reception_howmuch'));
$myValue += 1;
$myFacebook = 0;
$myFacebook = (mysql_result ($res,0,'facebook'));
if($blIsFaceBook) {
$myFacebook += 1;
}
// Datenbank mit Datum der zuletzt abgerufenen Karte aktualisieren und den Mehrfachabrufen
$sql="UPDATE $MySQL_Table SET reception_howmuch = $myValue, last_reception_date = '$last_reception_date', facebook = $myFacebook WHERE image_id = '$i'";
if($sponsor == 0 && $IsRecipient == 1) //E-Mail versenden
{
$sql="UPDATE $MySQL_Table SET reception_howmuch = $myValue, last_reception_date = '$last_reception_date', sponsor = 1 WHERE image_id = '$i'";
if($DoSend)
{
if(substr($customer,0,1)=='6' || substr($customer,0,1)=='7'){
// ermitteln des Notification-Subject-Templates fuer die entsprechende Sprache
$myMailSubject = 'mail2_subjectcl08_'.strtolower($language).'.php';
$myMailText = 'mail2cl08_'.strtolower($language).'.php';
}
else{
$myMailSubject = 'mail2_subject_'.strtolower($language).'.php';
$myMailText = 'mail2_'.strtolower($language).'.php';
}
// Abruf der Mailsubject und Mailtext-Templates
include ("template/$template_path$subject_path/$myMailSubject");
include ("template/$template_path$mailtext_path/$myMailText");
// mail($sender_email,"$myMailSubject Votre LIVEcard a ete lu par $recipient_name!",$mailtext,"From: $replyemail\nReply-To: $replyemail\nX-Mailer: PHP/" . phpversion());
// die Bestaetigungs-Notification fuer den Absender kommt - nicht mehr (siehe oben) - von info@cardcam.de
//mail($sender_email,$mailsubject,$mailtext,"From: \nReply-To: \nX-Mailer: PHP/" . phpversion());
mail($sender_email,$mailsubject,$mailtext,"From: $replyemail \nReply-To: $replyemail \nX-Mailer: PHP/" . phpversion());
}
}
}
// Abschicken des SQL-Command
if ($res=send_sql($MySQL_DB,$sql)){
// echo "Tabellen Update
";
}
// ermitteln des LIVEcard-Templates fuer die entsprechende Sprache
if($iIsWM == 1)
$myLIVEcard = 'livecardwm_'.strtolower($language).'.php';
else if($iIsWM == 2){
$myLIVEcard = 'livecardcl08_'.strtolower($language).'.php';
}
else if($iIsWM == 3){
$myLIVEcard = 'livecardcl10_'.strtolower($language).'.php';
}
else if($iIsWM == 4){
$myLIVEcard = 'livecardcl11_'.strtolower($language).'.php';
}
else
$myLIVEcard = 'livecard_'.strtolower($language).'.php';
// Aufruf des LIVEcard-Templates nur wenn Sprache festliegt
if ($language != ''){
// wenn Sprachangabe vorhanden ist
if($coupon == 1)
{
$myLIVEcard = 'livecard2_'.strtolower($language).'.php';
include ("template/$template_path/$myLIVEcard");
}
else
include ("template/$template_path/$myLIVEcard");
}else{
// Fehlermeldung
$error_msg = 'No Language specified';
include "template/error.html";
}
}
}
?>