<?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_structure.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'];}?>" />

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="180" valign="top">
			<?php
			include $templatePath . "g_menu.inc.tpl.php";
			?>
		</td>

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

		<td width="560" valign="top">
			<div class="box_top">
				<?php echo $group['group_title'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table cellpadding="2" cellspacing="0" border="0" width="100%">
				<tr>
					<td valign="top">
						<?php echo $group['display_group_synopsis'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<div class="box_edit">
							<table cellpadding="4" cellspacing="0" border="0" width="100%">
								<tr>
									<td width="50%" valign="top">
										<table cellpadding="2" cellspacing="0" border="0" width="100%">
											<tr>
												<td colspan="2">
													<b><?php echo $lang['hdr_group'];?></b><br />
												</td>
											</tr>
											<tr>
												<td valign="top">
													<?php echo $lang['txt_group_registration_type'];?><br />
												</td>
												<td valign="top" align="right">
													<?php
													if (isset($group['group_registration_type'])) {
														echo $lang['arr_registration_type'][$group['group_registration_type']];
													}
													else {
														echo $lang['txt_hidden_group'];
													}
													?>
													<br />
												</td>
											</tr>
											<tr>
												<td valign="top">
													<?php echo $lang['txt_language'];?><br />
												</td>
												<td valign="top" align="right">
													<?php echo $lang['arr_lang_name'][$group['language_id']];?>
												</td>
											</tr>
											<tr>
												<td valign="top">
													<?php echo $lang['txt_group_age'];?><br />
												</td>
												<td align="right">
													<?
													if ($group['group_from_age'] && $group['group_to_age']) {
													    echo $group['group_from_age'] . "/" . $group['group_to_age'];
													}
													else if ($group['group_from_age'] && !$group['group_to_age']) {
														echo $group['group_from_age'] . " and up";
													}
													else if (!$group['group_from_age'] && $group['group_to_age']) {
														echo "up to " . $group['group_to_age'];
													}
													else {
														echo "all";
													}
													?>
													<br />
												</td>
											</tr>
											<tr>
												<td valign="top">
													<?php echo $lang['txt_start_date'];?><br />
												</td>
												<td valign="top" align="right">
													<?php echo $group['display_group_create_datetime'];?><br />
												</td>
											</tr>
											<tr>
												<td valign="top">
													<?php echo $lang['txt_election_date'];?><br />
												</td>
												<td valign="top" align="right">
													<?php echo $group['group_election_date'];?><br />
												</td>
											</tr>
											<tr>
												<td valign="top">
													<?php echo $lang['txt_status'];?><br />
												</td>
												<td valign="top">
													<?php echo $lang['arr_group_status'][$group['status_id']];?><br />
												</td>
											</tr>
											<tr>
												<td valign="top">
													<?php echo $lang['txt_category'];?><br />
												</td>
												<td valign="top">
													todo<br />
												</td>
										    </tr>
										</table>
									</td>
									
									<td width="20">&nbsp;</td>
									
									<td width="50%" valign="top">
										<table cellpadding="2" cellspacing="0" border="0" width="100%">
											<tr>
												<td colspan="2">
													<b><?php echo $lang['hdr_roles'];?></b><br />
												</td>
											</tr>
											<?php
											if (isset($group_roles)) {
											foreach($group_roles as $i):?>
											<tr>
												<td valign="top">
													<?php echo $i['role_name'];?><br />
												</td>
												<td valign="top" align="right">
													<a href="g_membership.php?group_id=<?php echo $group['group_id'];?>&amp;role_id=<?php echo $i['role_id'];?>" class="txt_footer_link"><?php echo $i['total_members'];?></a><br />
												</td>
											</tr>
											<?php
											endforeach;
											?>
											<?php
											}
											else {
											?>
											<tr>
												<td colspan="2">
													<?php echo $lang['err_no_roles'];?><br />
												</td>
											</tr>
											<?php
											}
											?>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" /><br />

			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<b><?php echo $lang['hdr_group_rules'];?></b><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $group['group_rules'];?><br />
					</td>
				</tr>
			</table>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" /><br />

			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<b><?php echo $lang['hdr_node_rules'];?></b><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_node_rules'];?><br />
					</td>
				</tr>
				<?php
				if ($this->group_acs->checkPermission($resource_ids['group_administration'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
				?>
				<tr>
					<td>
						<div class="box_edit">
						<?php
						if (isset($display) && $display == "confirm_delete") {
						?>
						<p align="right">
						<input type="submit" name="delete_group_confirm" class="button_urgent" value="<?php echo $lang['form_sub_delete_confirm'];?>" /><br />
						</p>
						<?php
						}
						else {
						?>
						<p align="right">
						<input type="submit" name="delete_group" class="button" value="<?php echo $lang['form_sub_delete'];?>" /><br />
						</p>
						<?php }?>
						</div>
					</td>
				</tr>
				<?php }?>
			</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>
		</td>
	</tr>
</table>
</form>
