<?
//v1.1 www.exoops.info 2006/05
//	Version	: 1.0
//	Author	: code
//	Email	: codehar@code-den.com
//	Website	: http://www.code-den.com
include ("../../../mainfile.php");
include_once(XOOPS_ROOT_PATH."/class/xoopsmodule.php");
include_once(XOOPS_ROOT_PATH."/include/cp_functions.php");
global $db, $_POST;
xoops_cp_header();
if ( @file_exists(XOOPS_ROOT_PATH."/modules/directory/language/".$bcoosConfig['language'].'/languages.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 (XOOPS_ROOT_PATH."/modules/directory/dbkey.php");
include (XOOPS_ROOT_PATH."/modules/directory/queries.php");
include (XOOPS_ROOT_PATH."/modules/directory/functions.php");
include (XOOPS_ROOT_PATH."/modules/directory/head.admin.php");
?>
<td valign="top">
<?php OpenTable(); ?>
  <table class=bg3 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_RESULTS;
			print " <b>\"$a_row[department]\"</b></p>";
        }
    }
?>
	  </td>
	</tr>
	  <?php CloseTable(); ?>
    <?php OpenTable(); ?>
    <tr class=bg3>
	  <td class=TinyText valign="top"><b><?php echo _NAME ?></b></td>
	  <td class=TinyText valign="top"><b><?php echo _CODE_DIR_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>	
	  <td>&nbsp;</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><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>
            <td><a href=\"$adm_path/edit.php?action=list&personid=$a_row[personid]\">
            <img src=\"$img_path/button_edit.gif\" border=\"0\"></a></td></tr>";
    }
    CloseTable();
?>
        </table>
          <?php CloseTable(); ?>
      </td>
    </tr>
  </table>
</td>
<?
include (XOOPS_ROOT_PATH."/modules/directory/footer.php");
xoops_cp_footer();
?>
