<?php
session_start();
include "mysqlconnect.php"; 
$action = $_GET["action"];
if($action=='send' && ($_SESSION["my_id"]==1 || $_SESSION["my_id"]==3) && $_SESSION["mobile_logged_in"] && trim($_POST['sprava'])!='')
{
	$query = "SELECT mail FROM mobile_users WHERE news='1' and mail<>''";
//	$result = mysql_query($query, $link);
	$mailov = 0;
	
	$subject = "4mobile news";
	$sprava = '
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
		<title>4mobile.sk - Pozadia, melódie, hry a videá na Váš mobil zadarmo!</title>
		<style>
		body
		{
			background: #171717;
			text-align: center;
			margin-top: 0px;
			padding-top: 0px;
			
		}
		</style>
		</head>
		<body>
		<div style="width: 60%;
			font-family: Verdana, Tahoma;
			font-size: 9pt;
			color: #949494;
			margin-left: auto;
			margin-right: auto;
			margin-top: 18px;
			background: #353434 none;
			border-style: solid;
			border-width: 1px;
			border-color: #949494;
			text-align: left;
			padding-bottom: 10px;">
		  <img src="http://4mobile.sk/images/logo.jpg" id="logo" alt="4mobile.sk - Pozadia, melóie, hry a videá pre Váš mobil zadarmo!" style="margin: 10px;"/>
		  <div style="width: 90%;
			font-family: Verdana, Tahoma;
			font-size: 9pt;
			color: #949494;	
			margin-top: 12px;
			margin-bottom: 15px;
			margin-left: auto;
			margin-right: auto;">
	';
   	$sprava .= nl2br(stripslashes($_POST["sprava"]));
   	$sprava .= '
   			</div>
		  </div>
		</body>
		</html>
   	';
   	$headers = "From:4mobile <4mobile@peterpech.com>\n";
   	$headers .= "Content-Type: text/html; charset=iso-8859-2\n";
	
//	while($row=mysql_fetch_array($result))
	{
		$mailov ++;
//		$komu = $row["mail"];
		$komu = 'pesto@peterpech.com, Aaron_Lewis@azet.sk, pesto@orangemail.sk, stanislaf@post.sk, sstanislaff@centrum.sk, sstanislaff@yahoo.com, 4mobile@post.sk, aaron_lewis123@yahoo.com, pesto16@inmail.sk';
//		$komu = 'pesto@peterpech.com';
		
	   	$test = mail($komu, $subject, $sprava, $headers);
	   	
	}
}



?>
<html>
<head>
<title>4mobile - všetko pre Váš mobil</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
</head>

<body bgcolor="#ffffff">
<div id="Layer1" style="position:absolute; width:500px; height:120px; z-index:2; left: 165px; top: 120px; text-align:center" class=text>
<? if($_SESSION["mobile_logged_in"]==true){ 
	} 
	else {echo "<span class=info1><b>Nie ste prihlásený!</b></span><br>";}

if($_SESSION["log"]=='Pesto' || $_SESSION["log"]=='buchtik')
{
	include"form_mlist.php";
}
echo "<span class=info1>".$mailov." mailov | $test</span>";

?>
<code>
<?php echo $sprava; ?>
</code>
</div>
</body>
</html>
<? mysql_close($link); ?>
