<?php

// -----------------------------------------------------------------------
// This file is part of aroundme
// 
// Copyright (C) 2003, 2005 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
// 
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option) any
// later version.
// 
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with program; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
// -----------------------------------------------------------------------

?>



<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td width="180" valign="top">
			<?php
			if (isset($group)) {
			include $templatePath . "g_menu.inc.tpl.php";
			}
			else {
				include $templatePath . "node_menu.inc.tpl.php";
			}
			?>
		</td>

		<td width="20">&nbsp;</td>

		<td width="560" valign="top">
			<form action="nlt_edit.php" method="post" name="frm" id="id_frm">
			<input type="hidden" name="group_id" value="<?php if(isset($group['group_id'])) { echo $group['group_id'];}?>" />

			<div class="box_top">
				<?php echo $lang['hdr_newsletter'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<?php
			if (isset($total_emails_sent)) {
			?>
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<?php echo $lang['txt_emails_sent'];?>: <?php echo $total_emails_sent;?><br />
					</td>
				</tr>
			</table>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			<?php
			}
			?>
			
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td valign="top">
						<label for="id_subject"><?php echo $lang['txt_subject'];?></label>
						<input type="text" id="id_subject" name="subject"  size="40" value="<?php echo $lang['txt_subject_txt'];?>" /><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<label for="id_message"><?php echo $lang['txt_message'];?></label>
						<textarea for="id_message" name="message" rows="15" cols="60"><?php echo $lang['txt_message_txt'];?></textarea>
					</td>
				</tr>
				<?php
				if(count($lang['arr_lang_name'] == 1)) {
				?>
				<input type="hidden" name="language_id" value="<?php echo $_SESSION['s_language_id'];?>" />
				<?php
				}
				else {
				?>
				<tr>
					<td>
						<label for="id_language"><?php echo $lang['txt_language'];?></label>
						<select id="id_language" name="language_id">
						<?php
						foreach($lang['arr_lang_name'] as $key => $i):
						?>
						<option value="<?php echo $key;?>" <? if($language_id == $key) echo "checked";?>><?php echo $i;?></option>
						<?php endforeach; ?>
						</select>
					</td>
				</tr>
				<?php }?>
				
				
				<tr>
					<td>
						<?php echo $lang['txt_to_help'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php
						if (isset($group)) {
						?>
						<input type="hidden" name="to_type_id" value="<?php echo $newsletter_type_ids['group'];?>" />
						<?php echo $lang['txt_to_type1'];?> (total: <?php echo $total_members;?>)<br />
						<?php 
						}
						else {
						?>
						<input type="radio" name="to_type_id" value="<?php echo $newsletter_type_ids['node'];?>" "checked" /><?php echo $lang['txt_to_type1'];?> (total: <?php echo $total_members;?>)<br />
						<input type="radio" name="to_type_id" value="<?php echo $newsletter_type_ids['node_pending'];?>" /><?php echo $lang['txt_to_type2'];?> (total: <?php echo $total_pending_members;?>)<br />
						<input type="radio" name="to_type_id" value="<?php echo $newsletter_type_ids['node_invited'];?>" /><?php echo $lang['txt_to_type3'];?> (total: <?php echo $total_invited;?>)<br />
						<?php }?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
						<?php if (isset($allow_spellcheck)) {?>
							<input type="button" value="<?php echo $lang['sub_spelling'];?>" class="button" onClick="openSpellChecker();" />&nbsp;&nbsp;
						<?php }?>
						
						<input type="submit" name="send_newsletter" value="<?php echo $lang['sub_newsletter'];?>" class="button_urgent" />
					</td>
				</tr>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			</form>
		</td>
	</tr>
</table>
