<?php
require_once("config_sql.php");
?>
<!-- Console -->

<div id="console" style="position:absolute; background: url(images/console/layer.gif); display:none; overflow: hidden; left:99; top:99; height:294; width:253; z-index:140;">

<table border='0' width="100%" cellpadding="0" cellspacing="0" height="5">
<tr>
<td height="5"></td>
</tr>
</table>
<div class="handle" onmousedown="dragStart(event, 'console')">
<table border='0' width="100%" cellpadding="0" cellspacing="0" height="15">
<tr>
<td height="15"></td>
</tr>
</table>
</div>

<div id='console_close_div' style='position:absolute; left:229; top:7; border: 0px; width: 11px; height: 11px;'>
<a onclick="HideContent('console');"><img src="images/console/close.gif" border='0' style='cursor: pointer;' align='top'></a></a>
</div>

<div id='console_text_1' style='position:absolute; left:0; top:0; display:;'>

<img src='images/console/streep.gif' style='position:absolute; left:21; top:130;'>

<div id='console_text_1_jouwnaam' style='position:absolute; left:65; top:62; font-weight: bold;' class='consolefont'>
</div>

<form name='console_mission'>
<input type='text' id='jouw_console_missie' name='jouw_console_missie' size='21' maxlength='21' class='consoleinput' style='position:absolute; left:61; top:79;'>
</form>

<div id='console_link_1' style='position:absolute; left:87; top:162; width:147; height:30;' class='consolefont'>
<a onclick='console_show_main();'><div class='consolefont' style='cursor: pointer;'><u>0 Nieuw(e) bericht(en)</u></div></a>
</div>

<div id='console_link_2' style='position:absolute; left:87; top:178; width:147; height:30;' class='consolefont'>
<a onclick='console_show_main();'><div class='consolefont' style='cursor: pointer;'><u>0 Vriendenverzoek(en)</u></div></a>
</div>

</div>

<div id='console_text_2' style='position:absolute; left:0; top:0; display:none;'>

<div id='console_vrienden' class='consolescroll' style='position:absolute; left:19; top:33;'>
</div>

<div id='console_text_2_help' style='position:absolute; left:29; top:202; width:13; height:13;'>
<a onclick='console_toon_friends_help();'><div style='cursor: pointer;'><img src='images/knoppen/console_ask.gif'></div></a>
</div>

<div id='console_write_message' style='position:absolute; left:49; top:200;'>
<a onclick='if(console_write_button_enable=="ja"){friend_start_write();}'><img id='console_write' src='images/knoppen/console_write.gif' border='0' onmousedown='if(console_write_button_enable=="ja"){button_down("console_write");}' onmouseup='if(console_write_button_enable=="ja"){button_up("console_write");}' style='cursor: default;'></a>
</div>

<div id='console_delete_buddy' style='position:absolute; left:171; top:200;'>
<a onclick='if(console_del_button_enable=="ja"){friend_start_del();}'><img id='console_del' src='images/knoppen/console_del.gif' border='0' onmousedown='if(console_del_button_enable=="ja"){button_down("console_del");}' onmouseup='if(console_del_button_enable=="ja"){button_up("console_del");}' style='cursor: default;'></a>
</div>

</div>

<div id='console_text_3' style='position:absolute; left:0; top:0; display:none;'>

<img src='images/console/zoeklayer.gif' style='position:absolute; left:24; top:77;'>

<input type='text' id='console_zoeknaam' name='console_zoeknaam' onKeyPress='checkEnter(event, "console");' size='25' maxlength='20' class='consoleinput' style='position:absolute; left:24; top:52;'>

<div id='console_zoek_button' style='position:absolute; left:183; top:52;'>
<a onclick='console_zoek_jabbo()'><img id='console_zoek' src='images/knoppen/console_zoek.gif' border='0' onmousedown='button_down("console_zoek")' onmouseup='button_up("console_zoek")' style='cursor: default;'></a>
</div>

<div id='console_gevonden_naam' style='position:absolute; left:73; top:86; width:155; font-weight:bold; display:none;' class='consolefont'>
</div>

<div id='console_gevonden_missie' style='position:absolute; left:73; top:100; width:155; display:none;' class='consolefont'>
</div>

<div id='console_gevonden_last_online' style='position:absolute; left:73; top:149; width:155; display:none;' class='consolefont'>
</div>

<div id='console_gevonden_online_status' style='position:absolute; left:73; top:169; width:155; display:none;' class='consolefont'>
</div>

<img id='console_vergroot' src='images/console/vergrootglas.gif' style='position:absolute; left:37; top:151; display:none;'>

<div id='console_zoek_vv_button' style='position:absolute; left:25; top:201;'>
<a onclick='if(console_voegtoe=="ja"){console_zoek_vv_jabbo();}'><img id='console_zoek_vv' src='images/knoppen/console_zoek_vv.gif' border='0' onmousedown='if(console_voegtoe=="ja"){button_down("console_zoek_vv");}' onmouseup='if(console_voegtoe=="ja"){button_up("console_zoek_vv");}' style='cursor: default;'></a>
</div>

</div>

<div id='console_text_4' style='position:absolute; left:0; top:0; display:none;'>

<img src='images/console/textarea.gif' style='position:absolute; left:24; top:63;'>

<div style='position:absolute; left:32; top:44; width:177px; font-weight: bold;' class='consolefont'>
Console help
</div>

<div style='position:absolute; left:32; top:69; width:177px; height:100px;' class='consolefont'>
Je kunt de console gebruiken om in contact te blijven met je vrienden ook als die offline zijn.
</div>

</div>

<div id='console_text_5' style='position:absolute; left:0; top:0; display:none;'>

<div id='console_text_5_text' style='position:absolute; left:19; top:72; width:215; height:125; font-weight: bold;' align='center' class='consolefont'>
</div>

<div id='console_text_5_button' style='position:absolute; left:114; top:201;'>
<a onclick='click_console_tab3();'><img id='console_ok' src='images/knoppen/console_ok.gif' border='0' onmousedown='button_down("console_ok");' onmouseup='button_up("console_ok");' style='cursor: default;'></a>
</div>

</div>

<div id='console_text_6' style='position:absolute; left:0; top:0; display:none;'>

