ACC SHELL

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

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

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

   

 /* echo  $set['jmeno'];
    echo  $set['email'];
      echo  $set['telefon'];
        echo  $set['prijem'];
          echo  $set['venovat'];
            echo  $set['proc_pracovat'];
              echo  $set['zivotopis']; */
             
       $trans= array(
            "jmeno" => "Jméno",
                      "email" => "E-mail",
            "telefon" => "Telefon",
            "poznamka" => "Zpráva",
           
          );       
      if( !( $_POST['secinp'] && $_POST['secinp'] === substr(md5($_POST['last_id']),3,5) && (abs((time()%10000)-$_POST['last_id'])<300)) ){
		$capcha_wrong = true;
	} else {          
$set = $_REQUEST['set'];         

         
    /*  if ($_FILES['set']['name']['zivotopis']){
       $path="./files/zivotopisy/";
         $new_name=time()."_".$set['jmeno']."_".$_FILES['set']['name']['zivotopis'];
         $new_name_mail=$_FILES['set']['name']['zivotopis'];
			if (!@file_exists($path.$new_name)){
				@copy($_FILES['set']['tmp_name']['zivotopis'], $path.$new_name);
        		@copy($_FILES['set']['tmp_name']['zivotopis'], $path.$new_name_mail);
			}
		}  */
             
     $body="Dobrý den,\n\n";          
    $body.= $trans["jmeno"].": ". $_REQUEST['jmeno']."\n";
     $body.= $trans["email"].": ". $_REQUEST['email']."\n";
    $body.= $trans["telefon"].": ". $_REQUEST['telefon']."\n";
    $body.= " \n".$trans["poznamka"].": ". $_REQUEST['poznamka']."\n";
   $adresa="Dotaz z webu ".$_SERVER['HTTP_HOST'].$_REQUEST['return'];
  
  $body_utf1 = $body;
    
$pripojeni->dotaz("INSERT INTO ".$GLOBALS['config_db_prefix']."odeslano (cas, nazev, text) VALUES ('".time()."','".$adresa."', '".nl2br($body_utf1)."')");
             

  
  $set= $_REQUEST['set'];
  
	
  
  
  
  $body0= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
 // $body.= "\n\nByl odeslan dotaz z webu: ".$_SERVER['SERVER_NAME']."/cz/23/kariera\n\n";
  
//  foreach ($set as $key => $val){
//    $body.= strtr($key, $trans)." : $val <br/>\n";
//  }
  
    /*
        $body.= $trans["jmeno"].": ".$set['jmeno']." \n";
    $body.= $trans["email"].": ".$set['email']." \n";
    $body.= $trans["telefon"].": ".$set['telefon']." \n";
    $body.= $trans["prijem"].": ".$set['prijem']." \n";
    $body.= $trans["venovat"].": ".$set['venovat']." \n";
    $body.= $trans["proc_pracovat"].": ".$set['proc_pracovat']." \n";   */


  $body_utf = $body;// ."\n\n Tento email byl odeslán z formuláre umístené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($_REQUEST['email']);
  $mail->setSubject(  '=?utf-8?B?'.base64_encode($adresa).'?='  );
  $mail->setPriority('normal');
  $mail->setText($body_utf);
 
  $mail->setTextCharset("utf-8");
  //  $path_parts = pathinfo($path.$new_name_mail);
   // $path_parts['extension'];
  /*  if ( $path_parts['extension']=="pdf") {
    $attachment = new fileAttachment($path.$new_name_mail, "application/pdf");}
    elseif   ( $path_parts['extension']=="doc") {
    $attachment = new fileAttachment($path.$new_name_mail, "application/doc");}
     elseif   ( $path_parts['extension']=="docx") {
    $attachment = new fileAttachment($path.$new_name_mail, "application/docx");}
     elseif   ( $path_parts['extension']=="txt") {
    $attachment = new fileAttachment($path.$new_name_mail, "application/txt");}
 $mail->addAttachment($attachment); */
//  $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@calyx.cz'));
 // $mail->send(array('programator@4g.cz'));
 // $mail->send(array('lukas.stryka@4g.cz'));
//  $mail->send(array('janecek@iresoft.cz'));
 // $mail->send(array($set[email]));

 // $return= $_REQUEST['return'];  
  //if ($mail) header("Location: /$return/?result=ok");
  //else header("Location: /$return/?result=err");
  
  
 /*if ($mail) header("Location: /$return/?result=ok");
  else header("Location: /$return/?result=err");  */
   
  
}//if

 if ($mail && !$capcha_wrong){header("Location: ./".$_REQUEST['return']."?result=ok");}else { header("Location: ./".$_REQUEST['return']."?result=err");} 
 
 //header("Location: ".$_REQUEST['return']."?result=ok"); 
?>

ACC SHELL 2018