ACC SHELL

Path : /srv/www/vhosts/lps/
File Upload :
Current File : /srv/www/vhosts/lps/odeslat.php

<?php
	include "./classes/classes.php";

	$pripojeni = new CDatabaze ( $conf_uzivatel, $conf_heslodb, $conf_server, $conf_databaze);



if( !( $_POST['secinp'] && $_POST['secinp'] === substr(md5($_POST['last_id']),3,5) && (abs((time()%10000)-$_POST['last_id'])<300)) ){
	$capcha_wrong = true;

	header("Location: /".$_REQUEST['return']."?capcha=wrong&jmeno=".$_REQUEST['jmeno']."&email=".$_REQUEST['email']."&text=".$_REQUEST['text']."#vysledek");
}
else{
	if ($_POST['odeslat']){ 
	  $trans= array(
	            "jmeno" => "Jméno",
	            "firma" => "Společnost",
	            "email" => "E-mail",
	            "telefon" => "Telefon",
	            "text" => "Poznámka",
	          ); 
	  
	  $set= $_REQUEST;
	  $body0= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1250\" />";
	  $body.= "Byl odeslan dotaz z webu: ".$_SERVER['SERVER_NAME']."\n\n";
	  
	//  foreach ($set as $key => $val){
	//    $body.= strtr($key, $trans)." : $val <br/>\n";
	//  }
	
	
	    $body.= $trans["jmeno"].": ".$set['jmeno']." \n";
	  //  $body.= $trans["firma"].": ".$set['firma']." \n";
	    $body.= $trans["email"].": ".$set['email']." \n";
	  //  $body.= $trans["telefon"].": ".$set['telefon']." \n";
	    $body.= $trans["text"].": ".$set['text']." \n";
	
	
	  $body_utf = $body ."\n\n Tento email byl odeslán z formuláře umístěného zde: ".$_SERVER['SERVER_NAME']."/".$_REQUEST['return']."";  
	
	
	  $body.= "\n\n Na tento email neodpovídejte.";
	
	$body= (iconv("UTF-8", "CP1250", $body));
	  
	//  echo $body;
	  
	  
	  require_once('./classes/htmlMimeMail5/htmlMimeMail5.php');
	  
	  $mail = new htmlMimeMail5();
	  $mail->setFrom('<formular@lps.cz>');
	  $mail->setSubject('Dotaz z webu '.$_SERVER['SERVER_NAME']);
	  $mail->setPriority('normal');
	  $mail->setText($body);
	  $mail->setTextCharset("windows-1250");
	//  $mail->setHTMLCharset("utf-8");
	//  $mail->setHTMLCharset("windows-1250");
	//  $mail->setHTML($body);
	
	
	  $pripojeni->dotaz("INSERT INTO ".$GLOBALS['config_db_prefix']."odeslano (nazev, cas, text) VALUES ('Dotaz z webu ".$_SERVER['SERVER_NAME']."', '".time()."', '".nl2br($body_utf)."')");
	
	$body = $body0.nl2br($body);
	  $mail->send(array('info@lps.cz'));
	
	
	  $mail->send(array('mave@budu.cz'));
	  //$mail->send(array('lukas.stryka@4g.cz'));
	  $mail->send(array($set[email]));
	  
	  $return= $_REQUEST['return'];  
	  if ($mail) header("Location: /$return?result=ok#vysledek");
	  else header("Location: /$return?result=err#vysledek");
	
//	echo"Location: /$return?result=err#vysledek";
	}//if
}
?>

ACC SHELL 2018