<div id='console_text_6_text' style='position:absolute; left:19; top:70; width:215; height:125; font-weight: bold;' align='center' class='consolefont'>
</div>

<div id='console_text_6_button1' style='position:absolute; left:76; top:201;'>
<a onclick='console_show_main(); console_answer_vv("nee");'><img id='console_nee' src='images/knoppen/console_nee.gif' border='0' onmousedown='button_down("console_nee");' onmouseup='button_up("console_nee");' style='cursor: default;'></a>
</div>

<div id='console_text_6_button2' style='position:absolute; left:136; top:201;'>
<a onclick='console_show_main(); console_answer_vv("ja");'><img id='console_ja' src='images/knoppen/console_ja.gif' border='0' onmousedown='button_down("console_ja");' onmouseup='button_up("console_ja");' style='cursor: default;'></a>
</div>

</div>

<div id='console_text_7' style='position:absolute; left:0; top:0; display:none;'>

<img src='images/console/textarea.gif' style='position:absolute; left:24; top:63;'>

<div style='position:absolute; left:32; top:44; width:177px; font-weight: bold;' class='consolefont'>
Vrienden
</div>

<div style='position:absolute; left:32; top:69; width:177px; height:100px;' class='consolefont'>
Dit scherm bevat een lijst met al je Jabbo Vrienden. Je kunt er zien of ze online zijn, of, als ze niet zijn ingecheckt, wanneer ze er voor het laatst waren.
</div>

<div id='console_text_7_button' style='position:absolute; left:25; top:201; width:40; height:18;'>
<a onclick='click_console_tab2();'><img id='console_back' src='images/knoppen/console_back.gif' border='0' onmousedown='button_down("console_back");' onmouseup='button_up("console_back");' style='cursor: default;'></a>
</div>

</div>

<div id='console_text_8' style='position:absolute; left:0; top:0; display:none;'>

<div id='console_text_8_text' style='position:absolute; left:19; top:97; width:215; height:125; font-weight: bold;' align='center' class='consolefont'>
</div>

<div id='console_text_8_button1' style='position:absolute; left:67; top:201;'>
<a onclick='click_console_tab2();'><img id='console_del_no' src='images/knoppen/console_del_no.gif' border='0' onmousedown='button_down("console_del_no");' onmouseup='button_up("console_del_no");' style='cursor: default;'></a>
</div>

<div id='console_text_8_button2' style='position:absolute; left:134; top:201;'>
<a onclick='console_friend_del();'><img id='console_del_yes' src='images/knoppen/console_del_yes.gif' border='0' onmousedown='button_down("console_del_yes");' onmouseup='button_up("console_del_yes");' style='cursor: default;'></a>
</div>

</div>

<div id='console_text_9' style='position:absolute; left:0; top:0; display:none;'>

<div style='position:absolute; left:29; top:39; width:177px; font-weight: bold;' class='consolefont'>
Ontvanger
</div>

<div id='console_text_9_text' style='position:absolute; left:35; top:51; font-weight: bold;' class='consolefont'>
</div>

<div id='console_text_9_help' style='position:absolute; left:216; top:41; width:13; height:13;'>
<a onclick='console_toon_write_help();'><div style='cursor: pointer;'><img src='images/knoppen/console_ask2.gif'></div></a>
</div>

<form name='console_send_message_box'>
<textarea id='console_send_message_text' name='console_send_message_text' style='position:absolute; left:24; top:80; width: 205px; height: 114px; padding: 3px; overflow:hidden; border: 1px solid #eeeeee; background-color: transparent; font-family: verdana, arial, sans-serif; font-size: 9px; color: #eeeeee;' onKeyDown="textCounter(this.form.console_send_message_text,216);" onKeyUp="textCounter(this.form.console_send_message_text,216);">
</textarea>
</form>

<div id='console_text_9_button1' style='position:absolute; left:25; top:201;'>
<a onclick='click_console_tab2();'><img id='console_write_no' src='images/knoppen/console_write_no.gif' border='0' onmousedown='button_down("console_write_no");' onmouseup='button_up("console_write_no");' style='cursor: default;'></a>
</div>

<div id='console_text_9_button2' style='position:absolute; left:163; top:201;'>
<a onclick='friend_send_write();'><img id='console_write_yes' src='images/knoppen/console_write_yes.gif' border='0' onmousedown='button_down("console_write_yes");' onmouseup='button_up("console_write_yes");' style='cursor: default;'></a>
</div>

</div>

<div id='console_text_10' style='position:absolute; left:0; top:0; display:none;'>

<img src='images/console/textarea.gif' style='position:absolute; left:24; top:63;'>

<div style='position:absolute; left:32; top:44; width:177px; font-weight: bold;' class='consolefont'>
Verschillende berichten
</div>

<div style='position:absolute; left:32; top:69; width:177px; height:100px;' class='consolefont'>
Stuur je vrienden een bericht.
</div>

<div id='console_text_10_button' style='position:absolute; left:25; top:201; width:40; height:18;'>
<a onclick='console_stop_write_help();'><img id='console_2back' src='images/knoppen/console_2back.gif' border='0' onmousedown='button_down("console_2back");' onmouseup='button_up("console_2back");' style='cursor: default;'></a>
</div>

</div>

<div id='console_text_11' style='position:absolute; left:0; top:0; display:none;'>

<div id='console_text_11_text1' style='position:absolute; left:72; top:39; width:162px; overflow: hidden;' class='consolefont'>
</div>

<div id='console_text_11_text2' style='position:absolute; left:72; top:49; width:162px; overflow: hidden;' class='consolefont'>
</div>

<div id='console_message_div' class='consolemessagescroll' style='position:absolute; left:24; top:80;'>
</div>

<div id='console_text_11_button1' style='position:absolute; left:171; top:201; width:201; height:18;'>
<a onclick='console_del_message();'><img id='console_del_m' src='images/knoppen/console_del_m.gif' border='0' onmousedown='button_down("console_del_m");' onmouseup='button_up("console_del_m");' style='cursor: default;'></a>
</div>

</div>

<div id="console_tab1_div" style='position:absolute; left:33; top:245; z-index:7; border: 0px;'>
<img src="images/console/tabs/1b.gif" id="console_tab1" onclick="click_console_tab1()">
</div>

