Location: PHPKode > projects > Employee Scheduling System > essv1-2/emailEmps.php
<?php require_once('common.php'); 
// $Id: emailEmps.php,v 1.1 2005/04/02 03:03:19 atrommer Exp $
checkUser($_SESSION['USERTYPE'], 2);

// check for postback
if ($_POST['isPostback']){
	emailEmps($_POST, $_SESSION['USERID']);	
	redirect();
}

$oMyEmps = getMyEmployees($_SESSION['USERID']);
doHeader("Bulk Email");
?>
Please enter the subject, body, and select all or some of the employees you would like to email
<br/>
<form name="frmEmail" action="emailEmps.php" method="post">
<input type="hidden" name="isPostback" value="1">
<table border="0" cellpadding="1" cellspacing="0" width="100%" class="contactInfo">
<? // we want to only show 4 emps a line, so we'll hit another <tr> on 4
	$iCount = 0;
	print "<tr>\n";
	foreach ($oMyEmps as $Emp){
		$iCount++;
	?>
		<td><input type="checkbox" name="cbMail[]" value="<?=$Emp->user_id ?>"> <?=$Emp->user_first ?> <?=$Emp->user_last?></td>
	<?
		if ($iCount == 4){
			print "</tr>\n<tr>";	
			$iCount = 0;
		}
	}
	print "</tr>";
?>
</table>
<br>
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr class="evenRow">
	<td>Subject:</td>
	<td><input type="text" name="tbSubj"></td>
</tr>
<tr>
	<td>Body:</td>
	<td><textarea name="taBody" rows="5" cols="50"></textarea></td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit" value="Send Mail?"></td></tr>
</table>

</form>
<? doFooter(); ?>
Return current item: Employee Scheduling System