ini_set("session.cookie_domain", "tritonic.ro");
session_cache_limiter('nocache');
session_start();
include("php/config.php");
include("php/ModulePage.php");
$page=new ModulePage;
$email=$_POST['email'];
$nume=$_POST['nume'];
$asinput=$_POST['asinput'];
$as=$_POST['as'];
$mesaj=$_POST['msg'];
$dep=$_POST['dep'];
//------------------------------
if($dep==''){$dep=0;}
$toemail=$adminmails[$dep];
$msg='';
if (isset($_POST['B1'])){
//se verifica antispamul
if (($as != crypt($asinput,$mypasscrypt))||($as == '')){
$msg="{$picerr} Numar Antispam incorect !";
$rnr=gencod(5);
$asnr=antispam($rnr);
$ascod="";
foreach($rnr as $item){
$ascod.=$item;
}
$pcript=crypt($ascod,$mypasscrypt);
$page->page_location("$path"."templates/contact.html");
$page->parse_variable(array(MENU=>$codmenu,CTEL=>$ctel,MSG=>$msg,ASCRYPT=>$pcript,ASNR=>$asnr,NUME=>$nume,EMAIL=>$email,MESAJ=>$mesaj) );
echo $page->send_page;
exit;
}
//se trimite mailul cu datele contului
$azi=time();
$body="Nume: {$nume}
E-mail: {$email}
{$mesaj}";
$subject="{$sitename} - CONTACT";
$to=$toemail;
$header = "To: $sitename <$toemail>\n";
$header .= "From: $nume <$email>\n";
$header .= "Reply-To: $nume <$email>\n";
$header .= "Return-Path: $nume <$email>\n";
//$header .= "CC: contact@sphera-grup.ro\n";
$header .= "Message-ID: <".$azi." TheSystem@".$_SERVER['SERVER_NAME'].">\n";
$header .= "X-Mailer: PHP v".phpversion()."\n"; // These two to help avoid spam-filters
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html\n\n";
if (mail($to, $subject, $body, $header)){
$msg="{$picerr} Mesajul a fost trimis... Va multumim !";
}
else{
$msg="{$picerr} EROARE ! Mesajul nu a putut fi trimis...";
}
$rnr=gencod(5);
$asnr=antispam($rnr);
$ascod="";
foreach($rnr as $item){
$ascod.=$item;
}
$pcript=crypt($ascod,$mypasscrypt);
$page->page_location("$path"."templates/contact.html");
$page->parse_variable(array(PTITLU=>"{$sitename} :: Contact",CTEL=>$ctel,MSG=>$msg,ASCRYPT=>$pcript,ASNR=>$asnr,NUME=>$nume,EMAIL=>$email,MESAJ=>"") );
echo $page->send_page;
exit;
}
else{
$query="SELECT * FROM `client` WHERE `id`='".$_SESSION['id']."'";
$result=mysql_query($query);
$client=mysql_fetch_array($result, MYSQL_ASSOC);
$rnr=gencod(5);
$asnr=antispam($rnr);
$ascod="";
foreach($rnr as $item){
$ascod.=$item;
}
$pcript=crypt($ascod,$mypasscrypt);
$page->page_location("$path"."templates/contact.html");
$page->parse_variable(array(PTITLU=>"{$sitename} :: Contact",CTEL=>$ctel,MSG=>$msg,ASCRYPT=>$pcript,ASNR=>$asnr,NUME=>$client['nume'],EMAIL=>$client['email'],MESAJ=>$mesaj) );
echo $page->send_page;
exit;
}
?>