<table cellpadding="0" cellspacing="2" border="0" width="100%">
<form action="index.php" method="post">
<input type="hidden" name="section" value="modules">
<input type="hidden" name="action" value="update_module">
<input type="hidden" name="module" value="chat">
<input type="hidden" name="theme" value="<?php echo $data["theme"]; ?>">
	<tr><td class="lined blue_bcg white_body padded" align="center">Rooms</td></tr>
	<tr><td class="grey-lined body padded" valign="top"><table cellpadding="2" cellspacing="2" border="0" align="center">
		<tr><td class="list_header" align="center">Room Name</td><td class="list_header" align="center">Action</td></tr>
		<?php
		while(list($room_id,$room) = each($data["chat"][rooms])){
			?><tr><td class="list_cell"><?php echo $room["name"]; echo ($data["chat"][main] == $room_id) ? " (main room)" : ""; ?></td><td class="list_cell"><?php
			
			if($data["chat"][main] == $room_id){
				admin_output_image("buttons/but_verify_disabled.gif",0,0,"set main room");
				admin_output_image("buttons/but_edit_small.gif","index.php?section=modules&action=chat_room&room_id=".$room_id."&theme=".$data["theme"],0,"edit");
				admin_output_image("buttons/but_delete_small_disabled.gif",0,0,"delete");
			}//if
			else{
				admin_output_image("buttons/but_verify.gif","index.php?section=modules&action=chat_main_room&room_id=".$room_id."&theme=".$data["theme"],0,"set main room");
				admin_output_image("buttons/but_edit_small.gif","index.php?section=modules&action=chat_room&room_id=".$room_id."&theme=".$data["theme"],0,"edit");
				admin_output_image("buttons/but_delete_small.gif","index.php?section=modules&action=chat_delete_room&room_id=".$room_id."&theme=".$data["theme"],0,"delete");
			}//else
			
			?></td></tr><?php
		}//while
		?>
		<tr><td colspan="2" align="center"><?php
		admin_form_element( array ("type" => "button", "value" => "Create New Room", "link" => "index.php?section=modules&action=chat_room&theme=".$data["theme"]) );
		?></td></tr>
	</table></tr>
</form>
</table>