<?
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'].'/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 (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 width="100%" border="0">
    <tr class=bg3>
      <td valign="top" colspan="5">
<?
echo "<p class=Highlight>";
echo _CODE_DIR_DISP_RESULTS;
echo "<b>";
if ($category == "".$db->prefix("dir_person").".firstname") {
    echo _CODE_DIR_FIRSTNAME;
}
elseif ($category == "".$db->prefix("dir_person").".lastname") {
    echo _CODE_DIR_LASTNAME;
}
elseif ($category == "".$db->prefix("dir_person").".title") {
    echo _CODE_DIR_TITLE;
}
elseif ($category == "".$db->prefix("dir_person").".address") {
    echo _CODE_DIR_ADDRESS;
}
else {
    echo _CODE_DIR_PHONE;
}
print "</b> ";
echo _CODE_DIR_DISP_MATCH;
print "<b>\"$searchstring\"</b></p>";
?>
      </td>
    </tr>
    <tr class=bg3>
    <td  valign=\"top\"><b><?php echo _NAME ?></b></td>
	  <td  valign=\"top\"><b><?php echo _CODE_DIR_DEPARTMENT ?></b></td>
	  <td  valign=\"top\"><b><?php echo _CODE_DIR_TITLE ?></b></td>
	  <td  valign=\"top\"><b><?php echo _CODE_DIR_PHONE ?></b></td>
	  <td  valign=\"top\"><b><?php echo _CODE_DIR_ADDRESS ?></b></td>	
	  <td  valign=\"top\">&nbsp;</td>
	</tr>
<?
/* Show search results */
$result_list = $db->query($select_search);
while ( $a_row = mysql_fetch_array( $result_list ))
    {
     # print var_dump($a_row);
     print "<tr class=bg3><td class=SmallText valign=\"top\">$a_row[lastname], $a_row[firstname]</td>
            <td class=SmallText valign=\"top\">$a_row[department]</td>
            <td class=SmallText valign=\"top\">$a_row[title]</td>
            <td class=SmallText valign=\"top\">$a_row[phone]</td>
            <td class=SmallText valign=\"top\">$a_row[address]</td>
            <td valign=\"top\"><a href=\"$adm_path/edit.php?action=list&personid=$a_row[personid]\">
            <img src=\"$img_path/button_edit.gif\" border=\"0\"></a></td></tr>\n";
    }
?>
        </table>
          <?php CloseTable(); ?>
      </td>
    </tr>
<!--  </table> -->
</td>
<?
include (XOOPS_ROOT_PATH."/modules/directory/footer.php");
xoops_cp_footer();
?>
