Location: PHPKode > projects > HuMo-gen > admin/include/groups.php
<?php
// *** Safety line ***
if (!defined('ADMIN_PAGE')){ exit; }

include ('../include/database_name.php');
global $Taalkeuze;

echo '<h1 align=center>'.$language["groups_name"].'</h1>';

if (isset($_POST['group_add'])){
	$sql="INSERT INTO humo_groups SET group_name='new groep', group_privacy='n', group_menu_places='n', group_admin='n'";
	$sql="$sql, group_sources='n', group_pictures='n', group_gedcomnr='n', group_living_place='n', group_places='j', group_religion='n'";
	$sql="$sql, group_place_date='n', group_kindindex='n', group_event='n', group_addresses='n', group_own_code='n', group_work_text='n'";
	$sql="$sql, group_texts='j', group_text_pers='j', group_texts_pers='j', group_texts_fam='j', group_alive='n', group_alive_date_act='j'";
	$sql="$sql, group_alive_date='1920', group_filter_death='n', group_filter_total='n', group_filter_name='j', group_filter_fam='j', group_filter_pers_show_act='j'";
	$sql="$sql, group_filter_pers_show='*', group_filter_pers_hide_act='n', group_filter_pers_hide='#'";
	$db_update = mysql_query($sql) or die(mysql_error());
}

if (isset($_POST['groep_wijzig'])){
	$sql="UPDATE humo_groups SET
	group_name='".$_POST["group_name"]."',
	group_editor='".$_POST["group_editor"]."',
	group_statistics='".$_POST["group_statistics"]."',
	group_privacy='".$_POST["group_privacy"]."',
	group_menu_places='".$_POST["group_menu_places"]."',
	group_admin='".$_POST["group_admin"]."',
	group_sources='".$_POST["group_sources"]."',
	group_birthday_rss='".$_POST["group_birthday_rss"]."',
	group_birthday_list='".$_POST["group_birthday_list"]."',
	group_photobook='".$_POST["group_photobook"]."',
	group_pictures='".$_POST["group_pictures"]."',
	group_gedcomnr='".$_POST["group_gedcomnr"]."',
	group_living_place='".$_POST["group_living_place"]."',
	group_places='".$_POST["group_places"]."',
	group_religion='".$_POST["group_religion"]."',
	group_place_date='".$_POST["group_place_date"]."',
	group_kindindex='".$_POST["group_kindindex"]."',
	group_event='".$_POST["group_event"]."',
	group_addresses='".$_POST["group_addresses"]."',
	group_own_code='".$_POST["group_own_code"]."',
	group_work_text='".$_POST["group_work_text"]."',
	group_texts='".$_POST["group_texts"]."',
	group_text_pers='".$_POST["group_text_pers"]."',
	group_texts_pers='".$_POST["group_texts_pers"]."',
	group_texts_fam='".$_POST["group_texts_fam"]."',
	group_alive='".$_POST["group_alive"]."',
	group_alive_date_act='".$_POST["group_alive_date_act"]."',
	group_alive_date='".$_POST["group_alive_date"]."',
	group_filter_death='".$_POST["group_filter_death"]."',
	group_filter_total='".$_POST["group_filter_total"]."',
	group_filter_name='".$_POST["group_filter_name"]."',
	group_filter_fam='".$_POST["group_filter_fam"]."',
	group_filter_date='".$_POST["group_filter_date"]."',
	group_filter_pers_show_act='".$_POST["group_filter_pers_show_act"]."',
	group_filter_pers_show='".$_POST["group_filter_pers_show"]."',
	group_filter_pers_hide_act='".$_POST["group_filter_pers_hide_act"]."',
	group_filter_pers_hide='".$_POST["group_filter_pers_hide"]."',
	group_pers_hide_totally_act='".$_POST["group_pers_hide_totally_act"]."',
	group_pers_hide_totally='".$_POST["group_pers_hide_totally"]."',
	group_gen_protection='".$_POST["group_gen_protection"]."'
	WHERE group_id=".$_POST["id"];
	//echo $sql;
	$result=mysql_query($sql) or die(mysql_error());
}

$groepen='3';
if (isset($_POST['groepen'])){ $groepen=$_POST['groepen']; }

