<?php
ob_start();
include("config.php");
	if(! check_login()) { 
	exit;
	}

	if($data->level != 3){
	exit;
	}

?>

<html>
<head>
<title>ultimatecrime</title>
<link rel="stylesheet" type="text/css" href="style_general.css">
</head>
<body background="layout/images/layout_12.gif" bgproperties="fixed">
<br>
<br>
<br>

<?php

	if(isset($_POST['message'])){

?>

<table align="center" width="600">
	<tr>
		<td class="subTitle" colspan="2">Admin - Massa e-mail</td>
	</tr>
	<tr>
		<td width="600" class="mainTxt" align="center">

<?php

	if($_POST['email'] == "email"){
	$dbres				= mysql_query("SELECT * FROM `emails`");

		while($member = mysql_fetch_object($dbres)) {

		$_POST['message']	=	eregi_replace("\\\n", "<br>", $_POST['message']);
		$subj			=	$_POST['subject'];
		$emess			=	"<html><body bgcolor=#000000><table width=100% cellpadding=0 cellspacing=0><tr><td class=main align=center width=100%><b><a href=http://www.ultimatecrime.nl>Klik hier om naar ultimatecrime te gaan!</b></a><br><br><table width=70%><tr><td><font color=white>{$_POST['message']}</font></td></tr></table><br><br><font color=white>ultimatecrime Crew</font><br><br><img src=http://www.ultimatecrime.nl/images/avater.jpg><br><br></td></tr></table><br><br></body></html>";
		$headers		=	'MIME-Version: 1.0' . "\r\n";
		$headers		.=	'Content-type: text/html; charset=iso-8859-1' . "\r\n";
		$headers		.=	"From: ultimatecrime <gangwars@neola.e-dentify.nl>" . "\r\n";
		mail("$member->email","$subj","$emess","$headers");

		}

	echo "Bericht verzonden.<meta http-equiv=\"refresh\" content=\"3\">";
	exit;
	} else if($_POST['email'] == "gebruiker"){
	$dbres				= mysql_query("SELECT * FROM `gebruiker`");

		while($member = mysql_fetch_object($dbres)) {

		$_POST['message']	=	eregi_replace("\\\n", "<br>", $_POST['message']);
		$subj			=	$_POST['subject'];
		$emess			=	"<html><body bgcolor=#000000><table width=100% cellpadding=0 cellspacing=0><tr><td class=main align=center width=100%><b><a href=http://www.ultimatecrime.nl>Klik hier om naar ultimatecrime te gaan!</b></a><br><br><table width=70%><tr><td><font color=white>{$_POST['message']}</font></td></tr></table><br><br><font color=white>ultimatecrime Crew</font><br><br><img src=http://www.ultimatecrime.nl/images/avater.jpg><br><br></td></tr></table><br><br></body></html>";
		$headers		=	'MIME-Version: 1.0' . "\r\n";
		$headers		.=	'Content-type: text/html; charset=iso-8859-1' . "\r\n";
		$headers		.=	"From: ultimatecrime <gangwars@neola.e-dentify.nl>" . "\r\n";
		mail("$member->email","$subj","$emess","$headers");

		}

	echo "Bericht verzonden.<meta http-equiv=\"refresh\" content=\"3\">";
	exit;
	}


?>

		</td>
	</tr>
</table>

<?php

	}

?>

<form name="form1" method="POST" onsubmit="return submitForm(this.SEND);">
<table align="center" width="600">
	<tr>
		<td class="subtitle" colspan="2">
		<b>Admin - Massa e-mail</b>
		</td>
	</tr>
	<tr>
		<td class="maintxts" width="50%">Naar</td>
		<td class="maintxts" width="50%"><select name="email" class="form_select"><option value="email">Email lijst</option><option value="gebruiker">Gebruiker lijst</option></select></td>
	</tr>
	<tr>
		<td class="maintxts" width="50%">Onderwerp</td>
		<td class="maintxts" width="50%"><input type="text" name="subject" value="" maxlength=25 size="40"></td>
	</tr>
	<tr>
		<td class="maintxt" align="center" colspan="2"><textarea name="message" cols=65 rows=10></textarea></td>
	</tr>
	<tr>
		<td class="maintxt" width="100%" colspan="2" align="center"><input type="submit" name="submit" value="Email verzenden!" style="width: 200;"></td>
	</tr>
</table>
</form>
</body>
</html>