ACC SHELL

Path : /srv/www/vhosts/profias/inc/admin/
File Upload :
Current File : /srv/www/vhosts/profias/inc/admin/newsletter-write.php

<?
//die();
//odesílá e-mily
  if ('ok'==$_GET['status'])
  {
    $content.='<div><b>Maily byly odeslány</b></div>';
  }


 if (isset($isset_mail))
 {
   $today   = date('j. n. Y'); 
 
   //$person  = 'cybertec@tiscali.cz';                                          //mail uživatele dimenzovaní
 
   $message  = NULL;
   $message .= '
<style>
body {
	background: #618A00;
	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	margin: 20px;
}

h1 {
	color: #96B763;
	font-size: 16px;
	margin-left: 20px;
}

hr {
	border: 0px;
	border-bottom: 1px #96B763 solid;
	height: 0px;
	width: 100%;
}

#dc {
	background: #F6FCE9;
	border: 1px #96B763 dashed;
	margin-left: 20px;
	padding: 10px;
	width: 700px;
	overflow: hidden;
}

</style>';
 
   $message .= '<div id="dc">'."\n";
   $message .= '<h1>Mail info greenrestaurant.cz</h1>';
   $message .= "<hr />\n";
   $message .= '<p>'.nl2br($_POST['mail-text']).'</p>'."\n";


   $f=fopen('/tmp/newsletter_message', 'w');
      fputs($f, $message);
    fclose($f); 
    header('Location: newsletter.php?offset=0');
    die();

  }
  else {
    include('template-admin.php');
  

 if (!empty($_GET['form']))
 {
  if ($_GET['form'] == 'ok')
  {
   $content.= '<p>e-maily byly úspěšně odeslány.</p>';
   $content.= '<p>odeslat <a href="javascript:history.go(-1)">dlaší</a>?</p>';
  }
  if ($_GET['form'] == 'false')
  {
   $content.= '<p>Nastala chyba při odesílání.</p>';
   $content.= '<p>Pokusti se napsání <a href="javascript:history.go(-1)">dlaší</a> zprávy?</p>';
  }
 }
 else {
 $content.= '
<form action="?show=mail-server" method="post">
 <div>
  <legend>Formulář pro odeslání hromadného e-mailu</legend><br />
  <br />
  <label>Text&nbsp;e-mailu:</label><br />
  <div><textarea cols="60" rows="24" name="mail-text"></textarea></div>

  <input type="submit" name="isset_mail" value="odeslat" />
 </div>
</form>';
}
  
  $content.='<h2>Seznam příjemců</h2>';

    $query=mysql_query('SELECT DISTINCT *
      FROM newsletter
        WHERE
        active=\'Y\''
      );

    while ($row=mysql_fetch_array($query))
    {
      $content.='<div>
        '.$row['email'].'
        </div>
      ';
    }


    echo html('Newsletter', $content);

  }
?>

ACC SHELL 2018