<?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.
// -----------------------------------------------------------------------

?>


<form action="g_group_edit.php" method="post">
<input type="hidden" name="group_id" value="<?php echo $group['group_id'];?>">

<table width="770" border="0" cellspacing="0" cellpadding="4">
	<tr>

		<td width="180" valign="top">
			<?php
			include $templatePath . "g_menu.inc.tpl.php";
			?>
			
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="52" alt="" /><br />

			<?php
			include $templatePath . "logo.inc.tpl.php";
			?>
			
			
		</td>

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

		<td width="570" valign="top">
			<?php
			if (isset($display) && $display == "edit_group_rules") {
			?>
			<table width="100%" cellpadding="4" cellspacing="0" border="0" class="table_stnd">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['txt_group_rules'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<textarea name="data[group_rules]" rows="15" cols="85" class="formInput"><?php echo $group['group_rules'];?></textarea><br />
					</td>
				</tr>
				<tr>
					<td>
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="20" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td align="right">
						<input type="submit" name="update_group_rules" value="<?php echo $lang['sub_edit'];?>" class="formInput"><br />
					</td>
				</tr>
			</table>

			<?php
			}
			elseif (isset($display) && $display == "edit_group") {
			?>
			<table width="100%" cellpadding="4" cellspacing="0" border="0" class="table_stnd">
				<tr>
					<td colspan="2" class="txt_title" align="right">
						<?php echo $lang['section_update'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_title'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<input type="text" name="data[group_title]" class="formInput" size="42" value="<?php echo $group['group_title'];?>"><br />
					</td>
				</tr>
				<tr>
					<td>
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_synopsis'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<textarea name="data[group_synopsis]" rows="2" cols="50" class="formInput"><?php echo $group['group_synopsis'];?></textarea><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_home_synopsis'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<textarea name="data[group_home_synopsis]" rows="5" cols="50" class="formInput"><?php echo $group['group_home_synopsis'];?></textarea><br />
					</td>
				</tr>
				<tr>
					<td>
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_registration_type'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<select name="data[group_registration_type]" class="formInput">
						<?php foreach($lang['arr_registration_type'] as $key => $i): 
						?>
						<option value="<?php echo $key;?>" <? if($group['group_registration_type'] == $key) echo "selected=\"selected\"";?>><?php echo $i;?></option>
						<?php endforeach; ?>
						</select>
						<br />
					</td>
				</tr>
				<tr>
					<td>
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_genre'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<select name="data[genre_id]" class="formInput">
						<option value="0"><?php echo $lang['txt_all_genre'];?></option>
						<?php foreach($lang['arr_genre'] as $key => $i): 
						?>
						<option value="<?php echo $key;?>" <? if($group['genre_id'] == $key) echo "selected=\"selected\"";?>><?php echo $i;?></option>
						<?php endforeach; ?>
						</select>
						<br />
					</td>
				</tr>
				<tr>
					<td>
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td>
						<b><?php echo $lang['txt_language'];?></b><br />
						<span class="txt_footer"><?php echo $lang['txt_language_help'];?></span><br />
					</td>
				</tr>
				<tr>
					<td>
					<select name="data[language_id]" size="1" class="formInput">
						<?php
						foreach($lang['arr_lang_name'] as $key => $i): ?>
						<option value="<?php echo $key;?>" <? if($group['language_id'] == $key) echo "selected";?>><?php echo $i;?></option>
						<?php endforeach; ?>
					</select>
					<br />
					</td>
				</tr>
				<tr>
					<td>
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td>
						<b><?php echo $lang['txt_age'];?></b><br />
						<span class="txt_footer"><?php echo $lang['txt_age_help'];?></span><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_age_from'];?> <input type="text" size="5" name="data[group_from_age]" value="<?php if(isset($group['group_from_age'])) { echo $group['group_from_age']; } else {echo $lang['txt_age_any'];}?>" class="formInput" />&nbsp;
						<?php echo $lang['txt_age_to'];?> <input type="text" size="5" name="data[group_to_age]" value="<?php if(isset($group['group_to_age'])) { echo $group['group_to_age']; } else {echo $lang['txt_age_any'];}?>" class="formInput" /><br />
					</td>
				</tr>
				<tr>
					<td>
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td align="right">
						<input type="submit" name="update_group" value="<?php echo $lang['sub_edit'];?>" class="formInput" /><br />
					</td>
				</tr>
			</table>

			<?php
			}
			else {
			?>
			<table width="100%" cellpadding="4" cellspacing="0" border="0" class="table_stnd">
				<tr>
					<td colspan="2" class="txt_title" align="right">
						<?php echo $lang['section_update'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_title'];?></b><br />
					</td>
					<td valign="top">
						<?php echo $group['group_title'];?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_synopsis'];?></b><br />
					</td>
					<td valign="top">
						<?php echo $group['display_group_synopsis'];?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_home_synopsis'];?></b><br />
					</td>
					<td valign="top" class="picture">
						<?php echo $group['display_group_home_synopsis'];?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_election_date'];?></b><br />
					</td>
					<td valign="top">
					<?php echo $group['group_election_date'];?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_registration_type'];?></b><br />
					</td>
					<td valign="top">
						<?php echo $lang['arr_registration_type'][$group['group_registration_type']];?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_status'];?></b><br />
					</td>
					<td valign="top">
						<?php echo $lang['arr_group_status'][$group['status_id']];?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_language'];?></b><br />
					</td>
					<td valign="top">
						<?php echo $lang['arr_lang_name'][$group['language_id']];?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_age_from'];?></b><br />
					</td>
					<td valign="top">
						<?php if(isset($group['group_from_age'])) { echo $group['group_from_age']; } else {echo $lang['txt_age_any'];}?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_age_to'];?></b><br />
					</td>
					<td valign="top">
						<?php if(isset($group['group_to_age'])) { echo $group['group_to_age']; } else {echo $lang['txt_age_any'];}?><br />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_genre'];?></b><br />
					</td>
					<td valign="top">
						<?php
						if (isset($group['genre_id'])) {
						    echo $lang['arr_genre'][$group['genre_id']];
						}
						else {
							echo $lang['txt_all_genre'];
						}
						?><br />
					</td>
			    </tr>
				<tr>
					<td valign="top">
						<b><?php echo $lang['txt_group_rules'];?></b><br />
					</td>
					<td valign="top">
						<?php echo $group['display_group_rules'];?><br />
					</td>
				</tr>
				<tr>
					<td align="right" colspan="2">
						<input type="submit" name="edit_group" value="<?php echo $lang['sub_edit'];?>" class="formInput" /><br />
					</td>
				</tr>
			</table>

			<?php
			}
			?>
		</td>
	</tr>
</table>
</form>