<?php

# HA NINCS ID, AKKOR CSOPORTLISTA

if ($this->is_id()) {

	# CSOPORT SZERKESZTÉSE /TAGLISTA
	
	$group = new user_group();
	$group->set_ug_data_by_id($this->get_id());

	$smarty->assign('user_group', $group);
	$smarty->display('user_group_data_edit.tpl');
}

else {
	
	# CSOPORT LISTA

	$group_query = "SELECT * FROM user_group WHERE ug_deleted = 0 ORDER By ug_name ASC;";
	$group_assoc_array = $sql->assoc_array($group_query);

	$group_array = array();
	foreach ($group_assoc_array as $group) {
		$new_ug = new user_group();
		$new_ug->set_ug_data_by_id($group['ug_id']);
		$group_array[] = $new_ug;
	}

	$smarty->assign('user_group_array',$group_array);
	$smarty->display('user_group_list.tpl');	
}

?>