<div id="console_tab2_div" style='position:absolute; left:79; top:245; z-index:7; border: 0px;'>
<img src="images/console/tabs/2.gif" id="console_tab2" onclick="click_console_tab2()">
</div>

<div id="console_tab3_div" style='position:absolute; left:126; top:245; z-index:7; border: 0px;'>
<img src="images/console/tabs/3.gif" id="console_tab3" onclick="click_console_tab3()">
</div>

<div id="console_tab4_div" style='position:absolute; left:173; top:245; z-index:7; border: 0px;'>
<img src="images/console/tabs/4.gif" id="console_tab4" onclick="click_console_tab4()">
</div>

</div>

<!-- Einde Console -->

<!-- Navigator -->

<div id="navigator" style="position:absolute; background: url(images/navi/layer.gif); display:none; overflow: none; left:345; top:20; height:453; width:363; z-index:140; border: 0px solid black;">

<table border='0' width="363" cellpadding="0" cellspacing="0" height="5">
<tr>
<td height="5"></td>
</tr>
</table>

<div class="handle" onmousedown="dragStart(event, 'navigator')">
<table border='0' width="363" cellpadding="0" cellspacing="0" height="15">
<tr>
<td align="right" height="15" valign="middle"><a onclick="HideContent('navigator');"><img border="0" src="images/navi/close.gif" style="cursor: pointer;"></a></td>
<td width='13' height='13'></td>
</tr>
</table>
</div>

<div id="big_tab1_div" style='position:absolute; left:10; top:29; z-index:7; border: 0px;'>
<img src="images/navi/tabs/1b.gif" id="big_tab1" onclick="click_big_tab1()">
</div>
<div id="big_tab2_div" style='position:absolute; left:181; top:29; z-index:7; border: 0px;'>
<img src="images/navi/tabs/2a.gif" id="big_tab2" onclick="click_big_tab2()">
</div>

<div id="small_tab1_div" style='position:absolute; left:10; top:86; z-index:7; border: 0px; visibility: hidden;'>
<img src="images/navi/small_tabs/1a.gif" id="small_tab1" onclick="click_small_tab1()">
</div>
<div id="small_tab2_div" style='position:absolute; left:125; top:86; z-index:7; border: 0px; visibility: hidden;'>
<img src="images/navi/small_tabs/2a.gif" id="small_tab2" onclick="click_small_tab2()">
</div>
<div id="small_tab3_div" style='position:absolute; left:238; top:86; z-index:7; border: 0px; visibility: hidden;'>
<img src="images/navi/small_tabs/3a.gif" id="small_tab3" onclick="click_small_tab3()">
</div>

<div>

<div id='tabtitel_1' style='position:absolute; left:32; top:93; z-index:7; border: 0px; font-family: verdana, arial, sans-serif; font-size: 9px; font-weight: bold; visibility: visible;'>
Openbare ruimten
</div>

<div id='tabtitel_2' style='position:absolute; left:32; top:111; z-index:7; border: 0px; font-family: verdana, arial, sans-serif; font-size: 9px; font-weight: bold; visibility: hidden;'>
Gastenkamers
</div>

<div id='tabtitel_3' style='position:absolute; left:32; top:164; z-index:7; border: 0px; font-family: verdana, arial, sans-serif; font-size: 9px; font-weight: bold; visibility: hidden;'>
Zoekresultaten
</div>

<div id='tabtitel_4' style='position:absolute; left:32; top:164; z-index:7; border: 0px; font-family: verdana, arial, sans-serif; font-size: 9px; font-weight: bold; visibility: hidden;'>
Jouw kamers
</div>

<div id='tabtitel_5' style='position:absolute; left:32; top:119; z-index:7; border: 0px; font-family: verdana, arial, sans-serif; font-size: 9px; font-weight: bold; visibility: hidden;'>
Jouw favoriete kamers
</div>

<div id='wijziglayer' style='position:absolute; left:10; top:109; z-index:10; border: 0px; visibility: hidden;'>
<img src="images/navi/wijziglayer.gif" id="wijziglayer_src">
</div>

<div id='navi_change_button_cancel' style='position:absolute; left:60; top:414; z-index:11; border: 0px; visibility: hidden;'>
<a onclick='stop_change_room()'><img id='cancel' src='images/knoppen/cancel.gif' border='0' onmousedown='button_down("cancel")' onmouseup='button_up("cancel")' style='cursor: default;'></a>
</div>

<div id='navi_change_button_del_room' style='position:absolute; left:128; top:414; z-index:11; border: 0px; visibility: hidden;'>
<a onclick='del_change_room()'><img id='del_room' src='images/knoppen/del_room.gif' border='0' onmousedown='button_down("del_room")' onmouseup='button_up("del_room")' style='cursor: default;'></a>
</div>

<div id='navi_change_button_ok' style='position:absolute; left:279; top:412; z-index:11; border: 0px; visibility: hidden;'>
<a onclick='save_change_room()'><img id='change_ok' src='images/knoppen/change_ok.gif' border='0' onmousedown='button_down("change_ok")' onmouseup='button_up("change_ok")' style='cursor: default;'></a>
</div>

<div id='navi_change_text_div' style='position:absolute; height: 294px; left:58; top:109; z-index:11; border: 0px; visibility: hidden;'>
<table class='clientfont' border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'>
<tr>
<td valign='middle'>
Naam van de kamer<br>
<input type='text' size='43' maxlength='30' id='change_name' name='change_name' class='clientfont'>
<br><br>
Beschrijving kamer:<br>
<textarea id='change_desc' name='change_desc' cols='40' rows='3' class='clientfont'></textarea>
<br><br>
<input onclick="change_safe_pass()" type="radio" name="change_safety" value="1" id="change_safety_1" checked> Deur is open<br>
<input onclick="change_safe_pass()" type="radio" name="change_safety" value="2" id="change_safety_2"> Deur is op slot, alleen jij kan binnen<br>
<input onclick="change_safe_pass()" type="radio" name="change_safety" value="3" id="change_safety_3"> Wachtwoord voor beperkte toegang
<br><br>
<div id='change_pass_div' style='z-index:11; visibility: hidden;'>
</div>
<input type="hidden" name="change_id" id="change_id" checked>
</td>
</tr>
</table>
</div>

<div id='navi_blanc_layer' style='position:absolute; left:10; top:29; z-index:12; border: 0px; visibility: hidden;'>
<img src="images/navi/blanc_layer.gif" id="blanc_layer_src">
</div>

