<?
include ("../../mainfile.php");
include (XOOPS_ROOT_PATH."/header.php");
global $xoopsTheme;
if ( @file_exists(XOOPS_ROOT_PATH."/modules/directory/language/".$bcoosConfig['language'].'/language.php') ) {
	include_once(XOOPS_ROOT_PATH."/modules/directory/language/".$bcoosConfig['language'].'/language.php');
	} else {
		include_once(XOOPS_ROOT_PATH."/modules/directory/language/english/language.php");
	}
include ('dbkey.php');
include ('queries.php');
include ('functions.php');
include ('head.php');
?>
<td valign="top">
<?php OpenTable(); ?>
  <table width="100%" border="0">
      <?php  OpenTable(); ?>
    <tr class=bg3>
	  <td valign="top" colspan="3">
<?
/* List departments in DB and build SELECT array */
$result_dept = $db->query($select_dept_list);
while ( $a_row = mysql_fetch_array( $result_dept ))
    {
        if ( $a_row[serial] == $dept ) {
            print "<p class=Highlight>";
			echo _CODE_DIR_DISP_ALL_CONTACTS;
			print"<b>\"$a_row[department]\"</b></p>";
        }
    }
?>
	  </td>
	</tr>
		  <?	CloseTable(); ?>
<?	OpenTable(); ?>	
	<tr class=bg3>
	  <td class=TinyText valign="top"><b><?php echo _NAME ?></b></td>
	  <td class=TinyText valign="top"><b><?php echo _TITLE ?></b></td>
	  <td class=TinyText valign="top"><b><?php echo _CODE_DIR_PHONE ?></b></td>
	  <td class=TinyText valign="top"><b><?php echo _CODE_DIR_ADDRESS ?></b></td>
	</tr>
<?
/* List the entries in the selected department */
$result_list = $db->query($select_dept_contacts);
while ( $a_row = mysql_fetch_array( $result_list ))
	{
	 print "<tr class=bg3>";
	 print "<td valign=\"top\">$a_row[lastname], $a_row[firstname]</td>
            <td valign=\"top\">$a_row[title]</td>
            <td valign=\"top\">$a_row[phone]</td>
            <td valign=\"top\">$a_row[address]</td>";
   print "</tr>\n";
	}
  CloseTable();
?>
        </table>
      <?php  CloseTable(); ?>
      </td>
    </tr>
  </table>
</td>
<?
include ('footer.php');
include (XOOPS_ROOT_PATH."/footer.php");
?>
