Files
HotLunches/email-start.php
2026-10-19 15:22:52 -07:00

62 lines
1.6 KiB
PHP

<?php
require_once("include/globals.php");
if (SessionActive() != 1 || ! UserLoggedIn()) {
header("Location: /");
exit();
}
// Ensure that only admin users have access to this module
$AllowedUserTypes = array('SuperUser','System Administrator','Application Administrator','Communications Administrator');
if (checkPermission($AllowedUserTypes) != 1) {
echo("<br>\n");
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
include "form.messages.php";
return;
}
?>
<br>
<table width='<?php echo($default_table_width) ?>' cellpadding='5' cellspacing='5' border='0' bgcolor='#eeeeee'>
<tr>
<td align='left' class='menu-item' align='center'><b>Send Emails to Contacts</b></td>
</tr>
<tr>
<td align='center' class='menu-item'>
<form action="/" method="post">
<center>
<table width="90%" cellpadding="2" cellspacing="1" border="0">
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
<td width='45%' align="right">Send Emails From:</td>
<td align='left'>
<select name='company_id'>
<?php
$query = "select * from companies where active = 'Y' order by business_name";
$results = db_query($query);
if (db_num_rows($results)) {
while ($row = db_fetch_array($results)) {
$id = $row['record_num'];
$name = $row['business_name'];
echo(" <option value='$id'>$name</option>\n");
}
}
?>
</select>
</td>
</tr>
</table>
<br>
<input type="submit" class="vlgbutton" value="<?php displayLanguageText('TEXT-NEXT-STEP'); ?> &gt;&gt;&gt;">
<input type="hidden" name="action" value="email-contacts">
</center>
</form>
</td>
</tr>
</table>