<div id='navi_del_text_div' style='position:absolute; width: 342px; height: 413px; left:10; top:29; z-index:12; border: 0px; visibility: hidden;'>
<table class='clientfont' border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'>
<tr>
<td valign='middle'>
<center>
<div id='navi_del_text'>
</div>
</center>
</td>
</tr>
</table>
</div>

<div id='zoeklayer' style='position:absolute; left:10; top:110; z-index:8; border: 0px; visibility: hidden;'>
<img src="images/navi/zoeklayer.gif" id="zoeklayer_src">
</div>

<div id='zoekvak' style='position:absolute; left:16; top:130; z-index:9; border: 0px; visibility: hidden;'>
<input type='text' size='38' id='gezocht' name='gezocht' onKeyPress='checkEnter(event, "navi");' class='clientfont'>
</div>

<div id='zoekknop' style='position:absolute; left:305; top:132; z-index:9; border: 0px; visibility: hidden;'>
<a onclick='update_zoek()'><img id='zoek' src='images/knoppen/zoek.gif' border='0' onmousedown='button_down("zoek")' onmouseup='button_up("zoek")' style='cursor: default;'></a>
</div>

<div id='eigenlayer' style='position:absolute; left:10; top:110; z-index:8; border: 0px; visibility: hidden;'>
<img src="images/navi/eigenlayer.gif" id="eigenlayer_src">
</div>

<div id='maakknop' style='position:absolute; left:16; top:132; z-index:9; width:225px; border: 0px; visibility: hidden;'>
<a onclick='maakklik()'><img id='maak' src='images/knoppen/maak.gif' border='0' onmousedown='button_down("maak")' onmouseup='button_up("maak")' style='cursor: default;'></a>
</div>

<div id='maakmachine' style='position:absolute; left:317; top:115; z-index:8; border: 0px; visibility: hidden;'>
<a onclick='maakklik()'><img src="images/navi/room_maker.gif" id="maakmachine_src" border='0' style='cursor: default;'></a>
</div>

<div id='naviplaatje' style='position:absolute; left:26; top:354; z-index:8; border: 0px;'>
<table border='0' cellpadding='0' cellspacing='0' height='68' width='58'>
<tr><td valign='middle'><center>
<img src="images/navi/icons/8.gif" id="tabtitel_src">
</center></td></tr>
</table>
</div>

<div id='kamerschrijf_1' style='position:absolute; left:96; top:352; z-index:6; height: 60px; width:230px; border: 0px; font-family: verdana, arial, sans-serif; font-size: 9px; font-weight: bold;'>
Openbare ruimten
</div>

<div id='kamerschrijf_2' style='position:absolute; left:96; top:362; z-index:6; height: 60px; width:230px; border: 0px; font-family: verdana, arial, sans-serif; font-size: 9px; font-weight: bold;'>
</div>

<div id='kamerschrijf_3' style='position:absolute; left:96; top:374; z-index:6; height: 60px; width:230px; border: 0px; font-family: verdana, arial, sans-serif; font-size: 9px;;'>
Dit zijn de openbare ruimten van de hotel. Waar wacht je nog op? Ga erheen en ontmoet er anderen!
</div>

<div id='navi_button_ga' style='position:absolute; left:291; top:412; z-index:6; border: 0px;'>
</div>

<div id='navi_button_add_fav' style='position:absolute; left:125; top:415; z-index:6; border: 0px;'>
</div>

<div id='navi_button_del_fav' style='position:absolute; left:95; top:415; z-index:6; border: 0px;'>
</div>

<div id='navi_button_wijzig' style='position:absolute; left:125; top:415; z-index:6; border: 0px;'>
</div>

<?php
echo "<div id='list_openbaar' class='scroll' style='height: 230px; position:absolute; left:15; top:110; z-index:5; visibility: visible;'>";
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo "<tr>";
echo "<td colspan='5' height='2'></td>";
echo '</tr>';
$csql = "SELECT * FROM `kamers` WHERE type='openbaar';";
$cres = mysql_query($csql);
if (mysql_num_rows($cres) >= 1)
{
	while ($row = mysql_fetch_array($cres))
    {
	    $result = mysql_query("SELECT * FROM `favorites` WHERE kamerid='".$row['id']."' AND member='".$_GET['jouwnaam']."';");
		if (mysql_num_rows($result) >= 1)
		{
			$favoriet = "ja";
		}
		else
		{
			$favoriet = "nee";
		}
		echo "<tr>";
		echo "<td><img src='images/navi/links.gif'></td>";
		echo "<td onclick=\"kamer('".$row['naam']."', '".$row['omschrijf']."', '".$row['type']."', '".$row['safe']."', '".$row['eigenaar']."', ".$row['id'].", '".$favoriet."', '".$row['pass']."');\" width=\"227\" bgcolor=\"#DADADA\"><div class='clientfont'><img src='images/navi/sloten/".$row['safe'].".gif'>&nbsp;".$row['naam']."</div></td>";
		echo "<td><img src='images/navi/rechts.gif'></td>";
		echo "<td width='2'><font color='black' size='2'>&nbsp;</font></td>";
		echo "<td><a onclick=\"gaklik('".$row['naam']."', '".$row['omschrijf']."', '".$row['type']."', '".$row['safe']."', '".$row['eigenaar']."', ".$row['id'].", '".$favoriet."', '".$row['pass']."');\"><img src='images/navi/ga.gif' border='0' style='cursor: default;'></a></td>";
		echo "</tr>";
		echo "<tr>";
		echo "<td colspan='5' height='2'></td>";
		echo "</tr>";
	}
}
else
{
	echo "<table border='0' cellpadding='0' cellspacing='0'>";
	echo "<tr>";
	echo "<td colspan='2' height='8'></td>";
	echo "</tr>";
	echo "<tr>";
	echo "<td width='8'></td>";
	echo "<td>";
	echo "<div class='clientfont'>";
	echo "Er zijn nog geen openbare ruimten.";
	echo "</div>";
	echo "</td>";
	echo "</tr>";
	echo "</table>";
}
echo "</table>";
echo "</div>";

