<?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['subject']) && isset($_POST['message'])){

?>

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

<?php

	$dbres				= mysql_query("SELECT * FROM `gebruiker` WHERE `level`!='0' AND `level`!='-1' AND `level`!='-2'");
		while($member = mysql_fetch_object($dbres)){
		$_POST['subject']		= preg_replace('/</','&#60;',$_POST['subject']);
		$_POST['message']		= preg_replace('/</','&#60;',$_POST['message']);
		mysql_query("INSERT INTO `berichten`(`tijd`,`ip`,`van`,`naar`,`titel`,`bericht`) VALUES(NOW(),'{$_SERVER['REMOTE_ADDR']}','ultimatecrime','{$member->login}','{$_POST['subject']}','{$_POST['message']}')");
		}
	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 mail</b>
		</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" colspan="2" align="center">
		<table width="360">
			<tr>
				<td align="center">
				<a href="javascript://" onClick="document.form1.message.value += ':grin:'"><img src=images/smiles/icon_biggrin.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':S'"><img src=images/smiles/icon_confused.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += '8)'"><img src=images/smiles/icon_cool.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':.('"><img src=images/smiles/icon_cry.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':eek:'"><img src=images/smiles/icon_eek.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':evil:'"><img src=images/smiles/icon_evil.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':lol:'"><img src=images/smiles/icon_lol.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':@'"><img src=images/smiles/icon_mad.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':D'"><img src=images/smiles/icon_mrgreen.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':|'"><img src=images/smiles/icon_neutral.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':P'"><img src=images/smiles/icon_razz.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':$'"><img src=images/smiles/icon_redface.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':roll:'"><img src=images/smiles/icon_rolleyes.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':('"><img src=images/smiles/icon_sad.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':)'"><img src=images/smiles/icon_smile.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':o'"><img src=images/smiles/icon_surprised.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':twisted:'"><img src=images/smiles/icon_twisted.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ';)'"><img src=images/smiles/icon_wink.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':{'"><img src=images/smiles/icon_dracula.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':sick:'"><img src=images/smiles/icon_sick.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':uhm:'"><img src=images/smiles/icon_uhm.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':clap:'"><img src=images/smiles/icon_clap.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':dance:'"><img src=images/smiles/icon_dance.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':stop:'"><img src=images/smiles/icon_stop.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':doh:'"><img src=images/smiles/icon_doh.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':nono:'"><img src=images/smiles/icon_nono.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':think:'"><img src=images/smiles/icon_think.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':ssht:'"><img src=images/smiles/icon_ssht.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':nope:'"><img src=images/smiles/icon_nope.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':salut:'"><img src=images/smiles/icon_salut.gif border=0></a>
				<a href="javascript://" onClick="document.form1.message.value += ':wall:'"><img src=images/smiles/icon_wall.gif border=0></a>
				</td>
			</tr>
		</table>
		</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>