# Copyright 2001, Shadow Connect GmbH
include("lib/lib.inc.php");
#require("phpAdsNew/config.inc.php");
#require("phpAdsNew/view.inc.php");
#require("phpAdsNew/acl.inc.php");
if($commit) {
if(strlen($customerid) == 6) {
$customerid = substr($customerid, 0, 2).'00'.substr($customerid, 2, 4);
}
if(substr($customerid,2,1) == 'O') {
$customerid = substr($customerid, 0, 2).'0'.substr($customerid, 3, 5);
}
if(substr($customerid,2,1) == 'o') {
$customerid = substr($customerid, 0, 2).'0'.substr($customerid, 3, 5);
}
if(!check_rma_customer($customerid))
$error .= language('kundennummerfehler','complaint').' ';
if(!$phone)
$error .= language('telefonfehler','complaint').' ';
if(!preg_match('|.*@.*\..*|', $email))
$error .= language('emailfehler','complaint').' ';
$complaint['customerid'] = $customerid;
$complaint['email'] = $email;
$complaint['phone'] = $phone;
}
if($add || $verify) {
if(!check_rma_anzahl($complaint['customerid'], $billnumber, $articlenumber, $amount)) {
if(!check_rma_article($complaint['customerid'], $billnumber, $articlenumber, $amount)) {
if(!check_rma_bill($complaint['customerid'], $billnumber)) {
$error .= language('rechnungsnummerfehler','complaint').' ';
} else {
$error .= language('artikelnummerfehler','complaint').' ';
}
} else {
$error .= language('anzahlfehler','complaint').' ';
}
}
if($transport != "yes" && $transport != "no")
$error .= language('transportschadenfehler','complaint').' ';
if(!$description)
$error .= language('beschreibungfehler','complaint').' ';
$complaint['billnumber'][$id] = $billnumber;
$complaint['articlenumber'][$id] = $articlenumber;
$complaint['amount'][$id] = $amount;
$complaint['description'][$id] = $description;
$complaint['transport'][$id] = $transport;
if(!$error) {
$id ++;
$billnumber = '';
$articlenumber = '';
$amount = 0;
$description = '';
$transport = '';
}
}
if((!$commit && !$add && !$verify && !$submit && !$cancel) || ($commit && $error)) {
?>
print(language('titel', 'global')); ?>
if($error) { ?>
print(language('fehler','complaint')); ?>
print($error); ?>
} ?>
print(language('reklamationsantrag','complaint')); ?>
print(language('einleitung','complaint')); ?>
} elseif($commit || $add || ($verify && $error)) { ?>
print(language('titel', 'global')); ?>
if($error) { ?>
print(language('fehler')); ?>
print($error); ?>
} ?>
print(language('kundennummer','complaint')); ?>
print($complaint['customerid']); ?>
print(language('email','complaint')); ?>
print($complaint['email']); ?>
print(language('telefon','complaint')); ?>
print($complaint['phone']); ?>
for($i = 1; $i < $id; $i ++) { ?>
print(language('rechnungsnummer','complaint')); ?>
print($complaint[billnumber][$i]) ?>
print(language('artikelnummer','complaint')); ?>
print($complaint[articlenumber][$i]) ?>
print(language('anzahl','complaint')); ?>
print($complaint[amount][$i]) ?>
} ?>
print(language('reklamationsantrag','complaint')); ?>
} elseif($verify) { ?>
print(language('titel', 'global')); ?>
print(language('kundennummer','complaint')); ?>
print($complaint['customerid']); ?>
print(language('email','complaint')); ?>
print($complaint['email']); ?>
print(language('telefon','complaint')); ?>
print($complaint['phone']); ?>
print(language('reklamierte artikel','complaint')); ?>
} elseif($submit) {?>
print(language('titel', 'global')); ?>
print(language('reklamationok', 'complaint')); ?>
$text = "";
$text .= "";
$text .= "".language('kundennummer','complaint')." ".$complaint['customerid']." ";
$text .= "".language('email','complaint')." ".$complaint['email']." ";
$text .= "".language('telefon','complaint')." ".$complaint['phone']." ";
$query = "INSERT INTO Treklamationen(kunden_nr, emailadresse, tel_gesch, aufnahmedatum) VALUES('".$complaint['customerid']."', '".$complaint['email']."', '".$complaint['phone']."', now())";
$rekid = insert($query);
for($i = 1; $i < $id; $i ++) {
$text .= ' ';
if($complaint['transport'][$i] == 'yes') {
$transport = 1;
} else {
$transport = 0;
}
$query = "INSERT INTO Trekpositionen(id, rechnungs_nr, verkaufslager_nr, stueck, fehlerinfo, transportschaden) VALUES('".addslashes($rekid)."', '".addslashes($complaint['billnumber'][$i])."', '".addslashes($complaint['articlenumber'][$i])."', '".addslashes($complaint['amount'][$i])."', '".addslashes(utf8_encode($complaint['description'][$i]))."', '".addslashes($transport)."')";
update($query);
$text .= "".language('rechnungsnummer','complaint')." ".$complaint['billnumber'][$i]." ";
$text .= "".language('artikelnummer','complaint')." ".$complaint['articlenumber'][$i]." ";
$text .= "".language('anzahl','complaint')." ".$complaint['amount'][$i]." ";
$text .= "".language('beschreibung','complaint')." ".$complaint['description'][$i]." ";
$text .= "".language('transportschaden','complaint')." ".$complaint['transport'][$i]." ";
}
$text .= "
";
$text .= "";
if ($language == 'de') {
$textkunde = "\n";
$textkunde .= "Sehr geehrter Kunde, \n";
$textkunde .= "Ihr Reklamationsantrag ist bei uns mit folgender Reklamationsnummer \n";
$textkunde .= "eingegangen: \n";
$textkunde .= "Reklamationsnummer: ".$rekid." (Bitte bei Nachfragen immer angeben!) \n";
$textkunde .= "Folgende Angaben haben Sie in den Reklamationsantrag eingegeben: \n";
$textkunde .= "\n";
$textkunde .= "".language('kundennummer','complaint')." ".$complaint['customerid']." \n";
$textkunde .= "".language('email','complaint')." ".$complaint['email']." \n";
$textkunde .= "".language('telefon','complaint')." ".$complaint['phone']." \n";
for($i = 1; $i < $id; $i ++) {
$textkunde .= " \n";
if($complaint['transport'][$i] == 'yes') {
$transporttext = "Ja";
} else {
$transporttext = "Nein";
}
$textkunde .= "".language('rechnungsnummer','complaint')." ".$complaint['billnumber'][$i]." \n";
$textkunde .= "".language('artikelnummer','complaint')." ".$complaint['articlenumber'][$i]." \n";
$textkunde .= "".language('anzahl','complaint')." ".$complaint['amount'][$i]." \n";
$textkunde .= "".language('beschreibung','complaint')." ".$complaint['description'][$i]." \n";
$textkunde .= "".language('transportschaden','complaint')." ".$transporttext." \n";
}
$textkunde .= "
\n";
$textkunde .= " \n";
$textkunde .= "Unser Support wird sich innerhalb eines Arbeitstages (Montag bis Freitag) mit Ihnen \n";
$textkunde .= "in Verbindung setzen. \n";
$textkunde .= "Nachfragen zu einer Reklamation richten Sie bitte immer direkt an unseren Support. \n";
$textkunde .= "Unser Support ist wie folgt erreichbar: \n";
$textkunde .= "Mail: support@recycle-it.de \n";
$textkunde .= "Tel.: 08266 / 86 98 11 \n";
$textkunde .= "Montag - Donnerstag von 08:00 Uhr bis 16:00 Uhr \n";
$textkunde .= "Freitag von 08:00 Uhr bis 13:00 Uhr \n";
$textkunde .= "Ihr Support-Team der recycle it GmbH \n";
$textkunde .= "D-87745 Eppishausen \n";
$textkunde .= "www.recycle-it.de www.datenkiller.com www.rene-europe.com \n";
$textkunde .= "recycle it GmbH, Steinrinnenweg 1+6, 87745 Eppishausen, Geschäftsführer: Maximilian Scheppach \n";
$textkunde .= "Handelsregister Memmingen: HRB 5355 \n";
$textkunde .= "USt-Id.Nr.: DE 152 120 998
\n";
$textkunde .= "";
mail("support@recycle-it.de", "Reklamation", $text, "From: Recycle-It \nReply-To: \nContent-Type: text/html; charset=iso-8859-1");
mail($complaint['email'], "Reklamation: ".$rekid." der recycle it GmbH", $textkunde, "From: Recycle-It \nReply-To: \nContent-Type: text/html; charset=iso-8859-1");
} else {
$textkunde = "\n";
$textkunde .= "Dear Sir or Madam, \n";
$textkunde .= "we received your complaint request with the following complaint number: \n";
$textkunde .= "Complaint number: ".$rekid." (Please name it for requests!) \n";
$textkunde .= "You entered the following information into the complaint request: \n";
$textkunde .= "\n";
$textkunde .= "".language('kundennummer','complaint')." ".$complaint['customerid']." \n";
$textkunde .= "".language('email','complaint')." ".$complaint['email']." \n";
$textkunde .= "".language('telefon','complaint')." ".$complaint['phone']." \n";
for($i = 1; $i < $id; $i ++) {
$textkunde .= " \n";
if($complaint['transport'][$i] == 'yes') {
$transporttext = "Ja";
} else {
$transporttext = "Nein";
}
$textkunde .= "".language('rechnungsnummer','complaint')." ".$complaint['billnumber'][$i]." \n";
$textkunde .= "".language('artikelnummer','complaint')." ".$complaint['articlenumber'][$i]." \n";
$textkunde .= "".language('anzahl','complaint')." ".$complaint['amount'][$i]." \n";
$textkunde .= "".language('beschreibung','complaint')." ".$complaint['description'][$i]." \n";
$textkunde .= "".language('transportschaden','complaint')." ".$transporttext." \n";
}
$textkunde .= "
\n";
$textkunde .= " \n";
$textkunde .= "Our support will contact you within one working day (Monday to Friday). \n";
$textkunde .= "Please send enquiries to your complaint directly to our support. \n";
$textkunde .= "You can reach our support as follows: \n";
$textkunde .= "Mail: support@recycle-it.de \n";
$textkunde .= "phone: +49 (0)8266 / 86 98 11 \n";
$textkunde .= "Monday - Thursday from 08:00am to 04:00pm \n";
$textkunde .= "Friday from 08:00am to 13:00pm \n";
$textkunde .= "Your Support-Team of the recycle it GmbH \n";
$textkunde .= "87745 Eppishausen \n";
$textkunde .= "GERMANY \n";
$textkunde .= "www.recycle-it.de www.datenkiller.com www.macverkauf.com www.rene-europe.com \n";
$textkunde .= "recycle it GmbH, Steinrinnenweg 1+6, 87745 Eppishausen, managing director: Maximilian Scheppach \n";
$textkunde .= "commercial register Memmingen: HRB 5355 \n";
$textkunde .= "tax ID number: DE 152 120 998
\n";
$textkunde .= "";
mail("support@recycle-it.de", "Reklamation", $text, "From: Recycle-It \nReply-To: \nContent-Type: text/html; charset=iso-8859-1");
mail($complaint['email'], "complaint request: ".$rekid." of the recycle it GmbH", $textkunde, "From: Recycle-It \nReply-To: \nContent-Type: text/html; charset=iso-8859-1");
}
session_destroy();
} else {
session_destroy();
?>
print(language('vorgangabgebrochen', 'complaint')); ?>
} ?>