<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>

</script>
<h3>Mass Mailer</h3>
<form method="post" action="<?php echo adminurl('/massmailer/sendmail');?>">
<p>
	<strong>Subject: </strong> <input type="text" name="subject" value="" />
</p>
<p>
	<strong>Message:</strong>
	<br>(Just write the content, styling will be handled by iCrew)
</p>
<p>

	<textarea name="message" id="editor" style="width: 600px; height: 250px;">
	<tr>
                <td align="left" bgcolor="#ffffff" style="padding: 40px 20px 0 20px; color: #555555; font-family: Arial, sans-serif; font-size: 18px; line-height: 30px;">
                    <b>	Dear {PILOT_FNAME} {PILOT_LNAME},</b>
                </td>
            </tr>
            <tr>
                <td align="left" bgcolor="#ffffff" style="padding: 0 20px 40px 20px; color: #777777; font-family: Arial, sans-serif; font-size: 14px;  border-bottom: 1px solid #f6f6f6;">
                   <br><br>---[EMAIL CONTENT]---
                   <br><br><br>
                   <span style="align: left">Regards, <br>
                   <?php echo Auth::$userinfo->firstname.' '.Auth::$userinfo->lastname.'<br><small>'; echo SITE_NAME.'</small>'; ?>
                   </span>
                </td>
            </tr></textarea>
</p>
<p>Select groups to send to:<br />
<?php $total = StatsData::PilotCount(); ?>
<input type="checkbox" name="groups[]" value="all" />All Pilots (<?php echo $total?> pilots)<br />
<?php
foreach($allgroups as $group)
{
	$total = count(PilotGroups::getUsersInGroup($group->groupid));
	echo "<input type=\"checkbox\" name=\"groups[]\" value=\"{$group->groupid}\" />{$group->name} - ({$total} pilots)<br />";
}
?>

</p>
<p>
	<input type="submit" name="submit" value="Send Email" />
</p>
</form>