echo "<div id='list_anderen' class='scroll' style='height: 207px; position:absolute; left:15; top:128; z-index:5; visibility: hidden;'>";
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo "<tr>";
echo "<td colspan='5' height='2'></td>";
echo '</tr>';
$csql = "SELECT * FROM `kamers` WHERE type!='openbaar' AND eigenaar!='".$_GET['jouwnaam']."' AND safe=1 ORDER BY RAND() DESC LIMIT 0, 50;"; 
$cres = mysql_query($csql);
if (mysql_num_rows($cres) >= 1)
{
	while ($row = mysql_fetch_array($cres))
    {
	    $result = mysql_query("SELECT * FROM items WHERE kamerused='".$row['id']."';");
		if (mysql_num_rows($result) >= 1)
		{
			$result = mysql_query("SELECT * FROM `favorites` WHERE kamerid='".$row['id']."' AND member='".$_GET['jouwnaam']."';");
			if (mysql_num_rows($result) >= 1)
			{
				$favoriet = "ja";
			}
			else
			{
				$favoriet = "nee";
			}
			echo "<tr>";
			echo "<td><img src='images/navi/links.gif'></td>";
			echo "<td onclick=\"kamer('".$row['naam']."', '".$row['omschrijf']."', '".$row['type']."', '".$row['safe']."', '".$row['eigenaar']."', ".$row['id'].", '".$favoriet."', '".$row['pass']."');\" width=\"227\" bgcolor=\"#DADADA\"><div class='clientfont'><img src='images/navi/sloten/".$row['safe'].".gif'>&nbsp;".$row['naam']."</div></td>";
			echo "<td><img src='images/navi/rechts.gif'></td>";
			echo "<td width='2'><font color='black' size='2'>&nbsp;</font></td>";
			echo "<td><a onclick=\"gaklik('".$row['naam']."', '".$row['omschrijf']."', '".$row['type']."', '".$row['safe']."', '".$row['eigenaar']."', ".$row['id'].", '".$favoriet."', '".$row['pass']."');\"><img src='images/navi/ga.gif' border='0' style='cursor: default;'></a></td>";
			echo "</tr>";
			echo "<tr>";
			echo "<td colspan='5' height='2'></td>";
			echo "</tr>";
		}
	}
}
else
{
	echo "<table border='0' cellpadding='0' cellspacing='0'>";
	echo "<tr>";
	echo "<td colspan='2' height='8'></td>";
	echo "</tr>";
	echo "<tr>";
	echo "<td width='8'></td>";
	echo "<td>";
	echo "<div class='clientfont'>";
	echo "Er zijn nog geen kamers van anderen.";
	echo "</div>";
	echo "</td>";
	echo "</tr>";
	echo "</table>";
}
echo "</table>";
echo "</div>";

echo "<div id='list_zoek' class='scroll' style='height: 164px; position:absolute; left:15; top:173; z-index:5; visibility: hidden;'>";
echo "</div>";

echo "</div>";

echo "<div id='list_eigen' class='scroll' style='height: 164px; position:absolute; left:15; top:173; z-index:5; visibility: hidden;'>";
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo "<tr>";
echo "<td colspan='5' height='6'></td>";
echo '</tr>';
$csql = "SELECT * FROM `kamers` WHERE type!='openbaar' AND eigenaar='".$_GET['jouwnaam']."';"; 
$cres = mysql_query($csql);
if (mysql_num_rows($cres) >= 1)
{
	while ($row = mysql_fetch_array($cres))
    {
	    $result = mysql_query("SELECT * FROM `favorites` WHERE kamerid='".$row['id']."' AND member='".$_GET['jouwnaam']."';");
		if (mysql_num_rows($result) >= 1)
		{
			$favoriet = "ja";
		}
		else
		{
			$favoriet = "nee";
		}
		echo "<tr>";
		echo "<td><img src='images/navi/links.gif'></td>";
		echo "<td onclick=\"kamer('".$row['naam']."', '".$row['omschrijf']."', '".$row['type']."', '".$row['safe']."', '".$row['eigenaar']."', ".$row['id'].", '".$favoriet."', '".$row['pass']."');\" width=\"227\" bgcolor=\"#DADADA\"><div class='clientfont'><img src='images/navi/sloten/".$row['safe'].".gif'>&nbsp;".$row['naam']."</div></td>";
		echo "<td><img src='images/navi/rechts.gif'></td>";
		echo "<td width='2'><font color='black' size='2'>&nbsp;</font></td>";
		echo "<td><a onclick=\"gaklik('".$row['naam']."', '".$row['omschrijf']."', '".$row['type']."', '".$row['safe']."', '".$row['eigenaar']."', ".$row['id'].", '".$favoriet."', '".$row['pass']."');\"><img src='images/navi/ga.gif' border='0' style='cursor: default;'></a></td>";
		echo "</tr>";
		echo "<tr>";
		echo "<td colspan='5' height='2'></td>";
		echo "</tr>";
	}
}
else
{
	echo "<table border='0' cellpadding='0' cellspacing='0'>";
	echo "<tr>";
	echo "<td colspan='2' height='8'></td>";
	echo "</tr>";
	echo "<tr>";
	echo "<td width='8'></td>";
	echo "<td>";
	echo "<div class='clientfont'>";
	echo "Je hebt nog geen kamers.";
	echo "</div>";
	echo "</td>";
	echo "</tr>";
	echo "</table>";
}
echo "</table>";
echo "</div>";