// *** User groups ***
//if (isset($_GET['groepen']) OR isset($_POST['groepen'])){
	echo $language["groups_intro"].'<br>';

	$groepsql="SELECT * FROM humo_groups";
	$groepresult=mysql_query($groepsql,$db);

	print '<br><b>'.$language["groups_choice"].'</b> ';
	while ($groepDb=mysql_fetch_object($groepresult)){
		$stijl='';
		if ($groepen==$groepDb->group_id){ $stijl=' class="geselecteerd"'; }
			echo '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" style="display : inline;">';
			echo '<input type="hidden" name="page" value="'.$page.'">';
			print '<input type="hidden" name="groepen" value="'.$groepDb->group_id.'">';
			print ' <input type="Submit" name="submit" value="'.$groepDb->group_name.'"'.$stijl.'>';
		print '</form>';
	}

	// *** Add group ***
	echo '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" style="display : inline;">';
		echo '<input type="hidden" name="page" value="'.$page.'">';
		//print '<input type="hidden" name="groepen" value="'.$groepDb->id.'">';
		$language["groups_add"]='ADD GROUP';
		print ' <input type="Submit" name="group_add" value="'.$language["groups_add"].'">';
	print '</form>';

	// *** Show usergroup ***
	$groepsql="SELECT * FROM humo_groups WHERE group_id='".$groepen."'";
	$groepresult=mysql_query($groepsql,$db);
	$groepDb=mysql_fetch_object($groepresult);

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_editor)){
		$sql="ALTER TABLE `humo_groups` ADD `group_editor` VARCHAR( 1 ) NOT NULL DEFAULT 'n';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_statistics)){
		$sql="ALTER TABLE `humo_groups` ADD `group_statistics` VARCHAR( 1 ) NOT NULL DEFAULT 'j';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_birthday_rss)){
		$sql="ALTER TABLE `humo_groups` ADD `group_birthday_rss` VARCHAR( 1 ) NOT NULL DEFAULT 'j';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_birthday_list)){
		$sql="ALTER TABLE `humo_groups` ADD `group_birthday_list` VARCHAR( 1 ) NOT NULL DEFAULT 'j';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_filter_date)){
		$sql="ALTER TABLE `humo_groups` ADD `group_filter_date` VARCHAR( 1 ) NOT NULL DEFAULT 'n';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_gen_protection)){
		$sql="ALTER TABLE `humo_groups` ADD `group_gen_protection` VARCHAR( 1 ) NOT NULL DEFAULT 'n';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_pers_hide_totally_act)){
		$sql="ALTER TABLE `humo_groups` ADD `group_pers_hide_totally_act` VARCHAR( 1 ) NOT NULL DEFAULT 'n';";
		$result=mysql_query($sql) or die(mysql_error());
	}
	// *** Automatic installation or update ***
	if (!isset($groepDb->group_pers_hide_totally)){
		$sql="ALTER TABLE `humo_groups` ADD `group_pers_hide_totally` VARCHAR( 50 ) NOT NULL DEFAULT 'X';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_photobook)){
		$sql="ALTER TABLE `humo_groups` ADD `group_photobook` VARCHAR( 1 ) NOT NULL DEFAULT 'n';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Automatic installation or update ***
	if (!isset($groepDb->group_hide_trees)){
		$sql="ALTER TABLE `humo_groups` ADD `group_hide_trees` VARCHAR( 200 ) NOT NULL DEFAULT '';";
		$result=mysql_query($sql) or die(mysql_error());
	}

	// *** Renew data AFTER updates ***
	$groepsql="SELECT * FROM humo_groups WHERE group_id='".$groepen."'";
	$groepresult=mysql_query($groepsql,$db);
	$groepDb=mysql_fetch_object($groepresult);

	echo '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
	echo '<input type="hidden" name="page" value="'.$page.'">';
	print "<input type='hidden' name='groepen' value='".$groepen."'>";
	print '<input type="hidden" name="id" value="'.$groepDb->group_id.'">';
		
	echo '<table class="humo standaard" border="1">';
	print '<tr class="tabel_kop"><th>'.$language["groups_option"].'</th><th>'.$language["groups_value"].'</th></tr>';

	print '<tr><th bgcolor=green><font color=white>'.$language["groups_group"].'</font></th><th bgcolor=green><input type="Submit" name="groep_wijzig" value="'.$language["admin_change"].'"></th></tr>';
	print '<tr><td>'.$language["groups_groupname"].'</td><td><input type="text" name="group_name" value="'.$groepDb->group_name.'" size="15"></td>';

	$group_editor=$groepDb->group_editor; if ($groepDb->group_admin=='j'){ $group_editor='j'; }
	// *** Administrator group ***
	if ($groepDb->group_id=='1'){
		print '<tr><td>'.$language["groups_administrator"].'</td><td><b>'.$groepDb->group_admin.'</b></td></tr>';
		print '<input type="hidden" name="group_admin" value="'.$groepDb->group_admin.'">';

		print '<tr><td>'.$language["groups_editor"].'</td><td><b>'.$group_editor.'</b></td></tr>';
		print '<input type="hidden" name="group_editor" value="'.$group_editor.'">';
	}
	else{
		print '<tr><td>'.$language["groups_administrator"].'</td><td><select size="1" name="group_admin"><option value="j">'.$language["admin_yes"].'</option>';
		$selected=''; if ($groepDb->group_admin=='n'){ $selected=' SELECTED'; }
		echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

		print '<tr><td>'.$language["groups_editor"].'</td><td><select size="1" name="group_editor"><option value="j">'.$language["admin_yes"].'</option>';
		$selected=''; if ($group_editor=='n'){ $selected=' SELECTED'; }
		echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';
	}

	print '<tr><td>'.$language["groups_statistics"].'</td><td><select size="1" name="group_statistics"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_statistics=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><th bgcolor=green><font color=white>Menu</font></th><th bgcolor=green><input type="Submit" name="groep_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	print '<tr><td>'.$language["groups_menu-doop"].'</td><td><select size="1" name="group_menu_places"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_menu_places=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	//print '<tr><td>OUD!!! '.$language["groups_showsources"].'</td>';
	//print '<td><select size="1" name="group_sources"><option value="j">'.$language["admin_yes"].'</option>';
	//$selected=''; if ($groepDb->group_sources=='n'){ $selected=' SELECTED'; }
	//echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	echo '<tr><td>'.$language["groups_nosources"].'<br>';
	echo $language["groups_sources_title"].'<br>';
	echo $language["groups_showsources"].'<br>';
	echo '</td>';
	$selected=''; if ($groepDb->group_sources=='n'){ $selected=' CHECKED'; }
	echo '<td><input type="radio" name="group_sources" value="n"'.$selected.'><br>';
	$selected=''; if ($groepDb->group_sources=='t'){ $selected=' CHECKED'; }
	echo '<input type="radio" name="group_sources" value="t"'.$selected.'><br>';
	$selected=''; if ($groepDb->group_sources=='j'){ $selected=' CHECKED'; }
	echo '<input type="radio" name="group_sources" value="j"'.$selected.'><br>';
	echo '</td></tr>';

	print '<tr><td>'.$language["groups_showaddress"].'</td>';
	print '<td><select size="1" name="group_addresses"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_addresses=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_rss"].'</td>';
	print '<td><select size="1" name="group_birthday_rss"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_birthday_rss=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_birthdlist"].'</td>';
	print '<td><select size="1" name="group_birthday_list"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_birthday_list=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_pics_menu"].'</td>';
	print '<td><select size="1" name="group_photobook"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_photobook=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><th bgcolor=green><font color=white>'.$language["groups_general"].'</font></th><th bgcolor=green><input type="Submit" name="groep_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	print '<tr><td>'.$language["groups_pics"].'</td>';
	print '<td><select size="1" name="group_pictures"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_pictures=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_showgednr"].'</td>';
	print '<td><select size="1" name="group_gedcomnr"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_gedcomnr=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_showresidence"].'</td>';
	print '<td><select size="1" name="group_living_place"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_living_place=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_places-bapt-etc"].'</td>';
	print '<td><select size="1" name="group_places"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_places=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_showrelig"].'</td>';
	print '<td><select size="1" name="group_religion"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_religion=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_dateplace"].'</td>';
	print '<td><select size="1" name="group_place_date"><option value="j">Alkmaar 18 feb 1965</option>';
	$selected=''; if ($groepDb->group_place_date=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>18 feb 1965 Alkmaar</option></select></td></tr>';

	print '<tr><td>'.$language["groups_shownameindex"].'</td><td><select size="1" name="group_kindindex">';
	echo "<option value='j'>van Mons, Henk</option>";
	$selected=''; if ($groepDb->group_kindindex=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>Mons, Henk van</option></select></td></tr>';

	print '<tr><td>'.$language["groups_showevents"].'</td>';
	print '<td><select size="1" name="group_event"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_event=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_showowncode"].'</td>';
	print '<td><select size="1" name="group_own_code"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_own_code=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><th bgcolor=green><font color=white>'.$language["groups_texts"].'</font></th><th bgcolor=green><input type="Submit" name="groep_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	print '<tr><td>'.$language["groups_worktexts"].'</td>';
	print '<td><select size="1" name="group_work_text"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_work_text=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>';

	// *** SPARE ITEM ***
	print '<input type="hidden" name="group_texts" value="j">';
	//print '<tr><td>'.$language["groups_textatmarriage"].'</td>';
	//print '<td><select size="1" name="group_texts"><option value="j">'.$language["admin_yes"].'</option>';
	//$selected=''; if ($groepDb->group_texts=='n'){ $selected=' SELECTED'; }
	//echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print $language["groups_textwithperson"].'</td>';
	print '<td><select size="1" name="group_text_pers"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_text_pers=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_textatbapt"].'</td>';
	print '<td><select size="1" name="group_texts_pers"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_texts_pers=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_textatmarr"].'</td>';
	print '<td><select size="1" name="group_texts_fam"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_texts_fam=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><th bgcolor=green><font color=white>'.$language["groups_privfilter"].'</font></th><th bgcolor=green><input type="Submit" name="groep_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	print '<tr><th>'.$language["groups_activatepriv"].'</th><td></td></tr>';

	print '<tr><td>'.$language["groups_activatepriv"].'<br>';
	print '<i>'.$language["groups_activatepriv2"].'</i></td>';
	print '<td><select size="1" name="group_privacy"><option value="j">'.$language["admin_no"].'</option>';
	$selected=''; if ($groepDb->group_privacy=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_yes"].'</option></select></td></tr>';

	print '<tr><th>'.$language["groups_setprivs"].'</th><td></td></tr>';

	//print '<tr><td>Aldfaer (vinkje ovl.) of Haza-data: levende personen filteren</td>';
	print '<tr><td>'.$language["groups_aldfaerlivfilter"].'</td>';
	print '<td><select size="1" name="group_alive"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_alive=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_privfilteryear"].'</td>';
	print '<td><select size="1" name="group_alive_date_act"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_alive_date_act=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select>';
	echo ' '.$language["groups_year"].' <input type="text" name="group_alive_date" value="'.$groepDb->group_alive_date.'" size="4"></td></tr>';

	print '<tr><th>'.$language["groups_privfilterexcep"].'</th><td></td></tr>';

	print '<tr><td>'.$language["groups_showprivowncode"].'</td>';
	print '<td><select size="1" name="group_filter_pers_show_act"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_filter_pers_show_act=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select>';
	echo ' '.$language["groups_char"].' <input type="text" name="group_filter_pers_show" value="'.$groepDb->group_filter_pers_show.'" size="10"></td></tr>';

	print '<tr><td>'.$language["groups_noshowprivowncode"].'</td>';
	print '<td><select size="1" name="group_filter_pers_hide_act"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_filter_pers_hide_act=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select>';
	echo ' '.$language["groups_char"].' <input type="text" name="group_filter_pers_hide" value="'.$groepDb->group_filter_pers_hide.'" size="10"></td></tr>';

	print '<tr><td>'.$language["groups_filterperson"].'</td>';
	print '<td><select size="1" name="group_pers_hide_totally_act"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_pers_hide_totally_act=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select>';
	echo ' '.$language["groups_char"].' <input type="text" name="group_pers_hide_totally" value="'.$groepDb->group_pers_hide_totally.'" size="10"></td></tr>';

	print '<tr><th>'.$language["groups_extraprivoptions"].'</th><td></td></tr>';

	print '<tr><td>'.$language["groups_show_pers_nodate"].'</td>';
	print '<td><select size="1" name="group_filter_date"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_filter_date=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_filterdeaddata"].'</td>';
	print '<td><select size="1" name="group_filter_death"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_filter_death=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_privshowname"].'</td>';
	print '<td><select size="1" name="group_filter_name"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_filter_name=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<tr><td>'.$language["groups_gen_protection"].'</td>';
	print '<td><select size="1" name="group_gen_protection"><option value="j">'.$language["admin_yes"].'</option>';
	$selected=''; if ($groepDb->group_gen_protection=='n'){ $selected=' SELECTED'; }
	echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	echo '<tr><th bgcolor=green>';

	// *** SPARE ITEM ***
	print '<input type="hidden" name="group_filter_fam" value="n">';
	//print '<tr><td>'.$language["groups_filterfam"].'</td>';
	//print '<td><select size="1" name="group_filter_fam"><option value="j">'.$language["admin_yes"].'</option>';
	//$selected=''; if ($groepDb->group_filter_fam=='n'){ $selected=' SELECTED'; }
	//echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	// *** SPARE ITEM ***
	print '<input type="hidden" name="group_filter_total" value="n">';
	//print '<tr><td>'.$language["groups_filtertotal"].'</td>';
	//print '<td><select size="1" name="group_filter_total"><option value="j">'.$language["admin_yes"].'</option>';
	//$selected=''; if ($groepDb->group_filter_total=='n'){ $selected=' SELECTED'; }
	//echo '<option value="n"'.$selected.'>'.$language["admin_no"].'</option></select></td></tr>';

	print '<font color=white>'.$language["groups_keepallchanges"].'</font></th><th bgcolor=green><input type="Submit" name="groep_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	echo '</table>';
	print '</form>';

	// *** Hide or show family trees per user group ***
	echo '<h2>'.$language["groups_hide_trees"].'</h2>';
	echo '<table class="humo standaard" border="1">';

	print '<tr bgcolor=green><th><font color=white>'.$language["editor_tree"].'</font></th><th></th><th><font color=white>'.$language["groups_show_tree"].'</font></th></tr>';

		$hide_tree_array=explode(";",$groepDb->group_hide_trees);

		if (isset($_POST['hide_tree'])){
			// *** Add new hide tree ***
			$group_hide_trees='';
			if ($groepDb->group_hide_trees!=''){ $group_hide_trees=';'; }
			$group_hide_trees.=veilig($_POST['hide_tree']);
			$sql="UPDATE humo_groups SET group_hide_trees='".$groepDb->group_hide_trees.$group_hide_trees."'
			WHERE group_id=".$_POST["id"];
			$result=mysql_query($sql) or die(mysql_error());
		}

		if (isset($_POST['show_tree'])){
			// *** Rebuild hide_tree_array ***
			$group_hide_trees='';
			for ($x=0; $x<=count($hide_tree_array)-1; $x++){
				if ($hide_tree_array[$x]!=$_POST['show_tree']){
					if ($group_hide_trees!=''){ $group_hide_trees.=';'; }
					$group_hide_trees.=$hide_tree_array[$x];
				}
			}
			$sql="UPDATE humo_groups SET group_hide_trees='".$group_hide_trees."'
			WHERE group_id=".$_POST["id"];
			$result=mysql_query($sql) or die(mysql_error());
		}

		// *** Renew data after update ***
		$groepsql="SELECT * FROM humo_groups WHERE group_id='".$groepen."'";
		$groepresult=mysql_query($groepsql,$db);
		$groepDb=mysql_fetch_object($groepresult);
		$hide_tree_array=explode(";",$groepDb->group_hide_trees);

		$data3sql = mysql_query("SELECT * FROM humo_trees ORDER BY tree_order",$db);
		while($data3Db=mysql_fetch_object($data3sql)){
			if ($data3Db->tree_prefix!='LEEG'){
				$treetext_name=database_name($data3Db->tree_prefix, $Taalkeuze);		
				echo '<tr><td>'; 

				echo $data3Db->tree_prefix.'</td><td>'.$treetext_name.'</td>';
				echo '<td>';
					echo '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
						echo '<input type="hidden" name="page" value="'.$page.'">';
						print " <input type='hidden' name='groepen' value='".$groepen."'>";
						print '<input type="hidden" name="id" value="'.$groepDb->group_id.'">';

						$hide_tree=false;
						for ($x=0; $x<=count($hide_tree_array)-1; $x++){
							if ($hide_tree_array[$x]==$data3Db->tree_id){ $hide_tree=true; }
						}
						if ($hide_tree==true){
							echo '<b>'.$language["admin_no"].'</b>';
							print '<input type="hidden" name="show_tree" value="'.$data3Db->tree_id.'">';
							echo ' <input type="Submit" name="tree_id_yes" value="'.$language["admin_yes"].'">';
						}
						else{
							echo '<b>'.$language["admin_yes"].'</b>';
							print '<input type="hidden" name="hide_tree" value="'.$data3Db->tree_id.'">';
							echo ' <input type="Submit" name="submit" value="'.$language["admin_no"].'">';
						}
					print '</form>';
				echo '</td></tr>';
			}
		}
	echo '</table>';
	
//}
?>
Return current item: HuMo-gen