<?php
// $Id: search.html.php,v 1.9 2004/03/23 13:07:46 saka_car Exp $
/**
* Content code
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.9 $
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

class search_html {
	function openhtml( $searchword ) {
		?>
<table cellpadding="0" cellspacing="5" border="0" width="98%" class="contentpane">
  <tr>
    <td class="contentheading" width="100%"><?php echo _SEARCH_TITLE; ?> </td>
  </tr>
</table>
		<?php
	}

	function searchbox( $searchword ) {
		?>
<form action="index.php" method="POST">
<table cellpadding="0" cellspacing="5" border="0" width="98%" class="contentpane">
  <tr>
    <td nowrap><?php echo _PROMPT_KEYWORD; ?>: </td>
    <td nowrap><input type="text" name="searchword" height="16" size="15" value="<?php echo stripslashes($searchword);?>" class="inputbox" /></td>
	<td width="100%" nowrap><input type="submit" name="submit" value="<?php echo _SEARCH_TITLE;?>" class="button" /></td>
  </tr>
</table>
<input type="hidden" name="option" value="com_search" />
</form>
		<?php
	}

	function searchintro( $searchword ) {
		?>
<table cellpadding="3" cellspacing="0" border="0" width="98%" class="searchintro">
  <tr>
    <td colspan="3" align="left"><?php echo _PROMPT_KEYWORD; ?>: <b><?php echo stripslashes($searchword); ?></b>
		<?php
	}

	function message( $message ) {
		?>
	<table cellpadding="3" cellspacing="0" border="0" width="98%" class="searchintro">
  <tr>
    <td colspan="3" align="left">
		<?php
		eval ('echo "'.$message.'";');
		?>
	</td>
  </tr>
	</table>
	<?php
	}

	function displaynoresult() {
		echo "</td></tr>";
	}

	function display( &$rows ) {
		global $mosConfig_offset;
		$c = count ($rows); eval  ('echo "'._NUM_RESULTS.'";'); ?>
    </td>
  </tr>
</table>
<br />
		<?php
		$tabclass = array("sectiontableentry1", "sectiontableentry2");
		$k = 0;
  		?>
<table cellpadding="1" cellspacing="0" border="0" width="98%" class="contentpane">
  		<?php
  		foreach ($rows as $row) {
			$arrDateTime = explode(" ", $row->created);
			$arrDate = explode("-", $arrDateTime[0]);
			$arrTime = explode(":", $arrDateTime[1]);
			$created = strftime ("%e %B", mktime ($arrTime[0],$arrTime[1],$arrTime[2],$arrDate[1],$arrDate[2],$arrDate[0]) + $mosConfig_offset*60*60);
	  		?>
  <tr class="<?php echo $tabclass[$k]; ?>">
    <td width="15%"><?php echo $created; ?></td>
    <td width="75%"><a href="<?php echo sefRelToAbs($row->href); ?>"><?php echo $row->title;?></a></td>
    <td width="10%" rowspan="2"><span class="small"><?php echo $row->section; ?></span></td>
  </tr>
  <tr class="<?php echo $tabclass[$k]; ?>">
    <td colspan="2"><?php echo $row->text;?> &#133; </td>
  </tr>
  			<?php
	  		$k = 1 - $k;
  		}
	}


	function conclusion( $totalRows, $searchword ) {
		global $mosConfig_live_site;
		?>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3">
		<?php
		eval ('echo "'._CONCLUSION.'";');
		?>
		<a href="http://www.google.com/search?q=<?php echo stripslashes($searchword);?>" target="_blank">
        <img src="<?php echo $mosConfig_live_site;?>/images/M_images/google.png" border="0" align="texttop" /> </td>
  </tr>
</table>
<?php
	}
}
?>