echo "<div id='list_favoriet' class='scroll' style='height: 209px; position:absolute; left:15; top:128; z-index:5; visibility: hidden;'>";
echo '<table border="0" cellpadding="0" cellspacing="0">';
echo "<tr>";
echo "<td colspan='5' height='6'></td>";
echo '</tr>';
$csql = "SELECT * FROM `favorites` WHERE member='".$_GET['jouwnaam']."';"; 
$cres = mysql_query($csql); 
if (mysql_num_rows($cres) >= 1) 
{
	while ($row = mysql_fetch_array($cres)) 
    {
	    $favoriet = "ja";
	    $favo_naam = halen("SELECT naam FROM kamers WHERE id='".$row['kamerid']."';");
	    $favo_omschrijf = halen("SELECT omschrijf FROM kamers WHERE id='".$row['kamerid']."';");
	    $favo_type = halen("SELECT type FROM kamers WHERE id='".$row['kamerid']."';");
	    $favo_safe = halen("SELECT safe FROM kamers WHERE id='".$row['kamerid']."';");
	    $favo_eigenaar = halen("SELECT eigenaar FROM kamers WHERE id='".$row['kamerid']."';");
	    $favo_pass = halen("SELECT pass FROM kamers WHERE id='".$row['kamerid']."';");
	    $favo_id = halen("SELECT id FROM kamers WHERE id='".$row['kamerid']."';");
		echo "<tr>";
		echo "<td><img src='images/navi/links.gif'></td>";
		echo "<td onclick=\"kamer('".$favo_naam."', '".$favo_omschrijf."', '".$favo_type."', '".$favo_safe."', '".$favo_eigenaar."', ".$favo_id.", '".$favoriet."', '".$favo_pass."');\" width=\"227\" bgcolor=\"#DADADA\"><div class='clientfont'><img src='images/navi/sloten/".$favo_safe.".gif'>&nbsp;".$favo_naam."</div></td>";
		echo "<td><img src='images/navi/rechts.gif'></td>";
		echo "<td width='2'><font color='black' size='2'>&nbsp;</font></td>";
		echo "<td><a onclick=\"gaklik('".$favo_naam."', '".$favo_omschrijf."', '".$favo_type."', '".$favo_safe."', '".$favo_eigenaar."', ".$favo_id.", '".$favoriet."', '".$favo_pass."');\"><img src='images/navi/ga.gif' border='0' style='cursor: default;'></a></td>";
		echo "</tr>";
		echo "<tr>";
		echo "<td colspan='5' height='2'></td>";
		echo "</tr>";
	}
}
else
{
	echo "<table border='0' cellpadding='0' cellspacing='0'>";
	echo "<tr>";
	echo "<td colspan='2' height='8'></td>";
	echo "</tr>";
	echo "<tr>";
	echo "<td width='8'></td>";
	echo "<td>";
	echo "<div class='clientfont'>";
	echo "Je hebt nog geen favoriete kamers.";
	echo "</div>";
	echo "</td>";
	echo "</tr>";
	echo "</table>";
}
echo "</table>";
echo "</div>";

?>
</div>
</div>

<!-- Einde Navigator -->

<!-- Room-o-Matic -->

<div id="matic_back" class="transp" style="position:absolute; background: url(images/room_maker/black.gif); z-index:140; display:none; overflow: none; left:0; top:0; height:549px; width:720px;">
</div>

<div id="matic" style="position:absolute; background: url(images/room_maker/layer.gif); z-index:141; display:none; overflow: none; left:185; top:64; height:477; width:324;">

<div id='matic_close_div' style='position:absolute; left:289; top:39; border: 0px;'>
<a onclick='matic_close();'><img src="images/room_maker/close.gif" id="matic_close_src" border='0' style='cursor: pointer;'></a>
</div>

<div id='matic_1' style='position:absolute; left:35; top:80; z-index:1; height: 205px; width:255px; border: 0px;'>
<table border='0' cellpadding='0' cellspacing='0' height='205' width='255'>
<tr>
<td valign='middle'>
<div class='maticfont' id='matic_1_text' style='border: 0px;'>
Richt je kamer in zoals jij het wilt.
Niemand kan je vertellen dat je op moet ruimen of je muziek zachter moet zetten.
En je mag lekker zelf weten of je iedereen binnenlaat, of alleen je beste vrienden.
Of doe de deur op slot en in je eentje op de bank zitten.
Wees creatief en in een paar minuten heb jij ook je eigen kamer.
</div>
</td>
</tr>
</table>
</div>

<div id='matic_2' style='position:absolute; left:32; top:71; z-index:1; height: 35px; width:255px; border: 0px; visibility: hidden;'>
<table border='0' cellpadding='0' cellspacing='0' height='35' width='255'>
<tr>
<td valign='middle'>
<center>
<div class='maticfont' id='matic_2_text' style='border: 0px;'>
</div>
</center>
</td>
</tr>
</table>
</div>

<div id='matic_3' style='position:absolute; left:35; top:80; z-index:1; height: 205px; width:255px; border: 0px; visibility: hidden;'>
<table border='0' cellpadding='0' cellspacing='0' height='205' width='255'>
<tr>
<td valign='middle'>
<div class='maticfont' id='matic_3_text' style='border: 0px;'>
<center>
<table class='maticfont' border='0'>
<tr>
<td align='right'>Naam kamer&nbsp;&nbsp;</td>
<td><input type='text' size='30' maxlength='30' id='matic_name' name='matic_name' class='clientfont'></td>
</tr>
<tr>
<td align='right'>Eigenaar:&nbsp;&nbsp;</td>
<td><input type='text' size='30' value='<?php echo $_GET['jouwnaam']; ?>' class='clientfont' readonly></td>
</tr>
</table>
</center>
<br><br>
Omschrijving kamer:
<br>
<textarea id='matic_desc' name='matic_desc' cols='25' rows='3'></textarea>
</div>
</td>
</tr>
</table>
</div>

<div id='matic_4' style='position:absolute; left:32; top:296; z-index:1; height: 17px; width:255px; border: 0px; visibility: hidden;'>
<table border='0' cellpadding='0' cellspacing='0' height='17' width='255'>
<tr>
<td valign='middle'>
<center>
<div class='maticfont' id='matic_4_text' style='border: 0px;'>
</div>
</center>
</td>
</tr>
</table>
</div>

<div id='matic_5' style='position:absolute; left:35; top:80; z-index:1; height: 205px; width:255px; border: 0px; visibility: hidden;'>
<table border='0' cellpadding='0' cellspacing='0' height='205' width='255'>
<tr>
<td valign='middle'>
<center>
<table border='0'>
<tr>
<td valign='center' align='center'>
<a onclick='matic_pijl_1()'><img src='images/room_maker/buttons/pijl1.gif'></a>
</td>
<td valign='center' align='center' width='150' height='150'><img id='matic_type_image' src="images/room_maker/roomtype/1.gif"></td>
<td valign='center' align='center'>
<a onclick='matic_pijl_2()'><img src='images/room_maker/buttons/pijl2.gif'></a>
</td>
</tr>
<tr>
<td valign='center' align='center' colspan='3'>
<div class='maticfont' id='matic_5_text' style='border: 0px;'>
Kamergrootte: 104 tegels
</div>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
<input type='hidden' id='matic_type' name='matic_type' value='1'>
</div>

