Escape(Tools_Http::Post('name')); $email = $DB->Escape(Tools_Http::Post('email')); $contacts = new Contacts; $message = $DB->Escape(Tools_Http::Post('msg')); $err = ''; $fields = array(); $array['product_id'] = 0; $array['product_name'] = ''; $array['name'] = $name; $array['email'] = $email; $array['text'] = $message; $array['type'] = 4; if (!$name) { $err = $L->Str('Please enter your name!'); $fields[] = 'name'; } if (!$email) { $err = $L->Str('Please enter your email!'); $fields[] = 'email'; } if (!$message) { $err = $L->Str('Please enter your message!'); $fields[] = 'msg'; } if (!$err) { $msg = "Pieprasījums no kontaktu formas.\n\n"; $msg .= "Datums: ".date("d.m.Y H:i")."\n"; $msg .= "IP adrese: ".Tools_Http::getIP()."\n"; $msg .= "
\n"; $msg .= "

Lietotāja dati

\n"; $msg .= "Vārds: ".Tools_Text::htmlEscape($name)."\n"; $msg .= "E-pasts: ".Tools_Text::htmlEscape($email)."\n\n"; $msg .= "Ziņojums: ".Tools_Text::htmlEscape($message).""; //$to = $Config -> Get('EMAIL_FROM_ADDR'); $to = 'info@euroled.lv'; //$to = 'anton@promo.lv'; $result = Tools_Email::sendMail($to,'Pieprasījums no mājaslapas '.$Config -> Get('DEFAULT_PAGE_TITLE'),$msg); $contacts->insertItem($array); ?>