<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  /*require_once "/www/axislighting.com/public/cmsAdmin/lib/viewer_functions.php";*/
  require_once("../cmsAdmin/lib/viewer_functions.php");

  
  // remove white space   
  // if (@$_REQUEST['name_keyword']) { 
  // $_REQUEST['name_keyword'] = str_replace(" ", "", $_REQUEST['name_keyword']);  
  //  }
  
 //  list($itemsRecords, $itemsMetaData) = getRecords(array(
  //   'tableName'   => 'items',
  //   'where' => "REPLACE(name, ' ', '') LIKE '%".mysql_escape(@$_REQUEST['name_keyword'])."%'",
	//'debugSql' => true, 
 //	'allowSearch' => false,
 //	'limit'       => '45',
 //  ));
 
 
 
 list($itemsRecords, $itemsMetaData) = getRecords(array( 
   'tableName' => 'items',
   'limit'     => '500', 
    'where' => "hide_from_search_page != '1' ",
   'ignoreHidden' => true,
  
 ));

 $itemsRecord = @$itemsRecords[0]; // get first record
 
 $searchSuggestions = array();
 
 if (!$itemsRecord) {
 //  $searchSuggestions = getSearchSuggestions('brands', 'name', @$_REQUEST['search_words_keyword'], 6);
 }
 else {
 // $itemsRecords = filterWithReplacementItems($itemsRecords);
 }
 
 
 
 
  
  list($distributionRecords, $distributionMetaData) = getRecords(array(
    'tableName'   => 'distribution',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '100',
  ));
  $distributionRecord = @$distributionRecords[0]; // get first record
  
  list($brandsRecords, $brandsMetaData) = getRecords(array(
    'tableName'   => 'brands',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '100',
  ));
  $brandsRecord = @$brandsRecords[0]; // get first record
  
  list($downloadsRecords, $downloadsMetaData) = getRecords(array(
    'tableName'   => 'downloads',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '100',
  ));
 $downloadsRecord = @$downloadsRecords[0]; // get first record

  
 

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <style type="text/css">
    body          { font-family: arial; color:#fff;}
    .instructions { border: 3px solid #000; background-color: #EEE; padding: 10px; text-align: left; margin: 25px}
  a:link {
	color: #80a4c3;
}
a:visited {
	color: #80a4c3;
}
a:hover {
	color: #47637c;
}
  .text-12-no-justify-search {
	font-size: 12px;
	color: #7c93a7;
	font-family: Arial, Helvetica, sans-serif;
	line-height: 16px;
}
  .search-table-border {
	border: 1px solid #65768a;
}
  .search-table-rule {
	background-color: #FFF;
	height: 1px;
	width: 100%;
	margin: 0px;
	padding: 0px;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	line-height: 1px;
	background-repeat: no-repeat;
	border-top-width: 0px;
	border-right-width: 0px;
	border-bottom-width: 0px;
	border-left-width: 0px;
}
  .wrapper-image-archive {
	position: relative;
	height: 150px;
	width: 150px;
	left: 0px;
	top: 0px;
}
  .text-overlay-archive {
	position: absolute;
	font-size: 16px;
	color: #F00;
	z-index: 100;
	overflow: hidden;
	PADDING: 15px;
	text-align: center;
}
.text-overlay-archive a:link, a:visited, a:hover {
	color:#f00;
	text-decoration:none;
}
.text-overlay-archive1 {
	position: absolute;
	z-index: 100;
	overflow: hidden;
	PADDING: 10px;
	margin: 8px;
	text-align: center;
	background: rgba(255,255,255,0.5);
	height: 110px;
}
.text-overlay-archive1a {	
	font-size: 14px;
	color: #F00;
	text-align: center;

}
  </style>
 <link href="axis.css" rel="stylesheet" type="text/css" />
 <style type="text/css">
 
 </style>
 </head>
<body>
  <?php include("header.php"); ?>
 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="18"></td>
  </tr>
  <tr>  
    <td height="30" bgcolor="#16191e"><div class="breadcrumbs">Products >> Search Results </div></td>
   </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="500" valign="top" bgcolor="#2d343d"><!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
          <table align="left" cellpadding="2" cellspacing="2" class="margin-table-search-results">
            <tr>
  <?php foreach ($itemsRecords as $record):?>
	  
              <td width="168" align="left" valign="top"> 
                <?php foreach ($record['main_image'] as $upload): ?>
                
               
                <?php if ($upload['isImage']): ?>
   
      <a href="<?php echo $record['link'] ?>"><img src="<?php echo $upload['urlPath'] ?>" alt="" class="img-bord" width="150" height="150" border="0" /></a>
  <?php endif ?>
   <?php break; ?>
                <?php endforeach ?>
                <table width="150" cellpadding="0" cellspacing="0">
                  <tr>
                    <td colspan="2" height="3"></td>
                    </tr>
                  <tr>
                    <td>
                      <?php foreach ($record['small_logo'] as $upload): ?>
                      <a href="<?php echo $record['link'] ?>">
                        <img src="<?php echo $upload['urlPath'] ?>" alt="<?php echo $record['name'] ?>" border="0">
                        </a>
                      <?php endforeach ?>
                      </td>
                    <td align="right" valign="bottom">
                      <span class="text-12-no-justify-search">
                        <?php echo $record['mounting'] ?>
                          <?php echo $record['mounting2'] ?>
                           <?php echo $record['lamping'] ?>
                        </span>
                      </td>
                    </tr>
                  <tr>
                    <td height="15"></td>
                    </tr>
                  </table>
                </td>  
              <?php $maxCols=6; if (@++$count % $maxCols == 0): ?>  </tr>  <tr>  <?php endif ?>  <?php endforeach ?>     </table>
      <br/>     
  
    <?php if (!$itemsRecords): ?>
    <table width="95%" align="center" cellpadding="12" cellspacing="0" class="search-table-border"><tr><td valign="top" bgcolor="#3e4854">
  
 
    
    <div class="text-12-no-justifyWhite"><img src="images/alert.png" width="17" height="17" align="absmiddle" />&nbsp;Sorry! We were unable to locate a product that matches your search term.
      <p>Below are similar suggestions to help you refine your search.<br />
        <br />
        <img src="images/spacer-blue.jpg" width="950" height="1" vspace="10" /><br />
      </p>
   
</div>
    <?php endif ?>
    <?php if ($searchSuggestions): ?>
               <div class="text-12-no-justifyWhite"><span style="font-style: italic">Do you mean</span> <span style="font-size: 16px; font-weight: bold"><?php echo getSearchSuggestionLinks("search.php", "search_words_keyword", $searchSuggestions); ?></span>?<br /><br />
           </div></td></tr></table>
    <?php endif ?>
          
</tr>
    </table>

</tr>
    </table></td>
  </tr>
  <tr>
    <td> 
  <!-- /STEP2: Display Records -->

</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table> <?php include("footer.php"); ?>
</body>
</html>