<div id='matic_6' style='position:absolute; left:35; top:80; z-index:1; height: 205px; width:255px; border: 0px; visibility: hidden;'>
<table border='0' cellpadding='0' cellspacing='0' height='205' width='255'>
<tr>
<td valign='middle'>
<div class='maticfont' id='matic_6_text' style='border: 0px;'>
<input type="radio" name="matic_safety" value="1" id="matic_safety_1" checked> Deur is open<br>
<input type="radio" name="matic_safety" value="2" id="matic_safety_2"> Deur is op slot, alleen jij kan binnen<br>
<input type="radio" name="matic_safety" value="3" id="matic_safety_3"> Wachtwoord voor beperkte toegang
</div>
</td>
</tr>
</table>
</div>

<div id='matic_7' style='position:absolute; left:35; top:80; z-index:1; height: 205px; width:255px; border: 0px; visibility: hidden;'>
<table border='0' cellpadding='0' cellspacing='0' height='205' width='255'>
<tr>
<td valign='middle'>
<div class='maticfont' id='matic_7_text' style='border: 0px;'>
<b>Wachtwoord:</b><br>
<input type='password' size='15' maxlength='15' id='matic_pass1' name='matic_pass1' class='clientfont'>
<br><br>
<b>Wachtwoord opnieuw:</b><br>
<input type='password' size='15' maxlength='15' id='matic_pass2' name='matic_pass2' class='clientfont'>
</div>
</td>
</tr>
</table>
</div>

<img id='matic_lijn_1' src="images/room_maker/lijn.gif" style="position:absolute; left:32; top:288; z-index:1; height: 1px; width:255px; border: 0px;">

<img id='matic_lijn_2' src="images/room_maker/lijn.gif" style="position:absolute; left:32; top:70; z-index:1; height: 1px; width:255px; border: 0px; visibility: hidden;">

<img id='matic_lijn_3' src="images/room_maker/lijn.gif" style="position:absolute; left:32; top:105; z-index:1; height: 1px; width:255px; border: 0px; visibility: hidden;">

<div id='matic_knop_1'>
<a onclick='matic_close()'><img src="images/room_maker/buttons/afbreken.gif" style="position:absolute; left:44; top:296; z-index:1; border: 0px;"></a>
</div>

<div id='matic_knop_2'>
<a onclick='matic_button_2()'><img src="images/room_maker/buttons/start.gif" style="position:absolute; left:194; top:296; z-index:1; border: 0px;"></a>
</div>

<div id='matic_knop_3' style='visibility: hidden;'>
<a onclick='matic_close()'><img src="images/room_maker/buttons/afbreken.gif" style="position:absolute; left:32; top:296; z-index:1; border: 0px;"></a>
</div>

<div id='matic_knop_4' style='visibility: hidden;'>
<a onclick='matic_button_3()'><img src="images/room_maker/buttons/start.gif" style="position:absolute; left:213; top:296; z-index:1; border: 0px;"></a>
</div>

<div id='matic_knop_5' style='visibility: hidden;'>
<a onclick='matic_button_4()'><img src="images/room_maker/buttons/vorige.gif" style="position:absolute; left:32; top:296; z-index:1; border: 0px;"></a>
</div>

<div id='matic_knop_6' style='visibility: hidden;'>
<a onclick='matic_button_5()'><img src="images/room_maker/buttons/volgende.gif" style="position:absolute; left:201; top:296; z-index:1; border: 0px;"></a>
</div>

<div id='matic_knop_7' style='visibility: hidden;'>
<a onclick='matic_button_6()'><img src="images/room_maker/buttons/vorige.gif" style="position:absolute; left:32; top:296; z-index:1; border: 0px;"></a>
</div>

<div id='matic_knop_8' style='visibility: hidden;'>
<a onclick='matic_button_7()'><img src="images/room_maker/buttons/klaar1.gif" style="position:absolute; left:201; top:296; z-index:1; border: 0px;"></a>
</div>

</div>

<!-- Einde Room-o-Matic -->

<!-- Catalogus -->

<div id="catalogus" style="position:absolute; background: url(images/catalogus/layer.gif); display:none; overflow: hidden; left:107; top:24; height:443; width:443; z-index:140;">

<div class="handle" onmousedown="dragStart(event, 'catalogus')" style="position:absolute; left:0; top:0; height:29; width:325;">
<table border='0' width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
</tr>
</table>
</div>

<div class="handle" onmousedown="dragStart(event, 'catalogus')" style="position:absolute; left:328; top:20; height:15; width:109;">
<table border='0' width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
</tr>
</table>
</div>

<div id='catalogus_close_div' style='position:absolute; left:420; top:22; border: 0px; width: 11px; height: 11px;'>
<a onclick="HideContent('catalogus');"><img src="images/catalogus/close.gif" border='0' style='cursor: pointer;' align='top'></a></a>
</div>

<link href='catstyle.css' rel='stylesheet' type='text/css'>

<div id='logo' style='position:absolute; left:19; top:34; z-index:6; width:225px; border: 0px;'>
<img src='images/catalogus/logo/1.gif' id='srclogo'>
</div>
<div id='inhoud' style='position:absolute; left:19; top:200; z-index:6; width:225px; border: 0px;'>
<img src='images/catalogus/tabs/inhoud.gif' id='srcinhoud'>
</div>
<div id='kado' style='position:absolute; left:27; top:127; z-index:6; width:225px; border: 0px; visibility: hidden;'>
<img src='images/catalogus/tabs/kado.gif' id='srckado'>
</div>
<div id='cat_omschrijf'class='clientfont'  style='position:absolute; left:19; top:103; width: 281px; height: 50px; z-index:6; overflow: hidden; border: 0px; visibility: hidden;'>
</div>
<div id='cat_kiesart' style='position:absolute; left:20; top:161; z-index:6; border: 0px; visibility: hidden;'>
<img src='images/catalogus/kiesart.gif' id='srccat_kiesart' align='top'>
</div>
<?php
require_once("catvakjes.php");
?>
<div id='cat_pagina_div' style='position:absolute; left:22; top:384; width: 112px; height: 32px; z-index:9; border: 0px; visibility: hidden;'>
<table class='clientfont' border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'><tr><td valign='middle'>
<center>
Pagina<br><div id='cat_pagina' class='clientfont'></div>
</center>
</td></tr></table>
</div>
<div id='cat_pijl1_div' style='position:absolute; left:22; top:384; z-index:9; border: 0px; visibility: hidden;'>
<a onclick='cat_show_blz(cat_pijl1_to);'><img id='cat_pijl1' src='images/catalogus/pijl1_1.gif' border='0' style='cursor: default;'></a>
</div>
<div id='cat_pijl2_div' style='position:absolute; left:102; top:384; z-index:9; border: 0px; visibility: hidden;'>
<a onclick='cat_show_blz(cat_pijl2_to);'><img id='cat_pijl2' src='images/catalogus/pijl2_1.gif' border='0' style='cursor: default;'></a>
</div>
<div id='plaatje' style='position:absolute; left:148; top:177; z-index:9; width:225px; border: 0px; overflow: hidden;'>
<table border='0' cellpadding='0' cellspacing='0' height='175' width='175' style='overflow: hidden;'>
<tr><td valign='middle'><center>
<img src='images/catalogus/plaatjes/1.gif' id='srcplaatje' style='visibility: hidden;'>
</center></td></tr>
</table>
</div>
<div id='naam' class='clientfont' style='position:absolute; left:167; top:345; z-index:9; width:135px; border: 0px; font-weight: bold;'>
</div>
<div id='kies' class='clientfont' style='position:absolute; left:166; top:358; z-index:9; width:135px; border: 0px;'>
</div>
<div id='prijsvakje' style='position:absolute; left:156; top:384; z-index:9; border: 1px; visibility: hidden;'>
<img src='images/catalogus/prijsvak.gif' id='srcprijsvakje'>
</div>
<div id='prijs' class='clientfont' style='position:absolute; left:164; top:393; z-index:9; border: 0px; visibility: hidden;'>
</div>
<div id='koopknop' style='position:absolute; left:269; top:391; z-index:9; border: 0px; visibility: hidden;'>
<a onclick='cat_koop()'><img id='koop' src='images/knoppen/koop.gif' border='0' onmousedown='button_down("koop")' onmouseup='button_up("koop")' style='cursor: default;'></a>
</div>

<div class='catscroll' style='position:absolute; left:325; top:40; z-index:10;'>
<table border='0' cellpadding='0' cellspacing='0'>

<?php
function show_one_cat($cat_id)
{
	$functietje = halen("SELECT functie FROM members WHERE naam='".$_GET['jouwnaam']."';");
	if (($functietje == "manager") || ($functietje == "staff"))
	{
		$cat = mysql_fetch_array(mysql_query("SELECT * FROM catalogus WHERE id=".$cat_id.";"));
	}
	else
	{
		$cat = mysql_fetch_array(mysql_query("SELECT * FROM catalogus WHERE id=".$cat_id." AND actief='ja';"));
	}
	$cat_naam = $cat['naam'];
	$cat_desc = $cat['desc'];
	echo "<tr><td colspan='2' height='1'></td></tr>";
	echo "<tr><td><img src='images/catalogus/links1.gif' id='srclinks_".$cat_id."'></td>";
	echo "<td id='srccatknop_".$cat_id."' class='clientfont' onclick=\"categorie('".$cat_id."');\" width='89' height='20' style='cursor: pointer; background-color: #dddddd; overflow: hidden;'>";
	echo "<b>".$cat_naam."</b>";
	echo "</td></tr>";
}
$cat_id = 1;
$cat_naam = "Catalogus";
$cat_desc = "";
echo "<tr><td colspan='2' height='1'></td></tr>";
echo "<tr><td><img src='images/catalogus/links2.gif' id='srclinks_1'></td>";
echo "<td id='srccatknop_".$cat_id."' class='clientfont' onclick=\"categorie('".$cat_id."');\" width='89' height='20' style='cursor: pointer; background-color: #f0f0f0; overflow: hidden;'>";
echo "<b>".$cat_naam."</b>";
echo "</td></tr>";
show_one_cat(2);
$functietje = halen("SELECT functie FROM members WHERE naam='".$_GET['jouwnaam']."';");
if (($functietje == "manager") || ($functietje == "staff"))
{
	$collecties = mysql_query("SELECT * FROM catalogus WHERE id!=1 AND id!=2 AND id!=32 ORDER BY naam;");
}
else
{
	$collecties = mysql_query("SELECT * FROM catalogus WHERE actief='ja' AND id!=1 AND id!=2 AND id!=32 ORDER BY naam;");
}
if (mysql_num_rows($collecties) >= 1)
{
    while ($row = mysql_fetch_array($collecties))
    {
		$cat_id = $row['id'];
    	$cat_naam = $row['naam'];
    	$cat_desc = $row['desc'];
		if (($functietje == "manager") || ($functietje == "staff"))
		{
	    	$cat_prijslijst = mysql_query("SELECT * FROM prijslijst WHERE cat=".$cat_id.";");
    	}
    	else
    	{
	    	$cat_prijslijst = mysql_query("SELECT * FROM prijslijst WHERE cat=".$cat_id." AND actief='ja';");
    	}
	   	if (mysql_num_rows($cat_prijslijst) >= 1) 
		{
			echo "<tr><td colspan='2' height='1'></td></tr>";
			echo "<tr><td><img src='images/catalogus/links1.gif' id='srclinks_".$cat_id."'></td>";
			echo "<td id='srccatknop_".$cat_id."' class='clientfont' onclick=\"categorie('".$cat_id."');\" width='89' height='20' style='cursor: pointer; background-color: #dddddd; overflow: hidden;'>";
			echo "<b>".$row['naam']."</b>";
			echo "</td></tr>";
			$item_teller = 0;
			while ($row = mysql_fetch_array($cat_prijslijst)) 
			{
				$item_prijs = $row['prijs'];
	    		$item_naam = $row['naam'];
	    		$item_omschrijf = $row['omschrijf'];
	    		$item_cat_cat = $item_teller;
	    		$item_cat = $row['cat'];
	    		$item_catnr = $row['catnr'];
	    		$item_teller++;
   			}
		}
	}
}
show_one_cat(32);
?>
</table></div></div><br><br>
</div>
</div>
</div>

<!-- Einde Catalogus -->